调用DescribeEventRuleList接口查询事件报警规则列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
cms:DescribeEventRuleList |
get |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| NamePrefix |
string |
否 |
事件报警规则前缀。 |
test |
| PageNumber |
string |
否 |
页码。 起始值:1。默认值:1。 |
1 |
| PageSize |
string |
否 |
分页时每页显示的数据行数。 起始值:1。默认值:10。 |
10 |
| GroupId |
string |
否 |
应用分组 ID。 |
7378**** |
| IsEnable |
boolean |
否 |
启用或禁用事件报警规则。取值: true(默认值):启用。 false:禁用。 |
true |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
事件报警规则列表。 |
||
| Code |
string |
状态码。 说明
200 表示成功。 |
200 |
| Message |
string |
错误信息。 |
User not authorized to operate on the specified resource. |
| RequestId |
string |
请求 ID。 |
D0E6D82B-16B5-422A-8136-EE5BDC01E415 |
| Total |
integer |
总记录条数。 |
21 |
| Success |
boolean |
操作是否成功。取值:
|
true |
| EventRules |
object |
||
| EventRule |
array<object> |
事件报警规则。 |
|
|
array<object> |
事件报警规则。 |
||
| EventType |
string |
事件报警类型。取值:
|
SYSTEM |
| Description |
string |
事件报警规则的描述信息。 |
Default group event rule. |
| GroupId |
string |
应用分组 ID。 |
7378**** |
| Name |
string |
事件报警规则名称。 |
test_DefaultEventRule_7378**** |
| State |
string |
事件报警规则状态。取值:
|
ENABLED |
| EventPattern |
object |
||
| EventPattern |
array<object> |
事件报警规则的模式。 |
|
|
array<object> |
事件报警规则的模式。 |
||
| Product |
string |
云服务名称的缩写。 |
CloudMonitor |
| LevelList |
object |
||
| LevelList |
array |
事件的等级列表。 |
|
|
string |
事件的等级。取值:
|
CRITICAL |
|
| EventTypeList |
object |
||
| EventTypeList |
array |
事件报警规则的类型列表。 |
|
|
string |
事件报警规则的类型。
|
* |
|
| NameList |
object |
||
| NameList |
array |
事件名称列表。 |
|
|
string |
事件名称列表。 |
["Agent_Status_Stopped"] |
|
| CustomFilters |
string |
自定义过滤条件。 |
ECS123 |
| KeywordFilter |
object |
过滤关键词。 |
|
| Keywords |
object |
||
| Keywords |
array |
事件匹配的关键字列表。 |
|
|
string |
关键字。 |
VMException |
|
| Relation |
string |
多个关键字的条件。取值:
|
OR |
| SQLFilter |
string |
按照 SQL 过滤日志。如果符合条件,则触发报警。 |
ycccluster1 and (i-23ij0o82612 or Executed1) or Asimulated not 222 |
| SilenceTime |
integer |
通道沉默周期。 |
86400 |
示例
正常返回示例
JSON格式
{
"Code": "200",
"Message": "User not authorized to operate on the specified resource.",
"RequestId": "D0E6D82B-16B5-422A-8136-EE5BDC01E415",
"Total": 21,
"Success": true,
"EventRules": {
"EventRule": [
{
"EventType": "SYSTEM",
"Description": "Default group event rule.",
"GroupId": "7378****",
"Name": "test_DefaultEventRule_7378****",
"State": "ENABLED",
"EventPattern": {
"EventPattern": [
{
"Product": "CloudMonitor",
"LevelList": {
"LevelList": [
"CRITICAL"
]
},
"EventTypeList": {
"EventTypeList": [
"*"
]
},
"NameList": {
"NameList": [
"[\"Agent_Status_Stopped\"]"
]
},
"CustomFilters": "ECS123",
"KeywordFilter": {
"Keywords": {
"Keywords": [
"VMException"
]
},
"Relation": "OR"
},
"SQLFilter": "ycccluster1 and (i-23ij0o82612 or Executed1) or Asimulated not 222"
}
]
},
"SilenceTime": 86400
}
]
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidParameterValue | Illegal parameters. | 参数错误。 |
| 500 | %s | %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. | 未找到指定资源。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。