调用DescribeSystemEventCount接口查询当前账号下各云服务发生事件的数量。
接口说明
背景信息
您可以调用 DescribeSystemEventMetaList ,获取云监控支持的各云服务及其系统事件。
使用说明
本文将提供一个示例,查询当前账号云服务器ECS发生事件的数量,返回结果显示,发生事件的数量共 3 条。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
cms:DescribeSystemEventCount |
get |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| Product |
string |
否 |
云服务名称。 调用 DescribeSystemEventMetaList 接口,获取返回参数 |
ECS |
| EventType |
string |
否 |
事件类型。 调用 DescribeSystemEventMetaList 接口,获取返回参数 |
StatusNotification |
| Name |
string |
否 |
事件名称。 调用 DescribeSystemEventMetaList 接口,获取返回参数 |
Instance:StateChange |
| Level |
string |
否 |
事件级别。取值:
调用 DescribeSystemEventMetaList 接口,获取返回参数 |
Info |
| Status |
string |
否 |
事件状态。 调用 DescribeSystemEventMetaList 接口,获取返回参数 |
Normal |
| GroupId |
string |
否 |
应用分组 ID。 |
17285**** |
| SearchKeywords |
string |
否 |
搜索事件内容包含的关键字。取值:
|
ECS |
| StartTime |
string |
否 |
查询事件开始的时间戳。单位:毫秒。 |
1635993541000 |
| EndTime |
string |
否 |
查询事件结束的时间戳。单位:毫秒。 |
1635993921000 |
关于公共请求参数的详情,请参见公共参数。
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| Code |
string |
状态码。 说明
200 表示成功。 |
200 |
| Message |
string |
返回信息。 当请求成功时,返回成功信息;当请求失败时,返回失败原因。 |
success |
| RequestId |
string |
请求 ID。 |
C7A7B776-0ACE-5A93-9B07-DE8008D9CCDF |
| Success |
string |
操作是否成功。取值:
|
true |
| SystemEventCounts |
object |
||
| SystemEventCount |
array<object> |
事件详情。 |
|
|
object |
事件详情。 |
||
| Status |
string |
事件状态。 |
Normal |
| Time |
integer |
事件发生的时间戳。单位:毫秒。 |
1635993751000 |
| GroupId |
string |
应用分组 ID。 |
17285**** |
| Product |
string |
事件的云服务名称。 |
ECS |
| InstanceName |
string |
实例名称。 |
ECS-test |
| Num |
integer |
发生事件的数量。 |
3 |
| ResourceId |
string |
资源 ID。 |
i-rj99xc6cptkk64ml**** |
| Name |
string |
事件名称。 |
Instance:StateChange |
| Content |
string |
事件描述。 |
Instance status change notification |
| Level |
string |
事件级别。取值:
|
Info |
| RegionId |
string |
地域 ID。 |
cn-hangzhou |
示例
正常返回示例
JSON格式
{
"Code": "200",
"Message": "success",
"RequestId": "C7A7B776-0ACE-5A93-9B07-DE8008D9CCDF",
"Success": "true",
"SystemEventCounts": {
"SystemEventCount": [
{
"Status": "Normal",
"Time": 1635993751000,
"GroupId": "17285****",
"Product": "ECS",
"InstanceName": "ECS-test",
"Num": 3,
"ResourceId": "i-rj99xc6cptkk64ml****",
"Name": "Instance:StateChange",
"Content": "Instance status change notification",
"Level": "Info",
"RegionId": "cn-hangzhou"
}
]
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | ParameterInvalid | Illegal parameters. | |
| 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. | 未找到指定资源。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。