调用DescribeAlertLogHistogram接口查询报警历史的直方图列表。
接口说明
本文将提供一个示例,从云服务product维度查询 ECS 报警历史的直方图列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
cms:DescribeAlertLogHistogram |
get |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| StartTime |
integer |
否 |
查询报警历史的开始时间戳。 单位:毫秒。 说明
|
1609988009694 |
| EndTime |
integer |
否 |
查询报警历史的结束时间戳。 单位:毫秒。 说明
|
1609989009694 |
| PageNumber |
integer |
否 |
页码。 默认值:1。 |
1 |
| PageSize |
integer |
否 |
每页显示记录条数。 默认值:10。 |
10 |
| SearchKey |
string |
否 |
查询报警历史的搜索关键字。 |
alert |
| GroupId |
string |
否 |
应用分组 ID。 |
7301**** |
| Product |
string |
否 |
云服务名称缩写。 |
ECS |
| Namespace |
string |
否 |
云服务的命名空间。 说明
关于云服务的命名空间,请参见云服务监控项。 |
acs_ecs_dashboard |
| Level |
string |
否 |
报警的级别和通知方式。取值:
|
P4 |
| SendStatus |
string |
否 |
报警状态。取值:
当报警状态为 0 时,如果 Level 的取值为 P2、P3 或 P4,则发生告警;如果 Level 的取值为 OK,则报警恢复正常。 |
0 |
| ContactGroup |
string |
否 |
报警联系人组。 |
ECS_Group |
| RuleName |
string |
否 |
报警规则名称。 |
test123 |
| MetricName |
string |
否 |
监控项名称。 说明
关于云服务的监控项,请参见云服务监控项。 |
cpu_total |
| LastMin |
string |
否 |
获取日志的周期。单位:分钟。 |
360 |
| GroupBy |
string |
否 |
对数据进行空间维度聚合,相当于 SQL 中的 Group By。取值:
|
product |
| SourceType |
string |
否 |
该参数已废弃,无需关注。 |
无 |
| EventType |
string |
否 |
告警类型。取值:
|
RESOLVED |
| RuleId |
string |
否 |
报警规则 ID。 关于如何获取报警规则 ID,请参见 DescribeMetricRuleList 。 |
ae06917_75a8c43178ab66**** |
关于公共请求参数的详情,请参见公共参数。
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
无。 |
||
| Code |
string |
状态码。 说明
200 表示成功。 |
200 |
| Message |
string |
错误信息。 |
The specified resource is not found. |
| RequestId |
string |
请求 ID。 |
1C4A3709-BF52-42EE-87B5-7435F0929585 |
| Success |
boolean |
操作是否成功。取值:
|
true |
| AlertLogHistogramList |
array<object> |
查询报警历史的直方图列表。 |
|
|
object |
无。 |
||
| From |
integer |
查询报警历史的开始时间戳。 单位:秒。 |
1610074791 |
| To |
integer |
查询报警历史的结束时间戳。 单位:秒。 |
1610074800 |
| Count |
integer |
报警历史的数量。 |
20 |
示例
正常返回示例
JSON格式
{
"Code": "200",
"Message": "The specified resource is not found.",
"RequestId": "1C4A3709-BF52-42EE-87B5-7435F0929585",
"Success": true,
"AlertLogHistogramList": [
{
"From": 1610074791,
"To": 1610074800,
"Count": 20
}
]
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | ParameterInvalid | %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. | 未找到指定资源。 |
| 409 | ResourceConflict | Concurrent modification of resources. | |
| 409 | ResourceExist | Resources already exist. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。