调用DescribeMetricRuleTemplateAttribute接口查询报警模板详情。
本文将提供一个示例,查询报警模板70****
的详情。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeMetricRuleTemplateAttribute |
要执行的操作,取值:DescribeMetricRuleTemplateAttribute。 |
Name | String | 否 | ECS_Template1 |
报警模板名称。 关于如何获取报警模板名称,请参见DescribeMetricRuleTemplateList。 |
TemplateId | String | 否 | 70**** |
报警模板ID。 关于如何获取报警模板ID,请参见DescribeMetricRuleTemplateList。 |
关于公共请求参数的详情,请参见公共参数。
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Code | Integer | 200 |
状态码。 说明 200表示成功。
|
RequestId | String | 8F3A82AD-DA92-52B0-8EC6-C059D1C3839F |
请求ID。 |
Message | String | The specified resource is not found. |
错误信息。 |
Resource | Struct |
报警模板详情。 |
|
AlertTemplates | Array of AlertTemplate |
报警模板列表。 |
|
AlertTemplate | |||
Category | String | ecs |
云服务名称缩写。 |
Escalations | Struct |
阈值及报警级别。 |
|
Critical | Struct |
Critical级别报警触发条件。 |
|
ComparisonOperator | String | GreaterThanOrEqualToThreshold |
Critical级别的阈值比较符。取值:
|
Statistics | String | Average |
Critical级别的统计方法。 每个云服务的 |
Threshold | String | 90 |
Critical级别的阈值。 |
Times | Integer | 5 |
Critical级别的重试次数。 |
Info | Struct |
Info级别报警触发条件。 |
|
ComparisonOperator | String | GreaterThanOrEqualToThreshold |
Info级别的阈值比较符。取值:
|
Statistics | String | Average |
Info级别的统计方法。 每个云服务的 |
Threshold | String | 90 |
Info级别的阈值。 |
Times | Integer | 3 |
Info级别的重试次数。 |
Warn | Struct |
Warn级别报警触发条件。 |
|
ComparisonOperator | String | GreaterThanOrEqualToThreshold |
Warn级别阈值的比较符。取值:
|
Statistics | String | Average |
Warn级别的统计方法。 每个云服务的 |
Threshold | String | 90 |
Warn级别的阈值。 |
Times | Integer | 3 |
Warn级别的重试次数。 |
MetricName | String | cpu_total |
监控项名称。 |
Namespace | String | acs_ecs_dashboard |
云服务的命名空间。 |
NoDataPolicy | String | KEEP_LAST_STATE |
无监控数据时报警的处理方式。取值:
|
RuleName | String | ECS_Rule |
报警规则名称。 |
Selector | String | {"disk":"/"} |
报警维度扩展选项。 |
Webhook | String | https://www.aliyun.com |
触发报警回调的URL地址。 |
Description | String | ECS模板 |
报警模板描述信息。 |
Name | String | ECS_Template1 |
报警模板名称。 |
RestVersion | String | 1 |
报警模板版本。 |
TemplateId | String | 70**** |
报警模板ID。 |
Success | Boolean | true |
操作是否成功。取值:
|
示例
请求示例
http(s)://[Endpoint]/?Action=DescribeMetricRuleTemplateAttribute
&TemplateId=70****
&<公共请求参数>
正常返回示例
XML
格式
<DescribeMetricRuleTemplateAttributeResponse>
<RequestId>8F3A82AD-DA92-52B0-8EC6-C059D1C3839F</RequestId>
<Resource>
<AlertTemplates>
<AlertTemplate>
<MetricName>cpu_total</MetricName>
<Category>ecs</Category>
<Escalations>
<Critical>
<ComparisonOperator>GreaterThanOrEqualToThreshold</ComparisonOperator>
<Times>5</Times>
<Statistics>Average</Statistics>
<Threshold>90</Threshold>
</Critical>
<Info></Info>
<Warn></Warn>
</Escalations>
<CompositeExpression></CompositeExpression>
<Webhook></Webhook>
<Namespace>acs_ecs_dashboard</Namespace>
<RuleName>ECS_Rule</RuleName>
<Selector></Selector>
</AlertTemplate>
</AlertTemplates>
<Description></Description>
<RestVersion>1</RestVersion>
<TemplateId>70****</TemplateId>
<Name>ECS_Template1</Name>
</Resource>
<Code>200</Code>
<Success>true</Success>
</DescribeMetricRuleTemplateAttributeResponse>
JSON
格式
{
"RequestId": "8F3A82AD-DA92-52B0-8EC6-C059D1C3839F",
"Resource": {
"HostAvailabilityTemplates": [],
"AlertTemplates": {
"AlertTemplate": [
{
"MetricName": "cpu_total",
"Category": "ecs",
"Escalations": {
"Critical": {
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"Times": 5,
"Statistics": "Average",
"Threshold": "90"
},
"Info": {},
"Warn": {}
},
"CompositeExpression": {},
"Webhook": "",
"Namespace": "acs_ecs_dashboard",
"RuleName": "ECS_Rule",
"Selector": {}
}
]
},
"Description": "",
"SystemEventTemplates": [],
"RestVersion": 1,
"ProcessMonitorTemplates": [],
"TemplateId": "70****",
"Name": "ECS_Template1"
},
"Code": 200,
"Success": true
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
404 | ResourceNotFound | The specified resource is not found. | 未找到指定资源。 |
访问错误中心查看更多错误码。