开发者社区> 问答> 正文

云监控查询报警历史


描述
查询报警历史。

请求类型
GET/POST

请求参数

名称类型是否必须描述
ActionString系统规定参数,取值:ListAlarmHistory
IdString可选报警规则的id
SizeInt可选每页记录数,默认值:100
StartTimeString可选查询数据开始时间,默认24小时前,可以输入long型时间,也可以输入yyyy-MM-dd HH:mm:ss类型时间
EndTimeString可选查询数据结束时间,默认当前时间,可以输入long型时间,也可以输入yyyy-MM-dd HH:mm:ss类型时间
CursorString可选查询数据的起始位置,为空则按时间查询前100条


返回参数
名称类型描述
AlarmHistoryListList报警历史详情列表
CursorString下一页数据,为空代表没有下一页
SuccessBoolean请求是否成功
RequestIdString请求的uuid,便于查询日志
CodeString请求失败状态码,200为成功,非200为失败
MessageString请求失败的提示信息


History 的参数
名称类型描述
IdString报警规则的id
NameString报警规则的名称
NamespaceString产品的名称
MetricNameString监控项名称
DimensionString报警规则对应实例,为json object对应的字符串,例如{“instance”:”name1”}
EvaluationCountInt连续探测几次都满足阈值条件时报警
ValueString报警的当前值
AlarmTimeLong发生报警的时间
LastTimeLong报警持续时间,单位为毫秒
StateString报警规则状态,有OK,ALARM,INSUFFICIENT_DATA三种状态
StatusInteger通知发送状态,0为已通知用户,1为不在生效期未通知,2为处于报警沉默期未通知
ContactGroupsString发出的报警通知的通知对象,json array对应的字符串,例如[“联系组1”:”联系组2”],只有通知状态为0才有该字段


错误编码
错误代码描述语义
400Bad Request客户端请求中的语法错误
403Forbidden没有权限
404Not Found客户端错误,未找到
500Internal Server Error服务器内部错误
200OK正常


示例
  • 请求示例
  1. [backcolor=transparent]http[backcolor=transparent]:[backcolor=transparent]//metrics.cn-hangzhou.aliyuncs.com/?Action=ListAlarmHistory
  2. [backcolor=transparent]&[backcolor=transparent]EndTime[backcolor=transparent]=[backcolor=transparent]2017[backcolor=transparent]-[backcolor=transparent]03[backcolor=transparent]-[backcolor=transparent]16[backcolor=transparent]+[backcolor=transparent]15[backcolor=transparent]%[backcolor=transparent]3A00[backcolor=transparent]%[backcolor=transparent]3A00
  3. [backcolor=transparent]&[backcolor=transparent]Size[backcolor=transparent]=[backcolor=transparent]3
  4. [backcolor=transparent]&[backcolor=transparent]StartTime[backcolor=transparent]=[backcolor=transparent]2017[backcolor=transparent]-[backcolor=transparent]02[backcolor=transparent]-[backcolor=transparent]20[backcolor=transparent]+[backcolor=transparent]10[backcolor=transparent]%[backcolor=transparent]3A50[backcolor=transparent]%[backcolor=transparent]3A00
  5. [backcolor=transparent]&[backcolor=transparent]Id[backcolor=transparent]=[backcolor=transparent]1a775e37[backcolor=transparent]-[backcolor=transparent]dfba[backcolor=transparent]-[backcolor=transparent]430c[backcolor=transparent]-[backcolor=transparent]ab9f[backcolor=transparent]-[backcolor=transparent]7036475c8bfb[backcolor=transparent]_2dbe619b[backcolor=transparent]-[backcolor=transparent]0483[backcolor=transparent]-[backcolor=transparent]402e-9437[backcolor=transparent]-[backcolor=transparent]7c7a38fba7ed
  6. [backcolor=transparent]&<公共请求参数>
  • 返回示例

XML格式
  1. [backcolor=transparent]<ListAlarmHistoryResponse>
  2. [backcolor=transparent]  [backcolor=transparent]<AlarmHistoryList>
  3. [backcolor=transparent]    [backcolor=transparent]<AlarmHistory>
  4. [backcolor=transparent]      [backcolor=transparent]<Status>[backcolor=transparent]2[backcolor=transparent]</Status>
  5. [backcolor=transparent]      [backcolor=transparent]<Value>[backcolor=transparent]{"Maximum":301,"Minimum":301}[backcolor=transparent]</Value>
  6. [backcolor=transparent]      [backcolor=transparent]<MetricName>[backcolor=transparent]http.status_groupbyinstanceid#60[backcolor=transparent]</MetricName>
  7. [backcolor=transparent]      [backcolor=transparent]<State>[backcolor=transparent]ALARM[backcolor=transparent]</State>
  8. [backcolor=transparent]      [backcolor=transparent]<LastTime>[backcolor=transparent]122088[backcolor=transparent]</LastTime>
  9. [backcolor=transparent]      [backcolor=transparent]<AlarmTime>[backcolor=transparent]1489568222088[backcolor=transparent]</AlarmTime>
  10. [backcolor=transparent]      [backcolor=transparent]<Namespace>[backcolor=transparent]acs_sitemonitor[backcolor=transparent]</Namespace>
  11. [backcolor=transparent]      [backcolor=transparent]<ContactGroups>[backcolor=transparent]null[backcolor=transparent]</ContactGroups>
  12. [backcolor=transparent]      [backcolor=transparent]<Id>[backcolor=transparent]1a775e37-dfba-430c-ab9f-7036475c8bfb_2dbe619b-0483-402e-9437-7c7a38fba7ed[backcolor=transparent]</Id>
  13. [backcolor=transparent]      [backcolor=transparent]<EvaluationCount>[backcolor=transparent]3[backcolor=transparent]</EvaluationCount>
  14. [backcolor=transparent]    [backcolor=transparent]</AlarmHistory>
  15. [backcolor=transparent]    [backcolor=transparent]<AlarmHistory>
  16. [backcolor=transparent]      [backcolor=transparent]<Status>[backcolor=transparent]0[backcolor=transparent]</Status>
  17. [backcolor=transparent]      [backcolor=transparent]<Value>[backcolor=transparent]{"Maximum":301,"Minimum":301}[backcolor=transparent]</Value>
  18. [backcolor=transparent]      [backcolor=transparent]<MetricName>[backcolor=transparent]http.status_groupbyinstanceid#60[backcolor=transparent]</MetricName>
  19. [backcolor=transparent]      [backcolor=transparent]<State>[backcolor=transparent]ALARM[backcolor=transparent]</State>
  20. [backcolor=transparent]      [backcolor=transparent]<LastTime>[backcolor=transparent]62078[backcolor=transparent]</LastTime>
  21. [backcolor=transparent]      [backcolor=transparent]<AlarmTime>[backcolor=transparent]1489568162078[backcolor=transparent]</AlarmTime>
  22. [backcolor=transparent]      [backcolor=transparent]<Namespace>[backcolor=transparent]acs_sitemonitor[backcolor=transparent]</Namespace>
  23. [backcolor=transparent]      [backcolor=transparent]<ContactGroups>[backcolor=transparent]["云账号报警联系人"][backcolor=transparent]</ContactGroups>
  24. [backcolor=transparent]      [backcolor=transparent]<Id>[backcolor=transparent]1a775e37-dfba-430c-ab9f-7036475c8bfb_2dbe619b-0483-402e-9437-7c7a38fba7ed[backcolor=transparent]</Id>
  25. [backcolor=transparent]      [backcolor=transparent]<EvaluationCount>[backcolor=transparent]3[backcolor=transparent]</EvaluationCount>
  26. [backcolor=transparent]    [backcolor=transparent]</AlarmHistory>
  27. [backcolor=transparent]  [backcolor=transparent]</AlarmHistoryList>
  28. [backcolor=transparent]  [backcolor=transparent]<RequestId>[backcolor=transparent]7E7A6173-EC07-43A1-ABBF-1F05EBB4C2BB[backcolor=transparent]</RequestId>
  29. [backcolor=transparent]  [backcolor=transparent]<Success>[backcolor=transparent]true[backcolor=transparent]</Success>
  30. [backcolor=transparent]  [backcolor=transparent]<Code>[backcolor=transparent]200[backcolor=transparent]</Code>
  31. [backcolor=transparent]</ListAlarmHistoryResponse>

