All Products
Search
Document Center

CloudMonitor:PutEventRuleTargets

Last Updated:Mar 18, 2024

Adds or modifies the push channels of 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.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RuleNamestringYes

The name of the alert rule.

testEventRule
FcParametersobject []No

The information about the recipients in Function Compute.

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
ContactParametersobject []No

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

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 level and the corresponding notification methods. Valid values of N: 1 to 5. Valid values:

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

3
MnsParametersobject []No

The information about the recipients in Message Service (MNS).

RegionstringNo

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

cn-hangzhou
QueuestringNo

The name of the MNS 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 MNS topic.

topic_sample
WebhookParametersobject []No

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

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
SlsParametersobject []No

The information about the recipients in Simple Log Service.

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
OpenApiParametersobject []No

The parameters of API callback notification.

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
FailedContactParametersobject []

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

ContactGroupNamestring

The name of the alert contact group.

Idinteger

The ID of the recipient.

2
Levelstring

The alert level and the corresponding notification methods. Valid values:

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

3
FailedMnsParametersobject []

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

Queuestring

The name of the MNS queue.

testQueue
Idinteger

The ID of the recipient.

2
Regionstring

The region ID.

cn-hangzhou
FailedFcParametersobject []

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

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 changedsee changesets
Change itemChange content
API DescriptionAPI Description Update.
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 403
    delete Error Codes: 404
    delete Error Codes: 500