调用DescribeActiveMetricRuleList接口查询一键报警规则的列表详情。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
cms:DescribeActiveMetricRuleList |
get |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| Product |
string |
是 |
支持一键报警规则的云产品名称缩写。 关于如何获取云产品名称,请参见 DescribeProductsOfActiveMetricRule 。 |
ecs |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
无。 |
||
| Code |
string |
状态码。 说明
200 表示成功。 |
200 |
| Message |
string |
错误信息。 |
The Request is not authorization. |
| RequestId |
string |
请求 ID。 |
F82E6667-7811-4BA0-842F-5B2DC42BBAAD |
| Success |
boolean |
操作是否成功。取值:
|
true |
| Datapoints |
object |
||
| Alarm |
array<object> |
报警规则列表。 |
|
|
object |
无。 |
||
| SilenceTime |
string |
通道沉默时间。 单位:秒。 |
86400 |
| MetricName |
string |
监控指标名称。 |
cpu_total |
| EvaluationCount |
string |
报警重试次数。 |
3 |
| Webhook |
string |
URL 回调地址。 |
https://www.aliyun.com |
| State |
string |
报警规则的启用状态。 |
Enable |
| ContactGroups |
string |
报警联系人组。 |
ECS_Group |
| Namespace |
string |
云产品的命名空间。 |
acs_ecs_dashboard |
| RuleName |
string |
报警规则名称。 |
SystemDefault_acs_rds_dashboard_CpuUsage |
| RuleId |
string |
报警规则 ID。 |
a151cd6023eacee2f0978e03863cc1697c89508**** |
| Period |
string |
监控数据的聚合周期。 单位:秒。 |
60 |
| ComparisonOperator |
string |
报警规则比较符。取值:
|
> |
| EndTime |
string |
报警规则失效时间。 单位:小时。例如:23 表示 |
24 |
| StartTime |
string |
报警规则生效起始时间。 单位:小时。例如:00 表示 |
00 |
| Threshold |
string |
报警阈值。 |
90 |
| Statistics |
string |
统计方法。 |
Average |
| Enable |
string |
报警规则的启用状态。取值:
|
true |
| AlertList |
object |
||
| Alert |
array<object> |
报警规则列表。该列表的结构和获取报警规则列表保持统一。 |
|
|
array<object> |
无。 |
||
| SilenceTime |
string |
通道沉默时间。 单位:秒。 |
86400 |
| MetricName |
string |
监控项的名称。 |
cpu_total |
| Webhook |
string |
URL 回调地址。 |
http://www.aliyun.com |
| ContactGroups |
string |
报警联系人组。 |
ECS_Group |
| Namespace |
string |
云服务的命名空间。 |
acs_ecs_dashboard |
| EffectiveInterval |
string |
报警规则的生效时间段。 |
00:00-23:59 |
| NoEffectiveInterval |
string |
报警不生效的时间段。 |
00:00-06:00 |
| MailSubject |
string |
发送邮件的主题。 |
ECS_Bucket |
| RuleName |
string |
报警规则名称。 |
myAlert |
| RuleId |
string |
报警规则 ID。 |
ruleIdxxxx |
| Period |
string |
监控数据的聚合周期。 单位:秒。 |
60 |
| AlertState |
string |
报警规则状态。取值:
|
OK |
| Dimensions |
string |
指定资源的监控数据。 |
"" |
| EnableState |
boolean |
报警规则的启用状态。取值:
|
true |
| Resources |
string |
报警规则关联的资源。 |
[{"resource":"_ALL"}] |
| Escalations |
object |
报警分级别触发条件。 |
|
| Info |
object |
Info 级别报警触发条件。 |
|
| ComparisonOperator |
string |
Info 级别阈值比较符。取值:
|
GreaterThanThreshold |
| Times |
string |
Info 级别连续出现次数。 Info 级别连续出现达到该值且超过阈值才会触发报警。 |
3 |
| Threshold |
string |
Info 级别阈值。 |
95 |
| Statistics |
string |
Info 级别报警统计方法。 |
Average |
| Warn |
object |
Warn 级别报警触发条件。 |
|
| ComparisonOperator |
string |
Warn 级别阈值比较符。取值:
|
GreaterThanThreshold |
| Times |
string |
Warn 级别连续出现次数。 Warn 级别连续出现达到该值且超过阈值才会触发报警。 |
3 |
| Threshold |
string |
Warn 级别阈值。 |
80 |
| Statistics |
string |
Warn 级别报警统计方法。 |
Average |
| Critical |
object |
Critical 级别报警触发条件。 |
|
| ComparisonOperator |
string |
Critical 级别阈值比较符。取值:
|
GreaterThanThreshold |
| Times |
string |
Critical 级别连续出现次数。Critical 级别连续出现达到该值且超过阈值才会触发报警。 |
3 |
| Threshold |
string |
Critical 级别阈值。 |
99 |
| Statistics |
string |
Critical 级别报警统计方法。 |
Average |
示例
正常返回示例
JSON格式
{
"Code": "200",
"Message": "The Request is not authorization.",
"RequestId": "F82E6667-7811-4BA0-842F-5B2DC42BBAAD",
"Success": true,
"Datapoints": {
"Alarm": [
{
"SilenceTime": "86400",
"MetricName": "cpu_total",
"EvaluationCount": "3",
"Webhook": "https://www.aliyun.com",
"State": "Enable",
"ContactGroups": "ECS_Group",
"Namespace": "acs_ecs_dashboard",
"RuleName": "SystemDefault_acs_rds_dashboard_CpuUsage",
"RuleId": "a151cd6023eacee2f0978e03863cc1697c89508****",
"Period": "60",
"ComparisonOperator": ">",
"EndTime": "24",
"StartTime": "00",
"Threshold": "90",
"Statistics": "Average",
"Enable": "true"
}
]
},
"AlertList": {
"Alert": [
{
"SilenceTime": "86400",
"MetricName": "cpu_total",
"Webhook": "http://www.aliyun.com",
"ContactGroups": "ECS_Group",
"Namespace": "acs_ecs_dashboard",
"EffectiveInterval": "00:00-23:59",
"NoEffectiveInterval": "00:00-06:00",
"MailSubject": "ECS_Bucket",
"RuleName": "myAlert",
"RuleId": "ruleIdxxxx",
"Period": "60",
"AlertState": "OK",
"Dimensions": "\"\"",
"EnableState": true,
"Resources": "[{\"resource\":\"_ALL\"}]",
"Escalations": {
"Info": {
"ComparisonOperator": "GreaterThanThreshold",
"Times": "3",
"Threshold": "95",
"Statistics": "Average"
},
"Warn": {
"ComparisonOperator": "GreaterThanThreshold",
"Times": "3",
"Threshold": "80",
"Statistics": "Average"
},
"Critical": {
"ComparisonOperator": "GreaterThanThreshold",
"Times": "3",
"Threshold": "99",
"Statistics": "Average"
}
}
}
]
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | ParameterInvalid | %s | |
| 401 | AccessDeniedException | You donot have sufficient access to perform this action. | |
| 402 | LimitExceeded | The quota for this customer had been reached. | |
| 403 | AccessForbidden | The X.509 certificate or cms access key ID provided does not exist in our records. | |
| 404 | ResourceNotFound | The specified resource is not found. | 未找到指定资源。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。