Adds or modifies the recipients to which alert notifications are sent based on an event-triggered alert rule.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes PutEventRuleTargets

The operation that you want to perform. Set the value to PutEventRuleTargets.

RuleName String Yes testEventRule

The name of the event-triggered alert rule.

FcParameters.N.FunctionName String No fc-test

The name of the function. Valid values of N: 1 to 5.

FcParameters.N.Region String No cn-hangzhou

The region where Function Compute is deployed. Valid values of N: 1 to 5.

FcParameters.N.ServiceName String No fc-test

The name of the Function Compute service. Valid values of N: 1 to 5.

FcParameters.N.Id String No 1

The ID of the recipient that receives alert notifications. Valid values of N: 1 to 5.

ContactParameters.N.ContactGroupName String No Default alert contact group

The name of the alert contact group. Valid values of N: 1 to 5.

ContactParameters.N.Id String No 2

The ID of the recipient that receives alert notifications. Valid values of N: 1 to 5.

ContactParameters.N.Level String No 3

The alert notification methods. Valid values of N: 1 to 5. Valid values:

4: Alert notifications are sent by using DingTalk chatbots and emails.

MnsParameters.N.Region String No cn-hangzhou

The region where Message Service (MNS) is deployed. Valid values of N: 1 to 5.

MnsParameters.N.Queue String No queue1

The name of the queue. Valid values of N: 1 to 5.

MnsParameters.N.Id String No 3

The ID of the recipient that receives alert notifications. Valid values of N: 1 to 5.

MnsParameters.N.Topic String No topic_sample

The MNS topic.

WebhookParameters.N.Protocol String No http

The name of the protocol. Valid values of N: 1 to 5. Valid values:

  • http
  • telnet
  • ping
WebhookParameters.N.Url String No http://www.aliyun.com

The callback URL. Valid values of N: 1 to 5.

WebhookParameters.N.Method String No GET

The HTTP request method. Valid values of N: 1 to 5.

Valid values: GET and POST.

WebhookParameters.N.Id String No 4

The ID of the recipient that receives alert notifications. Valid values of N: 1 to 5.

SlsParameters.N.LogStore String No testlogstore

The name of the Log Service Logstore. Valid values of N: 1 to 5.

SlsParameters.N.Region String No cn-hangzhou

The region where Log Service is deployed. Valid values of N: 1 to 5.

SlsParameters.N.Project String No testproject

The name of the Log Service project. Valid values of N: 1 to 5.

SlsParameters.N.Id String No 5

The ID of the recipient that receives alert notifications. Valid values of N: 1 to 5.

OpenApiParameters.N.Action String No PutLogs

The name of the API operation.

OpenApiParameters.N.Arn String No acs:log:cn-hangzhou::project/cms-log-mon***/logstore/cxxxx***

The Alibaba Cloud Resource Name (ARN) of the resource. Valid values of N: 1 to 5.

Format: arn:acs:${Service}:${Region}:${Account}:${ResourceType}/${ResourceId}. Fields:

  • Service: the code of a cloud service
  • Region: the region ID
  • Account: the ID of an Alibaba Cloud account
  • ResourceType: the resource type
  • ResourceId: the resource ID
OpenApiParameters.N.Id String No 3

The ID of the recipient that receives alert notifications sent by an API callback.

OpenApiParameters.N.Product String No log

The ID of the cloud service to which the API operation belongs.

OpenApiParameters.N.Region String No cn-hangzhou

The region where the resource resides.

OpenApiParameters.N.Role String No MyRole

The name of the role.

OpenApiParameters.N.Version String No 2019-01-01

The version of the API.

OpenApiParameters.N.JsonParams String No {"customField1":"value1","customField2":"$.name"}

The parameters of the alert callback. The parameters are in the JSON format.

Response parameters

Parameter Type Example Description
Code String 200

The HTTP status code.

Note The status code 200 indicates that the call was successful.
Message String The Request is not authorization.

The error message.

RequestId String 409C64DA-CF14-45DF-B463-471C790DD15A

The ID of the request.

Success Boolean true

Indicates whether the call was successful. The value true indicates success. The value false indicates failure.

FailedParameterCount String 2

The number of resources that failed to be created or modified.

FailedContactParameters Array of ContactParameter

This parameter is returned if the specified alert contact groups in the request failed to be created or modified.

ContactParameter
ContactGroupName String Default alert contact group

The name of the alert contact group.

Id Integer 2

The ID of the recipient.

Level String 3

The alert notification methods. Valid values:

4: Alert notifications are sent by using DingTalk chatbots and emails.

FailedMnsParameters Array of MnsParameter

This parameter is returned if the specified queues in the request failed to be created or modified in MNS.

MnsParameter
Queue String testQueue

The name of the MNS queue.

Id Integer 2

The ID of the recipient.

Region String cn-hangzhou

The ID of the region.

FailedFcParameters Array of FcParameter

This parameter is returned if the specified functions in the request failed to be created or modified in Function Compute.

FcParameter
ServiceName String serviceTest1

The name of the Function Compute service.

FunctionName String functionTest1

The name of the function.

Id Integer 1

The ID of the recipient.

Region String cn-hangzhou

The ID of the region.

Examples

Sample requests

http(s)://[Endpoint]/?Action=PutEventRuleTargets
&RuleName=testEventRule
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DeleteCustomMetric>
		<RequestId>681CC49A-DD28-4D11-B86F-19D3F71E0EAE</RequestId>
		<Code>200</Code>
		<Success>true</Success>
</DeleteCustomMetric>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "681CC49A-DD28-4D11-B86F-19D3F71E0EAE",
  "Code" : "200",
  "Success" : true
}

Error codes

For a list of error codes, visit the API Error Center.