All Products
Search
Document Center

CloudMonitor:PutEventRuleTargets

Last Updated:Oct 29, 2024

Adds or modifies the push channels of an event-triggered alert rule.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
cms:PutEventRuleTargetscreate
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RuleNamestringYes

The name of the alert rule.

testEventRule
FcParametersarray<object>No

The information about the recipients in Function Compute.

objectNo
FunctionNamestringNo

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

fc-test
RegionstringNo

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

cn-hangzhou
ServiceNamestringNo

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

fc-test
IdstringNo

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

1
ContactParametersarray<object>No

The information about the alert contact groups that receive alert notifications.

objectNo

None.

ContactGroupNamestringNo

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

IdstringNo

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

2
LevelstringNo

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

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

3
MnsParametersarray<object>No

The notifications of Simple Message Queue (formerly MNS) (SMQ).

objectNo

None.

RegionstringNo

The region for SMQ. Valid values of N: 1 to 5.

cn-hangzhou
QueuestringNo

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

queue1
IdstringNo

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

3
TopicstringNo

The SMQ topic.

topic_sample
WebhookParametersarray<object>No

The information about the callback URLs that are used to receive alert notifications.

objectNo
ProtocolstringNo

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

  • http
  • telnet
  • ping
http
UrlstringNo

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

http://www.aliyun.com
MethodstringNo

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

Valid values: GET and POST.

GET
IdstringNo

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

4
SlsParametersarray<object>No

The information about the recipients in Simple Log Service.

objectNo
LogStorestringNo

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

testlogstore
RegionstringNo

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

cn-hangzhou
ProjectstringNo

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

testproject
IdstringNo

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

5
OpenApiParametersarray<object>No

The parameters of API callback notification.

objectNo
ActionstringNo

The API name.

PutLogs
ArnstringNo

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
acs:log:cn-hangzhou::project/cms-log-mon***/logstore/cxxxx***
IdstringNo

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

3
ProductstringNo

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

log
RegionstringNo

The region where the resource resides.

cn-hangzhou
RolestringNo

The name of the role.

MyRole
VersionstringNo

The version of the API.

2019-01-01
JsonParamsstringNo

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

{"customField1":"value1","customField2":"$.name"}

Response parameters

ParameterTypeDescriptionExample
object
Codestring

The HTTP status code.

Note The status code 200 indicates that the request was successful.
200
Messagestring

The error message.

The Request is not authorization.
RequestIdstring

The request ID.

409C64DA-CF14-45DF-B463-471C790DD15A
Successboolean

Indicates whether the request was successful. Valid values: true and false.

true
FailedParameterCountstring

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

2
FailedContactParametersarray<object>

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

ContactParameterobject

None.

ContactGroupNamestring

The name of the alert contact group.

Idinteger

The ID of the recipient.

2
Levelstring

The alert notification methods. Valid values:

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

3
FailedMnsParametersarray<object>

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

MnsParameterobject
Queuestring

The name of the MNS queue.

testQueue
Idinteger

The ID of the recipient.

2
Regionstring

The region ID.

cn-hangzhou
FailedFcParametersarray<object>

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

FcParameterobject
ServiceNamestring

The name of the Function Compute service.

serviceTest1
FunctionNamestring

The name of the function.

functionTest1
Idinteger

The ID of the recipient.

1
Regionstring

The region ID.

cn-hangzhou

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError message
400%s%s
500InternalErrorThe request processing has failed due to some unknown error.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2021-12-22API Description Update. The Error code has changedView Change Details