This topic describes the parameters in the metadata of an event target.

Fields

The following table describes the required fields in the metadata of an event target.

Field Type Description
resourceKey String The resource key of the transformed event.
resourceName String The resource name of the transformed event.
forms String The transformation method. The following transformation methods are supported:
  • ORIGINAL: complete event. You do not need to specify the value and template fields. EventBridge routes the complete data structure of an event in the CloudEvents format to an event target without transformation. For more information, see the "Complete event" section of the Event transformation topic.
  • JSONPATH: partial event. You need to specify only the value field and do not need to specify the template field. EventBridge extracts fields from an event in the CloudEvents format by using JSONPath and routes the specified part of the event to an event target. For more information, see the "Partial event" section of the Event transformation topic.
    Sample value of the value field:
    $.data.name
  • CONSTANT: constant. You need to specify only the value field and do not need to specify the template field. EventBridge routes only constants specified by the value field to an event target regardless of event context. For more information, see the "Constant" section of the Event transformation topic.
    Sample value of the value field:
    "test1"
  • TEMPLATE: template. You must specify the value and template fields. EventBridge extracts fields from an event in the CloudEvents format by using JSONPath, stores the field values in the value field, and then routes the event in the format that is specified by the template field to an event target. For more information, see the "Template" section of the Event transformation topic.
    Sample value of the value field:
    {
        "name":"$.data.name",
        "constant":"Please deal with it timely."
    }
    Sample value of the template field:
    The instance is broken, which name is ${name}, ${constant}

DingTalk

The following table describes the parameters that you can set if you select DingTalk as the event target.

resourceKey resourceName forms
URL Address CONSTANT
SecretKey Secret Key CONSTANT
Body Pushed Content TEMPLATE

The following code shows an example of JSONPath:

{
    "id":"KD20k9rpqDRXPq0SXXlqeTn6kZ",
    "type":"acs.dingtalk",
    "endpoint":"https://oapi.dingtalk.com/robot/send?access_token=1560abe367f48877c69bb6a9916244979927abbbbf82f4fe8801692cd6ea****",
    "pushSelector":"PARAM_TRANSFORMER",
    "paramList":[
        {
            "value":"https://oapi.dingtalk.com/robot/send?access_token=1560abe367f48877c69bb6a9916244979927abbbbf82f4fe8801692cd6ea****",
            "resourceKey":"URL",
            "form":"CONSTANT"
        },
        {
            "value":"SEC1eca5209e0c6c23165b9504967522d47b0d0004e1caf3a75f6ddfda7359d****",
            "resourceKey":"SecretKey",
            "form":"CONSTANT"
        },
        {
            "value":{
                "content":"$.data.content"
            },
            "resourceKey":"Body",
            "form":"TEMPLATE",
            "template":{
                "msgtype":"text",
                "text":{
                    "content":"@1851111***** ${content}"
                },
                "at":{

                }
            }
        }
    ]
}

Direct Mail

The following table describes the parameters that you can set if you select Direct Mail as the event target.

resourceKey resourceName forms
Subject Subject CONSTANT
AccountName Sender Address CONSTANT
AddressType Address Type CONSTANT
ReplyToAddress Return Address CONSTANT
ToAddress Recipient
  • CONSTANT
  • JSONPATH
IsHtmlBody HTML Body CONSTANT
Body Body TEMPLATE

The following code shows an example of JSONPath:

{
    "id":"KD20k9rpqDRXPq0SXXlqeTn6kZ",
    "type":"acs.mail",
    "endpoint":"acs:mail:cn-hangzhou:164901546557****",
    "pushSelector":"PARAM_TRANSFORMER",
    "paramList":[
        {
            "value":"test",
            "resourceKey":"Subject",
            "form":"CONSTANT"
        },
        {
            "value":"example.com",
            "resourceKey":"AccountName",
            "form":"CONSTANT"
        },
        {
            "value":"1",
            "resourceKey":"AddressType",
            "form":"CONSTANT"
        },
        {
            "value":"true",
            "resourceKey":"ReplyToAddress",
            "form":"CONSTANT"
        },
        {
            "value":"$.data.name",
            "resourceKey":"ToAddress",
            "form":"JSONPATH"
        },
        {
            "value":"true",
            "resourceKey":"IsHtmlBody",
            "form":"CONSTANT"
        },
        {
            "value":{
                "mobile":"$.data.mobile",
                "subject":"$.subject"
            },
            "resourceKey":"Body",
            "form":"TEMPLATE",
            "template":{
                "code":"${subject}"
            }
        }
    ]
}

