Operation description
If the specified rule name does not exist, an event-triggered alert rule is created. If the specified rule name exists, the specified event-triggered alert rule is modified.
In this example, the myRuleName
alert rule is created for the ecs
cloud service.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
cms:PutEventRule | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RuleName | string | Yes | The name of the event-triggered alert rule. | myRuleName |
GroupId | string | No | The ID of the application group to which the event-triggered alert rule belongs. | 7378**** |
EventType | string | No | The type of the event-triggered alert rule. Valid values:
| SYSTEM |
Description | string | No | The description of the event-triggered alert rule. | |
State | string | No | The status of the event-triggered alert rule. Valid values:
| ENABLED |
EventPattern | array<object> | Yes | ||
object | Yes | |||
EventTypeList | array | No | ||
string | No | The type of the event-triggered alert rule. Valid values of N: 1 to 50. Valid values:
| Exception | |
StatusList | array | No | ||
string | No | The status of the event-triggered alert rule. Valid values of N: 1 to 50. | Failed | |
Product | string | Yes | The type of the cloud service. Valid values of N: 1 to 50. Note
You can call the DescribeSystemEventMetaList operation to query the cloud services that support event-triggered alerts. For more information, see DescribeSystemEventMetaList .
| ecs |
LevelList | array | No | ||
string | No | The level of the event-triggered alert rule. Valid values of N: 1 to 50. Valid values:
| CRITICAL | |
NameList | array | No | ||
string | No | The name of the event-triggered alert rule. Valid values of N: 1 to 50. | Agent_Status_Stopped | |
CustomFilters | string | No | The keyword that is used to filter events. If the content of an event contains the specified keyword, an alert is automatically triggered. | Stopping |
SQLFilter | string | No | The SQL condition that is used to filter events. If the content of an event meets the specified SQL condition, an alert is automatically triggered. Note
The syntax of SQL event filtering is consistent with the query syntax of Log Service.
| 192.168.XX.XX and Executed |
SilenceTime | long | No | The mute period during which new alerts are not sent even if the trigger conditions are met. Unit: seconds. | 86400 |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
JSON
format
{
"Code": "200",
"Message": "The Request is not authorization.",
"Data": "1",
"RequestId": "0B47C47B-E68A-4429-BB23-370E91889C7D",
"Success": true
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | %s | %s |
500 | InternalError | The request processing has failed due to some unknown error. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2021-12-24 | The Error code has changed | View Change Details |