Adds or modifies the push channels of an event-triggered alert rule.
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:PutEventRuleTargets | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RuleName | string | Yes | The name of the alert rule. | testEventRule |
FcParameters | array<object> | No | The information about the recipients in Function Compute. | |
object | No | |||
FunctionName | string | No | The name of the function. Valid values of N: 1 to 5. | fc-test |
Region | string | No | The region where Function Compute is deployed. Valid values of N: 1 to 5. | cn-hangzhou |
ServiceName | string | No | The name of the Function Compute service. Valid values of N: 1 to 5. | fc-test |
Id | string | No | The ID of the recipient that receives alert notifications. Valid values of N: 1 to 5. | 1 |
ContactParameters | array<object> | No | The information about the alert contact groups that receive alert notifications. | |
object | No | None. | ||
ContactGroupName | string | No | The name of the alert contact group. Valid values of N: 1 to 5. | |
Id | string | No | The ID of the recipient that receives alert notifications. Valid values of N: 1 to 5. | 2 |
Level | string | No | The alert notification methods. Valid values of N: 1 to 5. Valid values: 4: Alert notifications are sent by using DingTalk and emails. | 3 |
MnsParameters | array<object> | No | The notifications of Simple Message Queue (formerly MNS) (SMQ). | |
object | No | None. | ||
Region | string | No | The region for SMQ. Valid values of N: 1 to 5. | cn-hangzhou |
Queue | string | No | The name of the SMQ queue. Valid values of N: 1 to 5. | queue1 |
Id | string | No | The ID of the recipient that receives alert notifications. Valid values of N: 1 to 5. | 3 |
Topic | string | No | The SMQ topic. | topic_sample |
WebhookParameters | array<object> | No | The information about the callback URLs that are used to receive alert notifications. | |
object | No | |||
Protocol | string | No | The name of the protocol. Valid values of N: 1 to 5. Valid values:
| http |
Url | string | No | The callback URL. Valid values of N: 1 to 5. | http://www.aliyun.com |
Method | string | No | The HTTP request method. Valid values of N: 1 to 5. Valid values: GET and POST. | GET |
Id | string | No | The ID of the recipient that receives alert notifications. Valid values of N: 1 to 5. | 4 |
SlsParameters | array<object> | No | The information about the recipients in Simple Log Service. | |
object | No | |||
LogStore | string | No | The name of the Simple Log Service Logstore. Valid values of N: 1 to 5. | testlogstore |
Region | string | No | The region where Simple Log Service is deployed. Valid values of N: 1 to 5. | cn-hangzhou |
Project | string | No | The name of the Simple Log Service project. Valid values of N: 1 to 5. | testproject |
Id | string | No | The ID of the recipient that receives alert notifications. Valid values of N: 1 to 5. | 5 |
OpenApiParameters | array<object> | No | The parameters of API callback notification. | |
object | No | |||
Action | string | No | The API name. | PutLogs |
Arn | string | No | The Alibaba Cloud Resource Name (ARN) of the resource. Valid values of N: 1 to 5. Format:
| acs:log:cn-hangzhou::project/cms-log-mon***/logstore/cxxxx*** |
Id | string | No | The ID of the recipient that receives alert notifications sent by an API callback. | 3 |
Product | string | No | The ID of the cloud service to which the API operation belongs. | log |
Region | string | No | The region where the resource resides. | cn-hangzhou |
Role | string | No | The name of the role. | MyRole |
Version | string | No | The version of the API. | 2019-01-01 |
JsonParams | string | No | The parameters of the alert callback. Specify the parameters in the JSON format. | {"customField1":"value1","customField2":"$.name"} |
Response parameters
Examples
Sample success responses
JSON
format
{
"Code": "200",
"Message": "The Request is not authorization.",
"RequestId": "409C64DA-CF14-45DF-B463-471C790DD15A",
"Success": true,
"FailedParameterCount": "2",
"FailedContactParameters": {
"ContactParameter": [
{
"ContactGroupName": "",
"Id": 2,
"Level": "3"
}
]
},
"FailedMnsParameters": {
"MnsParameter": [
{
"Queue": "testQueue",
"Id": 2,
"Region": "cn-hangzhou"
}
]
},
"FailedFcParameters": {
"FcParameter": [
{
"ServiceName": "serviceTest1",
"FunctionName": "functionTest1",
"Id": 1,
"Region": "cn-hangzhou"
}
]
}
}
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-22 | API Description Update. The Error code has changed | View Change Details |