DescribeMetric
Retrieves the full definition of an existing metric from the specified Connect Customer instance.
Request Syntax
GET /metrics/definitions/InstanceId/MetricId HTTP/1.1
URI Request Parameters
The request uses the following URI parameters.
- InstanceId
-
The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.
Length Constraints: Minimum length of 1. Maximum length of 100.
Required: Yes
- MetricId
-
The identifier of the metric to describe. Adding the
$SAVEDqualifier will describe the saved version of the metric. Adding$LATESTor omitting a qualifier will describe the published version.Length Constraints: Minimum length of 1. Maximum length of 150.
Required: Yes
Request Body
The request does not have a request body.
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"Metric": {
"Arn": "string",
"Category": "string",
"CreatedTime": number,
"CreatedUser": { ... },
"CreationMethod": "string",
"DefaultStat": "string",
"Description": "string",
"EffectiveTime": number,
"Filters": [
{
"Id": "string",
"Type": "string"
}
],
"Groupings": [ "string" ],
"Id": "string",
"LastModifiedRegion": "string",
"LastModifiedTime": number,
"LastModifiedUser": { ... },
"MetricCalculation": {
"Calculation": "string",
"CalculationComponents": [
{
"Alias": "string",
"MetricFilters": [
{
"BooleanCondition": {
"Comparison": "string"
},
"MetricFilterKey": "string",
"Negate": boolean,
"NumberCondition": {
"Comparison": "string",
"Values": [ number ]
},
"StringCondition": {
"Comparison": "string",
"Values": [ "string" ]
}
}
],
"MetricId": "string",
"MetricName": "string"
}
]
},
"Name": "string",
"PositiveTrendIndicator": "string",
"PrimaryEventSource": "string",
"PrimaryEventSourceEffectiveTimestampType": "string",
"RefreshRate": number,
"Status": "string",
"SupportedStats": [ "string" ],
"SupportsCustomCalculation": boolean,
"SupportsPreaggregateCalculation": boolean,
"Tags": {
"string" : "string"
},
"Type": "string",
"Unit": "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.
- Metric
-
The metric definition.
Type: MetricDefinition object
Errors
For information about the errors that are common to all actions, see Common Error Types.
- AccessDeniedException
-
You do not have sufficient permissions to perform this action.
HTTP Status Code: 403
- InternalServiceException
-
Request processing failed because of an error or failure with the service.
- Message
-
The message.
HTTP Status Code: 500
- InvalidParameterException
-
One or more of the specified parameters are not valid.
- Message
-
The message about the parameters.
HTTP Status Code: 400
- InvalidRequestException
-
The request is not valid.
- Message
-
The message about the request.
- Reason
-
Reason why the request was invalid.
HTTP Status Code: 400
- ResourceNotFoundException
-
The specified resource was not found.
- Message
-
The message about the resource.
HTTP Status Code: 404
- ThrottlingException
-
The throttling limit has been exceeded.
HTTP Status Code: 429
Examples
Example
The following example retrieves the saved version of a metric.
Sample Request
GET /metrics/definitions/12345678-1234-1234-1234-123456789012/87654321-4321-4321-4321-210987654321:$SAVED
Sample Response
{
"Metric": {
"Arn": "arn:aws:connect:us-west-2:123456789012:instance/12345678-1234-1234-1234-123456789012/metric/87654321-4321-4321-4321-210987654321:$SAVED",
"Id": "87654321-4321-4321-4321-210987654321",
"Name": "example-metric",
"Status": "SAVED",
"Type": "CUSTOMER_MANAGED",
"Unit": "PERCENT",
"MetricCalculation": {
"Calculation": "100 * SUM(M1) / SUM(M2)",
"CalculationComponents": [
{"Alias": "M1", "MetricName": "CONTACTS_HANDLED"},
{"Alias": "M2", "MetricName": "CONTACTS_QUEUED"}
]
}
}
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: