调用PutEventRuleTargets接口添加或修改规则的发送目标。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String PutEventRuleTargets

要执行的操作,取值:PutEventRuleTargets

RuleName String testEventRule

报警规则的名称。

FcParameters.N.FunctionName String fc-test

函数名称。N的取值范围:1~5。

FcParameters.N.Region String cn-hangzhou

函数服务对应的地域。N的取值范围:1~5。

FcParameters.N.ServiceName String fc-test

函数服务的服务名称。N的取值范围为1~5。

FcParameters.N.Id String 1

规则发送目标的唯一标识。N的取值范围:1~5。

ContactParameters.N.ContactGroupName String 默认报警联系组

报警联系人组的名称。N的取值范围:1~5。

ContactParameters.N.Id String 2

规则发送目标的唯一标识。N的取值范围:1~5。

ContactParameters.N.Level String 3

报警通知级别。N的取值范围:1~5。取值:

4:钉钉、邮箱

MnsParameters.N.Region String cn-hangzhou

消息服务对应的地域。N的取值范围:1~5。

MnsParameters.N.Queue String queue1

队列名称。N的取值范围:1~5。

MnsParameters.N.Id String 3

规则发送目标的唯一标识。N的取值范围:1~5。

MnsParameters.N.Topic String topic_sample

消息服务的主题。

WebhookParameters.N.Protocol String http

协议名称。N的取值范围:1~5。取值:

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

回调的URL。N的取值范围:1~5。

WebhookParameters.N.Method String GET

HTTP回调的请求方法。N的取值范围:1~5。

目前仅支持GET和POST。

WebhookParameters.N.Id String 4

规则发送目标的唯一标识。N的取值范围:1~5。

SlsParameters.N.LogStore String testlogstore

日志服务对应的日志库。N的取值范围:1~5。

SlsParameters.N.Region String cn-hangzhou

日志服务对应的地域。N的取值范围:1~5。

SlsParameters.N.Project String testproject

日志服务对应的项目。N的取值范围:1~5。

SlsParameters.N.Id String 5

规则发送目标的唯一标识。N的取值范围:1~5。

OpenApiParameters.N.Action String PutLogs

API名称。

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

资源的ARN。N的取值范围:1~5。

格式:arn:acs:${Service}:${Region}:${Account}:${ResourceType}/${ResourceId}。各字段含义如下:

  • Service:云产品。
  • Region:地域ID。
  • Account:阿里云账号ID。
  • ResourceType:资源类型。
  • ResourceId:资源ID。
OpenApiParameters.N.Id String 3

API回调通知方式的唯一标识。

OpenApiParameters.N.Product String log

API对应的云产品ID。

OpenApiParameters.N.Region String cn-hangzhou

资源对应的地域。

OpenApiParameters.N.Role String MyRole

角色名称。

OpenApiParameters.N.Version String 2019-01-01

API的版本。

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

报警回调的JSON格式参数。

返回数据

名称 类型 示例值 描述
Code String 200

状态码。

说明 200表示成功。
Message String The Request is not authorization.

错误信息。

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

请求ID。

Success Boolean true

操作是否成功。true表示成功,false表示失败。

FailedParameterCount String 2

错误参数数量统计。

FailedContactParameters Array of ContactParameter

如果规则发送目标中包含创建错误的报警联系人组,则返回此参数。

ContactParameter
ContactGroupName String 默认报警联系人组

报警联系人组的名称。

Id Integer 2

规则发送目标的ID。

Level String 3

报警通知级别。取值:

4:钉钉、邮箱

FailedMnsParameters Array of MnsParameter

如果规则发送目标中包含创建错误的消息服务,则返回此参数。

MnsParameter
Queue String testQueue

队列的名称。

Id Integer 2

规则发送目标的ID。

Region String cn-hangzhou

地域ID。

FailedFcParameters Array of FcParameter

如果规则发送目标中包含创建错误的函数服务,则返回此参数。

FcParameter
ServiceName String serviceTest1

函数服务的名称。

FunctionName String functionTest1

函数名称。

Id Integer 1

规则发送目标的ID。

Region String cn-hangzhou

地域ID。

示例

请求示例

http(s)://[Endpoint]/?Action=PutEventRuleTargets
&RuleName=testEventRule
&<公共请求参数>

正常返回示例

XML格式

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格式

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

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

错误码

访问错误中心查看更多错误码。