Query Latest Stats Of Resources

Query Latest Stats Of Resources

Get the last "maxSamples" stats values for specified one or more Resources

Request
URI
POST
https://{api_host}/suite-api/api/resources/stats/latest/query
COPY
Request Body

The object which specifies the search criteria

latest-stat-query of type(s) application/json
Required
"{\n  \"resourceId\" : [ \"998cef2d-29e5-4eaf-8124-42269527ba3a\", \"71e6ff8b-9f97-4f91-9f90-46e0f9c02410\" ],\n  \"statKey\" : [ \"stat|key1\", \"stat|key2\" ],\n  \"metrics\" : false,\n  \"currentOnly\" : false,\n  \"maxSamples\" : 1,\n  \"wrapStatValues\" : false\n}"
array of string
resourceId
Optional
Constraints: minItems: 1 maxItems: 1000

Array of Resource ids for which the latest stats should be fetched

array of string
statKey
Optional

Array of stat keys for which the latest stats should be returned

boolean
metrics
Optional

Indicates whether specified statKey-s of query should be forcibly treated as metrics (does not include instanced stats)

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.

integer As int32 As int32
maxSamples
Optional

The maximum number of samples to return when querying latest stats.
Defaults to 1 so that when processing the query if it is omitted
the response would contain a single sample

boolean
wrapStatValues
Optional

Indicates whether stat values should be wrapped for application/xml response content type.
This flag is false by default and not needed for application/json response.
If set to true "statValues" will be returned instead of "values" for all content types.

Authentication
This operation uses the following authentication methods.
Responses
200

The requested stats

Returns stats-of-resources of type(s) application/json
"{\n  \"values\" : [ {\n    \"resourceId\" : \"f6888441-c149-4400-a6ae-90dc483ad832\",\n    \"stat-list\" : {\n      \"stat\" : [ {\n        \"timestamps\" : [ 1744473855126, 1744473865126 ],\n        \"statKey\" : {\n          \"key\" : \"stat|key1\"\n        },\n        \"rollUpType\" : \"NONE\",\n        \"intervalUnit\" : {\n          \"quantifier\" : 5,\n          \"intervalType\" : \"MINUTES\"\n        },\n        \"data\" : [ 1.0, 2.0 ],\n        \"dtTimestamps\" : [ 1744473855126, 1744473865126, 1744473875126 ],\n        \"minThresholdData\" : [ 0.5, 1.0 ],\n        \"maxThresholdData\" : [ 1.5, 3.0 ],\n        \"smoothValues\" : [ 1.5, 1.5 ]\n      } ]\n    }\n  } ]\n}"
array of object
values
Optional

Collection of resource-stat objects


404

Non of the resources could be found

Operation doesn't return any data structure

500

Error during the query

Operation doesn't return any data structure

Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{}' https://{api_host}/suite-api/api/resources/stats/latest/query