Get Stats For Resource Using POST

Get Stats For Resource Using POST

NOTE: When making an XML request, make sure the statKey field does not contain any key name with spaces.

Request
URI
POST
https://{api_host}/api/resources/{id}/stats/query
COPY
Path Parameters
string
id
Required

The Identifier of the resource object


Request Body

The StatsQuery object which can be used to refine the query

stat-query of type(s) application/json
Optional
{
    "begin": 0,
    "currentOnly": false,
    "dt": false,
    "end": 0,
    "intervalQuantifier": 0,
    "intervalType": "string",
    "latestMaxSamples": 0,
    "metrics": false,
    "resourceId": [
        "string"
    ],
    "rollUpType": "string",
    "statKey": [
        "string"
    ]
}
integer As int64 As int64
begin
Optional

The beginning date as a long value of the range of stats to return Value measures the number of milliseconds since January 1, 1970 00:00:00 UTC NOTE: If not provided, 24 hour rearward of ending date is used

boolean
currentOnly
Optional

Indicates whether to report only "current" stat values, i.e. skip the stat-s that haven't published any value during recent collection cycles.

boolean
dt
Optional

Indicates that the requested stats are based on some dynamic threshold. Defaults to false which indicates that stats are not based on dynamic threshold.

integer As int64 As int64
end
Optional

The ending date as a long value of the range of stats to return Long value is number of milliseconds since January 1, 1970 00:00:00 UTC NOTE: The ending date must not be less than the beginning date. If not provided, current time as UTC milliseconds is used

integer As int32 As int32
intervalQuantifier
Optional

Number for the interval type

string
intervalType
Optional

Interval type requested by the user (e.g: Days, Weeks, Months etc.)

Possible values are : HOURS, MINUTES, SECONDS, DAYS, WEEKS, MONTHS, YEARS,
integer As int32 As int32
latestMaxSamples
Optional

The maximum number of samples to return when querying latest. When processing the get latest stats query if it is omitted a value of 1 is assumed. A query for the latest samples is not compatible with specifying the RollUpType value.

boolean
metrics
Optional

Indicates whether specified statKey-s of query should be forcibly treated as metrics

array of string
resourceId
Optional

Array of Resource ids for which the stats should be fetched

string
rollUpType
Optional

Rollup Type requested by the user (e.g.: AVG, MIN, MAX etc.)

Possible values are : SUM, AVG, MIN, MAX, NONE, LATEST, COUNT,
array of string
statKey
Optional

Array of stat keys for which the stats should be returned

Authentication
This operation uses the following authentication methods.
Responses
200

Object, containing a map of List of Stat objects keyed by each resource UUID

Returns stats-of-resources of type(s) application/json
{
    "values": [
        {
            "resourceId": "string",
            "stats": {
                "stat": [
                    {
                        "data": [
                            "number"
                        ],
                        "dtTimestamps": [
                            0
                        ],
                        "intervalUnit": {
                            "intervalType": "string",
                            "quantifier": 0
                        },
                        "links": [
                            {
                                "description": "string",
                                "href": "string",
                                "name": "string",
                                "rel": "string"
                            }
                        ],
                        "maxThresholdData": [
                            "number"
                        ],
                        "minThresholdData": [
                            "number"
                        ],
                        "rollUpType": "string",
                        "smoothValues": [
                            "number"
                        ],
                        "statKey": {
                            "key": "string"
                        },
                        "timestamps": [
                            0
                        ],
                        "values": [
                            "string"
                        ]
                    }
                ]
            }
        }
    ]
}
values
Optional

Collection of resource-stat objects