SMS

The following table describes the parameters that you can set if you select Short Message Service (SMS) as the event target.

resourceKey resourceName forms
PhoneNumbers Phone Number
  • CONSTANT
  • JSONPATH
SignName Signature CONSTANT
TemplateCode Template Code CONSTANT
TemplateParam Template Parameters TEMPLATE

The following code shows an example of JSONPath:

{
    "id":"KD20k9rpqDRXPq0SXXlqeTn6kZ",
    "type":"acs.sms",
    "endpoint":"acs:sms:cn-hangzhou:164901546557****",
    "pushSelector":"PARAM_TRANSFORMER",
    "paramList":[
        {
            "value":"$.data",
            "resourceKey":"PhoneNumbers",
            "form":"JSONPATH"
        },
        {
            "value":"[Test] Alibaba Cloud Communication",
            "resourceKey":"SignName",
            "form":"CONSTANT"
        },
        {
            "value":" [Test] Alibaba Cloud Communication Test Template",
            "resourceKey":"TemplateCode",
            "form":"CONSTANT"
        },
        {
            "value":{
                "mobile":"$.data.mobile",
                "subject":"$.subject"
            },
            "resourceKey":"TemplateParam",
            "form":"TEMPLATE",
            "template":{
                "code":"${subject}"
            }
        }
    ]
}

Function Compute

The following table describes the parameters that you can set if you select Function Compute as the event target.

resourceKey resourceName forms
serviceName Service CONSTANT
functionName Function CONSTANT
Body Event
  • ORIGINAL
  • CONSTANT
  • JSONPATH
  • TEMPLATE

The following code shows an example of JSONPath:

{
    "id":"KD20k9rpqDRXPq0SXXlqeTn6kZ",
    "type":"acs.fc.function",
    "endpoint":"acs:fc:cn-hangzhou:164901546557****:services/guide-hello_world.LATEST/functions/hello_world",
    "pushSelector":"PARAM_TRANSFORMER",
    "paramList":[
        {
            "value":"guide-hello_world",
            "resourceKey":"serviceName",
            "form":"CONSTANT"
        },
        {
            "value":"hello_world",
            "resourceKey":"functionName",
            "form":"CONSTANT"
        },
        {
            "value":"$.data.name",
            "resourceKey":"Body",
            "form":"JSONPATH"
        },
        {
            "value":"LATEST",
            "resourceKey":"Qualifier",
            "form":"CONSTANT"
        }
    ]
}

MNS

The following table describes the parameters that you can set if you select Message Service (MNS) as the event target.

resourceKey resourceName forms
queue Queue CONSTANT
Body Message Content
  • ORIGINAL
  • CONSTANT
  • JSONPATH
  • TEMPLATE

The following code shows an example of JSONPath:

{
    "id":"KD20k9rpqDRXPq0SXXlqeTn6kZ",
    "type":"acs.mns.queue",
    "endpoint":"acs:mns:cn-hangzhou:164901546557****:queues/MyQueue",
    "pushSelector":"PARAM_TRANSFORMER",
    "paramList":[
        {
            "value":"MyQueue",
            "resourceKey":"queue",
            "form":"CONSTANT"
        },
        {
            "value":{
                "source":"$.source"
            },
            "resourceKey":"Body",
            "form":"TEMPLATE",
            "template":"The event comes from ${source} is abnormal."
        }
    ]
}

Message Queue for Apache RocketMQ

The following table describes the parameters that you can set if you select Message Queue for Apache RocketMQ as the event target.

resourceKey resourceName forms
InstanceId Instance ID CONSTANT
Topic Topic CONSTANT
Body Body
  • ORIGINAL
  • JSONPATH
  • CONSTANT
  • TEMPLATE
Properties Properties
  • JSONPATH
  • TEMPLATE
Keys Keys
  • JSONPATH
  • CONSTANT
  • TEMPLATE
Tags Tags
  • JSONPATH
  • CONSTANT
  • TEMPLATE

The following code shows an example of JSONPath:

{
    "id":"KD20k9rpqDRXPq0SXXlqeTn6kZ",
    "type":"acs.rocketmq",
    "endpoint":"acs:mq:cn-hangzhou:164901546557****:/instances/${instanceId}/topic/${topic}",
    "pushSelector":"PARAM_TRANSFORMER",
    "paramList":[
        {
            "value":"MQ_INST_164901546557****_BAAQ4gWo",
            "resourceKey":"InstanceId",
            "form":"CONSTANT"
        },
        {
            "value":"test-topic1",
            "resourceKey":"Topic",
            "form":"CONSTANT"
        },
        {
            "value":"$.data.name",
            "resourceKey":"Body",
            "form":"JSONPATH"
        },
        {
            "value":"$.data.userProperties",
            "resourceKey":"Properties",
            "form":"JSONPATH"
        },
        {
            "value":"$.data.systemProperties.KEYS",
            "resourceKey":"Keys",
            "form":"JSONPATH"
        },
        {
            "value":"$.data.systemProperties.TAGS",
            "resourceKey":"Tags",
            "form":"JSONPATH"
        }
    ]
}

Message Queue for RabbitMQ

The following table describes the parameters that you can set if you select Message Queue for RabbitMQ as the event target.

resourceKey resourceName forms
InstanceId Instance ID CONSTANT
Vhost vhost CONSTANT
TargetType Destination Type CONSTANT
Exchange Exchange CONSTANT
Note You can set only one of the Exchange and Queue parameters.
Routing Key Routing Key
  • JSONPATH
  • CONSTANT
Queue Queue CONSTANT
Note You can set only one of the Exchange and Queue parameters.
Body Body
  • ORIGINAL
  • JSONPATH
  • CONSTANT
  • TEMPLATE
MessageId MessageId
  • JSONPATH
  • CONSTANT
  • TEMPLATE
Properties Properties
  • JSONPATH
  • TEMPLATE

The following code shows an example of JSONPath:

Example 1: The Destination Type parameter is set to Exchange Mode.

{
    "id":"KD20k9rpqDRXPq0SXXlqeTn6kZ",
    "type":"acs.rabbitmq",
    "endpoint":"acs:amqp:cn-hangzhou:164901546557****:/instances/${instanceId}/vhosts/${vhostName}/exchanges/${exchangeName}",
    "pushSelector":"PARAM_TRANSFORMER",
    "paramList":[
        {
            "value":"amqp-cn-i7m29o3s****",
            "resourceKey":"InstanceId",
            "form":"CONSTANT"
        },
        {
            "value":"test.host",
            "resourceKey":"Vhost",
            "form":"CONSTANT"
        },
        {
            "value":"Exchange",
            "resourceKey":"TargetType",
            "form":"CONSTANT"
        },
        {
            "value":"amq.direct",
            "resourceKey":"Exchange",
            "form":"CONSTANT"
        },
        {
            "value":"$.data.name",
            "resourceKey":"RoutingKey",
            "form":"JSONPATH"
        },
        {
            "value":"$.data.name",
            "resourceKey":"Body",
            "form":"JSONPATH"
        },
        {
            "value":"$.data.message",
            "resourceKey":"MessageId",
            "form":"JSONPATH"
        },
        {
            "value":"$.data.userProperties",
            "resourceKey":"Properties",
            "form":"JSONPATH"
        }
    ]
}

Example 2: The Destination Type parameter is set to Queue Mode.

{
    "id":"EldwXoVAws5Ix8VpVmrDmrxQTR",
    "type":"acs.rabbitmq",
    "endpoint":"acs:amqp:cn-hangzhou:164901546557****:/instances/${instanceId}/vhosts/${vhostName}/exchanges/${exchangeName}",
    "pushSelector":"PARAM_TRANSFORMER",
    "paramList":[
        {
            "value":"amqp-cn-i7m29o3s****",
            "resourceKey":"InstanceId",
            "form":"CONSTANT"
        },
        {
            "value":"test.host",
            "resourceKey":"Vhost",
            "form":"CONSTANT"
        },
        {
            "value":"Queue",
            "resourceKey":"TargetType",
            "form":"CONSTANT"
        },
        {
            "value":"test.event",
            "resourceKey":"Queue",
            "form":"CONSTANT"
        },
        {
            "value":"$.data.body",
            "resourceKey":"Body",
            "form":"JSONPATH"
        },
        {
            "value":"$.data.message",
            "resourceKey":"MessageId",
            "form":"JSONPATH"
        },
        {
            "value":"$.data.userproperties",
            "resourceKey":"Properties",
            "form":"JSONPATH"
        }
    ]
}

HTTP

The following table describes the parameters that you can set if you select HTTP as the event target.

resourceKey resourceName forms
url URL CONSTANT
Body Body
  • ORIGINAL
  • CONSTANT
  • JSONPATH
  • TEMPLATE
Network Network Type CONSTANT
VPCNameAndId VPC CONSTANT
VSwitchesNameAndId vSwitch CONSTANT
SecurityGroupNameAndId Security Group CONSTANT
Token Token CONSTANT

The following code shows an example of JSONPath:

Example 1: The Network Type parameter is set to Internet.

{
    "id":"KD20k9rpqDRXPq0SXXlqeTn6kZ",
    "type":"http",
    "endpoint":"http://www.****.com/product/aliware/eventbridge",
    "pushSelector":"PARAM_TRANSFORMER",
    "paramList":[
        {
            "value":"http://www.****.com/product/aliware/eventbridge",
            "resourceKey":"url",
            "form":"CONSTANT"
        },
        {
            "value":"",
            "resourceKey":"Body",
            "form":"ORIGINAL"
        },
        {
            "value":"PublicNetwork",
            "resourceKey":"Network",
            "form":"CONSTANT"
        }
    ]
}

Example 2: The Network Type parameter is set to VPC.

{
    "id":"ZOiNcqqzTGSrDJanZQ72vjL9Se",
    "type":"http",
    "endpoint":"http://192.168.XX.XX:8080",
    "pushSelector":"PARAM_TRANSFORMER",
    "paramList":[
        {
            "value":"http://192.168.XX.XX:8080",
            "resourceKey":"url",
            "form":"CONSTANT"
        },
        {
            "value":"",
            "resourceKey":"Body",
            "form":"ORIGINAL"
        },
        {
            "value":"PrivateNetwork",
            "resourceKey":"Network",
            "form":"CONSTANT"
        },
        {
            "value":"catalog-system/vpc-bp1ohdo84u2lt9wzq****",
            "resourceKey":"VPCNameAndId",
            "form":"CONSTANT"
        },
        {
            "value":"[\"eb/vsw-bp10rbrt6rb6vrd89****\"]",
            "resourceKey":"VSwitchesNameAndId",
            "form":"CONSTANT"
        },
        {
            "value":"sg-catalog-eventlistener/sg-bp14zrnfyik5av27****",
            "resourceKey":"SecurityGroupNameAndId",
            "form":"CONSTANT"
        },
        {
            "value":"",
            "resourceKey":"Token",
            "form":"CONSTANT"
        }
    ]
}

HTTPS

The following table describes the parameters that you can set if you select HTTPS as the event target.

resourceKey resourceName forms
url URL CONSTANT
Body Body
  • ORIGINAL
  • CONSTANT
  • JSONPATH
  • TEMPLATE

The following code shows an example of JSONPath:

{
    "id":"KD20k9rpqDRXPq0SXXlqeTn6kZ",
    "type":"https",
    "endpoint":"https://www.****.com/product/aliware/eventbridge",
    "pushSelector":"PARAM_TRANSFORMER",
    "paramList":[
        {
            "value":"https://www.****.com/product/aliware/eventbridge",
            "resourceKey":"url",
            "form":"CONSTANT"
        },
        {
            "value":"",
            "resourceKey":"Body",
            "form":"ORIGINAL"
        }
    ]
}