JSON格式
  1. [backcolor=transparent]{
  2. [backcolor=transparent]    [backcolor=transparent]"AlarmHistoryList"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
  3. [backcolor=transparent]        [backcolor=transparent]"AlarmHistory"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent][
  4. [backcolor=transparent]            [backcolor=transparent]{
  5. [backcolor=transparent]                [backcolor=transparent]"Status"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]2[backcolor=transparent],[backcolor=transparent]
  6. [backcolor=transparent]                [backcolor=transparent]"Value"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"{\"Maximum\":301,\"Minimum\":301}"[backcolor=transparent],[backcolor=transparent]
  7. [backcolor=transparent]                [backcolor=transparent]"MetricName"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"http.status_groupbyinstanceid#60"[backcolor=transparent],[backcolor=transparent]
  8. [backcolor=transparent]                [backcolor=transparent]"State"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"ALARM"[backcolor=transparent],[backcolor=transparent]
  9. [backcolor=transparent]                [backcolor=transparent]"LastTime"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]122088[backcolor=transparent],[backcolor=transparent]
  10. [backcolor=transparent]                [backcolor=transparent]"AlarmTime"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]1489568222088[backcolor=transparent],[backcolor=transparent]
  11. [backcolor=transparent]                [backcolor=transparent]"Namespace"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"acs_sitemonitor"[backcolor=transparent],[backcolor=transparent]
  12. [backcolor=transparent]                [backcolor=transparent]"ContactGroups"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"null"[backcolor=transparent],[backcolor=transparent]
  13. [backcolor=transparent]                [backcolor=transparent]"Id"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"1a775e37-dfba-430c-ab9f-7036475c8bfb_2dbe619b-0483-402e-9437-7c7a38fba7ed"[backcolor=transparent],[backcolor=transparent]
  14. [backcolor=transparent]                [backcolor=transparent]"EvaluationCount"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]3
  15. [backcolor=transparent]            [backcolor=transparent]},[backcolor=transparent]
  16. [backcolor=transparent]            [backcolor=transparent]{
  17. [backcolor=transparent]                [backcolor=transparent]"Status"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]0[backcolor=transparent],[backcolor=transparent]
  18. [backcolor=transparent]                [backcolor=transparent]"Value"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"{\"Maximum\":301,\"Minimum\":301}"[backcolor=transparent],[backcolor=transparent]
  19. [backcolor=transparent]                [backcolor=transparent]"MetricName"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"http.status_groupbyinstanceid#60"[backcolor=transparent],[backcolor=transparent]
  20. [backcolor=transparent]                [backcolor=transparent]"State"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"ALARM"[backcolor=transparent],[backcolor=transparent]
  21. [backcolor=transparent]                [backcolor=transparent]"LastTime"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]62078[backcolor=transparent],[backcolor=transparent]
  22. [backcolor=transparent]                [backcolor=transparent]"AlarmTime"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]1489568162078[backcolor=transparent],[backcolor=transparent]
  23. [backcolor=transparent]                [backcolor=transparent]"Namespace"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"acs_sitemonitor"[backcolor=transparent],[backcolor=transparent]
  24. [backcolor=transparent]                [backcolor=transparent]"ContactGroups"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"[\"云账号报警联系人\"]"[backcolor=transparent],[backcolor=transparent]
  25. [backcolor=transparent]                [backcolor=transparent]"Id"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"1a775e37-dfba-430c-ab9f-7036475c8bfb_2dbe619b-0483-402e-9437-7c7a38fba7ed"[backcolor=transparent],[backcolor=transparent]
  26. [backcolor=transparent]                [backcolor=transparent]"EvaluationCount"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]3
  27. [backcolor=transparent]            [backcolor=transparent]}
  28. [backcolor=transparent]        [backcolor=transparent]]
  29. [backcolor=transparent]    [backcolor=transparent]},[backcolor=transparent]
  30. [backcolor=transparent]    [backcolor=transparent]"RequestId"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"1DBBCE29-0F69-435C-B65C-53D1011D1D72"[backcolor=transparent],[backcolor=transparent]
  31. [backcolor=transparent]    [backcolor=transparent]"Success"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]true[backcolor=transparent],[backcolor=transparent]
  32. [backcolor=transparent]    [backcolor=transparent]"Code"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"200"
  33. [backcolor=transparent]}

展开
收起
反向一觉 2017-10-31 13:56:30 1872 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
《阿里云云拨测发布》PDF 立即下载
智能告警:IT系统神经中枢 立即下载
ARMS 智能告警套件最佳实践 立即下载