Get Latest Stats

Get Latest Stats

Get the latest stat for a given Resource and given a set of attributes

Request
URI
GET
https://{api_host}/suite-api/api/resources/{id}/stats/latest
COPY
Path Parameters
string
id
Required

The StatsQuery object which can be used to refine the query

Query Parameters
string of array
resourceId
Optional
Constraints: minItems: 1 maxItems: 1000

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

string of array
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
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

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

Returns stats-of-resources of type(s) application/json
"{\n  \"values\" : [ {\n    \"resourceId\" : \"583acdba-31ac-4862-907d-fff8744d53a3\",\n    \"stat-list\" : {\n      \"stat\" : [ {\n        \"timestamps\" : [ 1744473856434, 1744473866434 ],\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\" : [ 1744473856434, 1744473866434, 1744473876434 ],\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


Code Samples
COPY
                    curl -H 'Authorization: <value>' https://{api_host}/suite-api/api/resources/{id}/stats/latest