ListMetrics - AWS Resilience Hub

ListMetrics

Lists the metrics that can be exported.

Request Syntax

POST /list-metrics HTTP/1.1 Content-type: application/json { "conditions": [ { "field": "string", "operator": "string", "value": "string" } ], "dataSource": "string", "fields": [ { "aggregation": "string", "name": "string" } ], "maxResults": number, "nextToken": "string", "sorts": [ { "ascending": boolean, "field": "string" } ] }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

conditions

Indicates the list of all the conditions that were applied on the metrics.

Type: Array of Condition objects

Array Members: Minimum number of 0 items. Maximum number of 50 items.

Required: No

dataSource

Indicates the data source of the metrics.

Type: String

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

Required: No

fields

Indicates the list of fields in the data source.

Type: Array of Field objects

Array Members: Minimum number of 0 items. Maximum number of 50 items.

Required: No

maxResults

Maximum number of results to include in the response. If more results exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.

Type: Integer

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

Required: No

nextToken

Null, or the token from a previous call to get the next set of results.

Type: String

Pattern: ^\S{1,2000}$

Required: No

sorts

(Optional) Indicates the order in which you want to sort the fields in the metrics. By default, the fields are sorted in the ascending order.

Type: Array of Sort objects

Array Members: Minimum number of 0 items. Maximum number of 50 items.

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "nextToken": "string", "rows": [ [ "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.

nextToken

Token for the next set of results, or null if there are no more results.

Type: String

Pattern: ^\S{1,2000}$

rows

Specifies all the list of metric values for each row of metrics.

Type: Array of arrays of strings

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

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions.

HTTP Status Code: 403

InternalServerException

This exception occurs when there is an internal failure in the AWS Resilience Hub service.

HTTP Status Code: 500

ThrottlingException

This exception occurs when you have exceeded the limit on the number of requests per second.

HTTP Status Code: 429

ValidationException

This exception occurs when a request is not valid.

HTTP Status Code: 400

Examples

Sample Request

The following is an example request payload.

Sample Request

{ "dataSource": "Applications", "fields": [ { "name": "Application Arn" } ] }

Sample Response

The following is an example response payload.

Sample Response

{ "headers": [ "Application Arn" ], "rows": [ [ "arn:aws:resiliencehub:us-west-2:444455556666:app/dd058443-7e2f-410d-bee6-c634cb3edb39" ] ] }

See Also

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