DescribeMetricRuleTemplateAttribute
Queries the details of an alert template by calling the DescribeMetricRuleTemplateAttribute operation.
Operation description
This topic provides an example on how to query the details of the alert template 70****.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cms:DescribeMetricRuleTemplateAttribute |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Name |
string |
No |
The name of the alert template. You must set either For information about how to obtain the alert template name, see DescribeMetricRuleTemplateList. |
ECS_Template1 |
| TemplateId |
string |
No |
The ID of the alert template. You must set either For information about how to obtain the alert template ID, see DescribeMetricRuleTemplateList. |
70**** |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| Code |
integer |
The HTTP status code. Note
The value 200 indicates success. |
200 |
| Message |
string |
The error message. |
The specified resource is not found. |
| RequestId |
string |
The request ID. |
8F3A82AD-DA92-52B0-8EC6-C059D1C3839F |
| Success |
boolean |
Indicates whether the operation was successful. Valid values:
|
true |
| Resource |
object |
The details of the alert template. |
|
| Description |
string |
The description of the alert template. |
ECS template |
| Name |
string |
The name of the alert template. |
ECS_Template1 |
| RestVersion |
string |
The version of the alert template. |
1 |
| TemplateId |
string |
The ID of the alert template. |
70**** |
| AlertTemplates |
object |
||
| AlertTemplate |
array<object> |
The alert templates. |
|
|
array<object> |
The alert template. |
||
| MetricName |
string |
The name of the metric. |
cpu_total |
| Selector |
string |
The extended options for the alert dimensions. |
{"disk":"/"} |
| Webhook |
string |
The URL of the alert callback that is triggered. |
https://www.aliyun.com |
| Namespace |
string |
The namespace of the Alibaba Cloud service. |
acs_ecs_dashboard |
| Category |
string |
The abbreviation of the Alibaba Cloud service name. |
ecs |
| RuleName |
string |
The name of the alert rule. |
ECS_Rule |
| NoDataPolicy |
string |
The method used to handle alerts when no monitoring data is available. Valid values:
|
KEEP_LAST_STATE |
| Escalations |
object |
The thresholds and alert levels. |
|
| Info |
object |
The conditions for triggering an Info-level alert. |
|
| ComparisonOperator |
string |
The comparison operator for the threshold of the Info-level alert. Valid values:
|
GreaterThanOrEqualToThreshold |
| Times |
integer |
The number of retries for the Info-level alert. |
3 |
| Threshold |
string |
The threshold for the Info-level alert. |
90 |
| Statistics |
string |
The statistical method for the Info-level alert. The valid values of the |
Average |
| Warn |
object |
The conditions for triggering a Warn-level alert. |
|
| ComparisonOperator |
string |
The comparison operator for the threshold of the Warn-level alert. Valid values:
|
GreaterThanOrEqualToThreshold |
| Times |
integer |
The number of retries for the Warn-level alert. |
3 |
| Threshold |
string |
The threshold for the Warn-level alert. |
90 |
| Statistics |
string |
The statistical method for the Warn-level alert. The valid values of the |
Average |
| Critical |
object |
The conditions for triggering a Critical-level alert. |
|
| ComparisonOperator |
string |
The comparison operator for the threshold of the Critical-level alert. Valid values:
|
GreaterThanOrEqualToThreshold |
| Times |
integer |
The number of retries for the Critical-level alert. |
5 |
| Threshold |
string |
The threshold for the Critical-level alert. |
90 |
| Statistics |
string |
The statistical method for the Critical-level alert. The valid values of the |
Average |
| Labels |
object |
||
| Labels |
array<object> |
The labels of the alert template. |
|
|
object |
The label of the alert template. |
||
| Key |
string |
The label key of the alert template. |
label1 |
| Value |
string |
The label value of the alert template. |
value1 |
| SilenceTime |
integer |
The mute period of the channel. Unit: seconds. |
3600 |
Examples
Success response
JSON format
{
"Code": 200,
"Message": "The specified resource is not found.",
"RequestId": "8F3A82AD-DA92-52B0-8EC6-C059D1C3839F",
"Success": true,
"Resource": {
"Description": "ECS template",
"Name": "ECS_Template1",
"RestVersion": "1",
"TemplateId": "70****",
"AlertTemplates": {
"AlertTemplate": [
{
"MetricName": "cpu_total",
"Selector": "{\"disk\":\"/\"}",
"Webhook": "https://www.aliyun.com",
"Namespace": "acs_ecs_dashboard",
"Category": "ecs",
"RuleName": "ECS_Rule",
"NoDataPolicy": "KEEP_LAST_STATE",
"Escalations": {
"Info": {
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"Times": 3,
"Threshold": "90",
"Statistics": "Average"
},
"Warn": {
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"Times": 3,
"Threshold": "90",
"Statistics": "Average"
},
"Critical": {
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"Times": 5,
"Threshold": "90",
"Statistics": "Average"
}
},
"Labels": {
"Labels": [
{
"Key": "label1",
"Value": "value1"
}
]
},
"SilenceTime": 3600
}
]
}
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | ParameterInvalid | Illegal parameters. | |
| 400 | %s | %s | |
| 412 | %s | %s | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | AccessForbidden | User not authorized to operate on the specified resource. | |
| 404 | ResourceNotFound | The specified resource is not found. | The specified resource is not found. |
| 409 | %s | %s |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.