Retrieve total size of all the Outbound Messages for an app_id

get

/iot/api/v2/apps/{app_id}/monitoring/metrics/dataVolume/messages/outbound

Returns the total size, in bytes, of all messages flowing to devices (outbound) for the given app_id of A Service Instance.A GET request, without any query parameters, returns data for last 24 hours at an hourly granularity, including the cumulative number of messages for the current hour with a maximum lag of 5 seconds. Query parameters can be specified to change data pattern to daily, monthly or specify the time frame or number of data points.

Request

Path Parameters
Query Parameters
  • Overrides the default number of data points returned. It works as a multiplier for the period value specified. For example, if the period is set to Hourly, the toDate is set to 2015-04-09T08:00:00Z, and the count is set to 5, hourly data for 5 hours ending at 0800 hours on 9th April, 2015 is returned.
  • Orders the data returned as per the key-value pairs specified. The key "dateTime" (case-sensitive) can be specified to order the results by their Timestamp. The corresponding value for the keys can be "asc" or "desc" (both case-sensitive) for ascending and descending order respectively. If not specified, the default value is taken as "asc".
  • Specifies the granularity of the period of time for which information is sought. The period can be Hourly, Daily, or Monthly (case insensitive). The default value is Hourly.

    If you set the period to Hourly, the last 24 hours of data are returned at an hourly granularity. The data returned is at clock hour granularity (for example, data is returned for 01:00 hours, 00:00 hours, and so on).

    If you set the period to Daily, the last 30 days of data are returned at a daily granularity. The data returned is at a calendar day granularity (for example, data is returned for an entire day, computed at an early hour of the next day). The timestamp signifies the hour when the daily information was created by the aggregation of the entire day's data. Typically, the timestamp is an early hour of the following day. For example, "dateTimeAsString":"2015-06-01T00:00:00-07:00" implies that the data is from May 31, 2015. If the current day is not yet completed, the data returned is an aggregation of the number of hours that elapsed in that day; "dateTimeAsString" contains the most recent of hour of the day.

    To ensure that hourly aggregations complete before the daily data is aggregated, the daily aggregation happens at 01:00 hours every day.

    If you set the period to Monthly, the last 12 months of data are returned at a monthly granularity. The data returned is at a calendar month granularity (for example, data is returned for the month of January, February, and so on). The timestamp signifies the time when the information was aggregated. For example, dateTimeAsString:"2015-05-01T00:00:00-07:00" implies that the data is for the month of April, 2015. If the current month is not yet completed, the data returned is an aggregation of the number of hours that have elapsed in the month; "dateTimeAsString" contains the most recent hour of the month.

    To ensure that daily aggregations complete before the monthly data is aggregated, the monthly aggregation happens at 02:00 hours on the first day of a new calendar month.

  • Specifies the start of the period for which information is sought, as an ISO-8601 formatted date string or epoch value. If this value is set to a time before the data collection has started, information will be returned only for the period from which data is available in the system.
  • Specifies the end of the period for which information is sought, as an ISO-8601 formatted date string or epoch value. If this value is set to a time in the future, information will be returned only for the period up to the current time.
Back to Top

Response

Supported Media Types

200 Response

OK
Body ()
Root Schema : DateTimeValueList
Type: object
List of metrics records
Show Source
Nested Schema : items
Type: array
Array of datetime and metric value
Show Source
Nested Schema : DateTimeValue
Type: object
Date, time and value
Show Source

401 Response

Unauthorized. This error is returned if the access token is not valid or has expired.

403 Response

Forbidden. This error is returned if the operation is not allowed for the request.
Back to Top

Examples

The following example shows how to view up total size of all messeages flowing to devices from the IoT Cloud Service instance for the given app_id 0?AE by submitting a GET request on the REST resource using cURL. For more information about cURL, see Use cURL.

Note:

In the request and response, iotserver will be replaced by name and port of your assigned Oracle IoT Cloud Service instance. The format of the Cloud Service instance is myinstance-myidentitydomain.iot.us.oraclecloud.com and the default port is 443.
curl -X GET -H 'Accept:application/json' -u 'username@example.com:password' http:iotserver:7001/iot/api/v2/apps/0-AE/monitoring/metrics/dataVolume/messages/outbound

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 200 OK
Content-Type: application/json

Example of Response Body

The following example shows the contents of the response body in JSON format.

{
    "items":[
        {
            "dateTimeAsString":"2016-07-18T10:38:17Z",
            "dateTime":"1468838297626",
            "value":"3000"
        },
        ...
        {
            "dateTimeAsString":"2016-07-17T12:30:00Z",
            "dateTime":"1468758600000",
            "value":"500"
        }
    ],
    "links":[
        {
            "rel":"canonical",
            "href":"http://iotserver/iot/api/v2/apps/0-AE/monitoring/metrics/dataVolume/messages/outbound"
        },
        {
            "rel":"self",
            "href":"http://iotserver/iot/api/v2/apps/0-AE/monitoring/metrics/dataVolume/messages/outbound"
        }
    ]
}
Back to Top