调用DescribeAlertHistoryList接口查询报警历史详情。
目前该API接口已标记为弃用,推荐使用替代API:Cms(2019-01-01) - DescribeAlertLogList。
接口说明
本 API 不再维护,推荐您使用 DescribeAlertLogList 。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
cms:DescribeAlertHistoryList |
get |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| RuleId |
string |
否 |
报警规则 ID。 关于如何查询报警规则 ID,请参见 DescribeMetricRuleList 。 |
applyTemplate61dc81b5-d357-4cf6-a9b7-9f83c1d5**** |
| RuleName |
string |
否 |
报警规则名称。 关于如何查询报警规则名称,请参见 DescribeMetricRuleList 。 |
ECS_Rule |
| Namespace |
string |
否 |
云产品的数据命名空间。 关于如何查询云产品的数据命名空间,请参见云产品监控项。 |
acs_ecs_dashboard |
| MetricName |
string |
否 |
云产品的监控项名称。 关于如何查询云产品的监控项名称,请参见云产品监控项。 |
cpu_total |
| GroupId |
string |
否 |
应用分组 ID。 关于如何获取应用分组 ID,请参见 DescribeMonitorGroups 。 |
7671**** |
| Status |
string |
否 |
通道沉默状态。取值:
|
2 |
| State |
string |
否 |
报警状态。取值:
|
ALARM |
| Ascending |
boolean |
否 |
时间排序。取值:
|
true |
| StartTime |
string |
否 |
查询报警历史的开始时间戳。 单位:毫秒。 |
1640237400000 |
| EndTime |
string |
否 |
查询报警历史的结束时间戳。 单位:毫秒。 |
1640608200000 |
| PageSize |
integer |
否 |
每页显示记录条数。 默认值:10。 |
10 |
| Page |
integer |
否 |
页码。 默认值:1。 |
1 |
关于公共请求参数的详情,请参见公共参数。
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
无。 |
||
| Code |
string |
状态码。 说明
200 表示成功。 |
200 |
| Message |
string |
错误信息。 |
The Request is not authorization. |
| RequestId |
string |
请求 ID。 |
C3C69FBE-2262-541F-A409-C52F380BAE63 |
| Total |
string |
总记录条数。 |
2 |
| Success |
boolean |
操作是否成功。取值:
|
true |
| AlarmHistoryList |
object |
||
| AlarmHistory |
array<object> |
报警历史详情。 |
|
|
array<object> |
报警历史详情。 |
||
| Status |
integer |
通道沉默状态。取值:
|
2 |
| MetricName |
string |
监控项名称。 |
cpu_total |
| EvaluationCount |
integer |
报警重试次数。 |
3 |
| State |
string |
报警状态。取值:
|
ALARM |
| Namespace |
string |
云服务的命名空间。 |
acs_ecs_dashboard |
| Webhooks |
string |
URL 回调地址。 |
https://www.aliyun.com |
| RuleName |
string |
报警规则名称。 |
ECS_Rule |
| RuleId |
string |
报警规则 ID。 |
applyTemplate61dc81b5-d357-4cf6-a9b7-9f83c1d5**** |
| LastTime |
integer |
报警持续的时间。单位:毫秒。 |
360133 |
| Value |
string |
出现报警或报警恢复时的监控值。 |
10.58 |
| Expression |
string |
报警触发的表达式。 |
$Average>=10 |
| GroupId |
string |
应用分组 ID。 |
7671**** |
| AlertTime |
integer |
报警推送的时间戳。单位:毫秒。 |
1640586600000 |
| InstanceName |
string |
实例名称。 |
i-bp1cqhiw1za2**** |
| Dimensions |
string |
报警的资源。 |
{\"instanceId\":\"i-bp1cqhiw1za2****\"} |
| Level |
string |
报警的级别和通知方式。取值:
|
P4 |
| Contacts |
object |
||
| Contact |
array |
报警联系人。 |
|
|
string |
报警联系人。 |
Alice |
|
| ContactALIIMs |
object |
||
| ContactALIIM |
array |
报警联系人的旺旺号。 说明
该参数仅适用于中国站。 |
|
|
string |
报警联系人的旺旺号。 说明
该参数仅适用于中国站。 |
username@example.com |
|
| ContactMails |
object |
||
| ContactMail |
array |
报警联系人的邮箱地址。 |
|
|
string |
报警联系人的邮箱地址。 |
username@example.com |
|
| ContactSmses |
object |
||
| ContactSms |
array |
报警联系人的手机号码。 说明
该参数仅适用于中国站。 |
|
|
string |
报警联系人的手机号码。 说明
该参数仅适用于中国站。 |
13900009999 |
|
| ContactGroups |
object |
||
| ContactGroup |
array |
报警联系人组。 |
|
|
string |
报警联系人组。 |
ECS_Group |
示例
正常返回示例
JSON格式
{
"Code": "200",
"Message": "The Request is not authorization.",
"RequestId": "C3C69FBE-2262-541F-A409-C52F380BAE63",
"Total": "2",
"Success": true,
"AlarmHistoryList": {
"AlarmHistory": [
{
"Status": 2,
"MetricName": "cpu_total",
"EvaluationCount": 3,
"State": "ALARM",
"Namespace": "acs_ecs_dashboard",
"Webhooks": "https://www.aliyun.com",
"RuleName": "ECS_Rule",
"RuleId": "applyTemplate61dc81b5-d357-4cf6-a9b7-9f83c1d5****",
"LastTime": 360133,
"Value": "10.58",
"Expression": "$Average>=10",
"GroupId": "7671****",
"AlertTime": 1640586600000,
"InstanceName": "i-bp1cqhiw1za2****",
"Dimensions": "{\\\"instanceId\\\":\\\"i-bp1cqhiw1za2****\\\"}",
"Level": "P4",
"Contacts": {
"Contact": [
"Alice"
]
},
"ContactALIIMs": {
"ContactALIIM": [
"username@example.com"
]
},
"ContactMails": {
"ContactMail": [
"username@example.com"
]
},
"ContactSmses": {
"ContactSms": [
"13900009999"
]
},
"ContactGroups": {
"ContactGroup": [
"ECS_Group"
]
}
}
]
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | %s | %s | |
| 500 | %s | %s | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 204 | %s | %s | |
| 403 | %s | %s | |
| 206 | %s | %s | |
| 404 | %s | %s | |
| 503 | %s | %s | |
| 406 | %s | %s | |
| 409 | %s | %s |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。