ListMetricValues - AWS IoT

ListMetricValues

Lists the values reported for an AWS IoT Device Defender metric (device-side metric, cloud-side metric, or custom metric) by the given thing during the specified time period.

Request Syntax

GET /metric-values?dimensionName=dimensionName&dimensionValueOperator=dimensionValueOperator&endTime=endTime&maxResults=maxResults&metricName=metricName&nextToken=nextToken&startTime=startTime&thingName=thingName HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

dimensionName

The dimension name.

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [a-zA-Z0-9:_-]+

dimensionValueOperator

The dimension value operator.

Valid Values: IN | NOT_IN

endTime

The end of the time period for which metric values are returned.

Required: Yes

maxResults

The maximum number of results to return at one time.

Valid Range: Minimum value of 1. Maximum value of 250.

metricName

The name of the security profile metric for which values are returned.

Required: Yes

nextToken

The token for the next set of results.

startTime

The start of the time period for which metric values are returned.

Required: Yes

thingName

The name of the thing for which security profile metric values are returned.

Length Constraints: Minimum length of 1. Maximum length of 128.

Required: Yes

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200 Content-type: application/json { "metricDatumList": [ { "timestamp": number, "value": { "cidrs": [ "string" ], "count": number, "number": number, "numbers": [ number ], "ports": [ number ], "strings": [ "string" ] } } ], "nextToken": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

metricDatumList

The data the thing reports for the metric during the specified time period.

Type: Array of MetricDatum objects

nextToken

A token that can be used to retrieve the next set of results, or null if there are no additional results.

Type: String

Errors

InternalFailureException

An unexpected error has occurred.

HTTP Status Code: 500

InvalidRequestException

The request is not valid.

HTTP Status Code: 400

ResourceNotFoundException

The specified resource does not exist.

HTTP Status Code: 404

ThrottlingException

The rate exceeds the limit.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: