Creates an external event source.
Operation description
Creates an external event source.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
eventbridge:CreateEventSource |
create |
*EventSource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| EventSourceName |
string |
Yes |
The name of the event source. |
myrabbitmq.sourc |
| Description |
string |
No |
The description of the event source. |
Event source of the RabbitMQ type |
| LinkedExternalSource |
boolean |
No |
Specifies whether to connect to an external data source. |
true |
| ExternalSourceType |
string |
No |
The type of the external data source. |
RabbitMQ |
| ExternalSourceConfig |
object |
No |
The configuration of the external data source. |
{\"Schedule\":\"0 */10 * * * *\",\"TimeZone\":\"GMT+0:00\"} |
| EventBusName |
string |
Yes |
The name of the event bus associated with the event source. |
my-event-bus |
| SourceMNSParameters |
object |
No |
Parameters for the Message Service (MNS) event source. The |
|
| RegionId |
string |
No |
The region where the Message Service (MNS) queue is located.
You can specify the following regions: |
cn-hangzhou |
| QueueName |
string |
No |
The name of the queue in Message Service (MNS). |
MyQueue |
| IsBase64Decode |
boolean |
No |
Specifies whether to enable Base64 decoding. Valid values: |
true |
| SourceRocketMQParameters |
object |
No |
Parameters for the Message Queue for Apache RocketMQ event source. |
|
| RegionId |
string |
No |
The region where the Message Queue for Apache RocketMQ instance resides. |
cn-hangzhou |
| InstanceId |
string |
No |
The ID of the Message Queue for Apache RocketMQ instance. For more information, see Limits. |
MQ_INST_164901546557****_BAAN**** |
| Topic |
string |
No |
The name of the topic on the Message Queue for Apache RocketMQ instance. For more information, see Limits. |
mytopic |
| Tag |
string |
No |
The tag used to filter messages. |
test |
| Offset |
string |
No |
The consumer offset from which message consumption starts. Valid values: |
CONSUME_FROM_LAST_OFFSET |
| Timestamp |
integer |
No |
The point in time to start consumption, specified as a timestamp. This parameter is valid only if you set the |
1636597951964 |
| GroupID |
string |
No |
The consumer group ID on the Message Queue for Apache RocketMQ instance. |
GID-test |
| InstanceType |
string |
No |
The instance type. Valid values:
|
Cloud_4 |
| InstanceNetwork |
string |
No |
This parameter is not in use. |
|
| InstanceVpcId |
string |
No |
The ID of the virtual private cloud (VPC). This parameter is required if the instance is deployed in a VPC. |
vpc-bp1a4gmlk31hyg6pt**** |
| InstanceVSwitchIds |
string |
No |
The vSwitch ID. This parameter is required if the instance is deployed in a VPC. |
vsw-bp10rbrt6rb6vrd89**** |
| InstanceSecurityGroupId |
string |
No |
The security group ID. This parameter is required if the instance is deployed in a VPC. |
sg-catalog-eventlist**** |
| AuthType |
string |
No |
The authentication type. You can set this parameter to |
ACL |
| InstanceEndpoint |
string |
No |
The instance endpoint. |
registry-vpc****.aliyuncs.com |
| InstanceUsername |
string |
No |
The username for the instance. |
root |
| InstancePassword |
string |
No |
The password for the instance. |
****** |
| SourceRabbitMQParameters |
object |
No |
Parameters for the Message Queue for RabbitMQ event source. |
|
| RegionId |
string |
No |
The region where the Message Queue for RabbitMQ instance resides. |
cn-hangzhou |
| InstanceId |
string |
No |
The ID of the Message Queue for RabbitMQ instance. For more information, see Limits. |
amqp-cn-nif22u74**** |
| VirtualHostName |
string |
No |
The name of the virtual host (vhost) of the Message Queue for RabbitMQ instance. For more information, see Limits. |
eb-connect |
| QueueName |
string |
No |
The name of the queue on the Message Queue for RabbitMQ instance. For more information, see Limits. |
demo |
| SourceSLSParameters |
object |
No |
Parameters for the Simple Log Service (SLS) event source. |
|
| Project |
string |
No |
The Log Project in Simple Log Service. |
test-project |
| LogStore |
string |
No |
The Logstore in Simple Log Service. |
test-logstore |
| ConsumePosition |
string |
No |
The consumer offset. Specifies where to start consumption. Valid values are |
end |
| RoleName |
string |
No |
The RAM role that EventBridge assumes to read logs from Simple Log Service. When you create this role in the RAM console, select Alibaba Cloud Service as the trusted entity and EventBridge as the trusted service. For more information about the permissions for this role, see Custom event sources for Simple Log Service (SLS). |
testRole |
| SourceHttpEventParameters |
object |
No |
Parameters for an HTTP endpoint event source. |
|
| Type |
string |
No |
The supported protocol for the webhook. Valid values:
|
HTTPS |
| Method |
array |
No |
The HTTP request methods supported by the webhook. You can specify more than one method. Valid values:
|
|
|
string |
No |
An HTTP request method.
|
GET |
|
| SecurityConfig |
string |
No |
The type of security configuration. Valid values:
|
none |
| Ip |
array |
No |
The IP address range for security settings. This parameter is required only if you set |
|
|
string |
No |
An IP address or a CIDR block. |
10.0.0.0/8 |
|
| Referer |
array |
No |
The security domain names. This parameter is required only if you set |
|
|
string |
No |
A security domain name. |
aliyundoc.com |
|
| SourceScheduledEventParameters |
object |
No |
Parameters for a scheduled event source. |
|
| Schedule |
string |
No |
The cron expression. |
10 * * * * * |
| TimeZone |
string |
No |
The time zone in which the cron expression is executed. |
GMT+0:00 |
| UserData |
string |
No |
A user-defined JSON string. |
{"a": "b"} |
| SourceKafkaParameters |
object |
No |
Parameters for the Message Queue for Apache Kafka event source. |
|
| InstanceId |
string |
No |
The instance ID. |
pc-2zehmg67txzuyuuwl**** |
| ConsumerGroup |
string |
No |
The consumer group ID. |
wechat_peer_**** |
| Topic |
string |
No |
The topic name. |
prod_ma_dispatch_center_call_re**** |
| OffsetReset |
string |
No |
The consumer offset reset policy. |
latest |
| RegionId |
string |
No |
The region ID. |
cn-hangzhou |
| MaximumTasks |
integer |
No |
The concurrent consumption quota (number of consumers). |
1 |
| Network |
string |
No |
The network type. Valid values are |
Default |
| SecurityGroupId |
string |
No |
The security group ID. This parameter is required if |
sg-8vbf66aoyp0wfzrz**** |
| VSwitchIds |
string |
No |
The vSwitch ID. This parameter is required if |
vsw-bp127azpeirmwu4q9**** |
| VpcId |
string |
No |
The VPC ID. This parameter is required if |
vpc-2ze5ejm986a73qq3v**** |
| SourceOSSEventParameters |
object |
No |
Parameters for the Object Storage Service (OSS) event source. |
|
| EventTypes |
array |
No |
The list of event types. |
|
|
string |
No |
The event type. |
||
| StsRoleArn |
string |
No |
The Alibaba Cloud Resource Name (ARN) of the Security Token Service (STS) role. |
|
| MatchRules |
array<object> |
No |
The match rules. |
|
|
array<object> |
No |
The event match rules. |
||
|
object |
No |
|||
| Prefix |
string |
No |
The prefix. |
|
| Suffix |
string |
No |
The suffix. |
|
| Name |
string |
No |
The name. |
|
| MatchState |
boolean |
No |
The match state. |
Request Example
POST /openapi/createEventSource HTTP/1.1
Host: 164901546557****.eventbridge.cn-hangzhou.aliyuncs.com
Date: Sat, 18 Apr 2020 05:30:41 GMT
x-eventbridge-version: 2020-04-01
Authorization: acs vZ3VL0SuJdHi****:Jo2PbT******azYAYoYslKLvWzg=
Content-Type: application/json;charset=UTF-8
Content-Length: 26
{
"EventSourceName":"myRabbitMQ.source",
"Description":"RabbitMQ event source",
"SourceRabbitMQParameters":{
"RegionId":"cn-hangzhou",
"InstanceId":"amqp-cn-nif22u74****",
"VirtualHostName":"eb-connect",
"QueueName":"demo"
},
"EventBusName":"my-event-bus"
}
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body. |
||
| Message |
string |
The error message returned if the request is unsuccessful. |
Remote error. requestId: [A8EFABD2-95B9-1C46-9E01-xxxx], error code: [CreateRelatedResourceFailed], message: [Create related resource failed, EntityNotExist.Role : The role not exists: xxxx. \r\nRequestId : xxxx-168C-54ED-8FEB-BF11CB70AEB7] |
| RequestId |
string |
The request ID. |
2922208e-e1c6-43ee-bfd1-aca50263bc8a |
| Data |
object |
The data returned by the request. |
|
| EventSourceARN |
string |
The Alibaba Cloud Resource Name (ARN) of the event source. |
acs:eventbridge:cn-hangzhou:164901546557****:eventbus/my-event-bus/eventsource/mymns.source |
| Code |
string |
The response code.
|
Success |
| Success |
boolean |
Indicates whether the request was successful. A value of |
true |
Examples
Success response
JSON format
{
"Message": " Remote error. requestId: [A8EFABD2-95B9-1C46-9E01-xxxx], error code: [CreateRelatedResourceFailed], message: [Create related resource failed, EntityNotExist.Role : The role not exists: xxxx. \\r\\nRequestId : xxxx-168C-54ED-8FEB-BF11CB70AEB7] ",
"RequestId": "2922208e-e1c6-43ee-bfd1-aca50263bc8a",
"Data": {
"EventSourceARN": "acs:eventbridge:cn-hangzhou:164901546557****:eventbus/my-event-bus/eventsource/mymns.source"
},
"Code": "Success",
"Success": true
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 403 | ServiceNotEnable | Service not enable |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.