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 external data source configuration. |
{\"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 |
The parameters for a Simple Message Queue (formerly MNS) event source. If you select Simple Message Queue (formerly MNS) as the event source, the RegionId, IsBase64Decode, and QueueName parameters are required. |
|
| RegionId |
string |
No |
The region where the Simple Message Queue (formerly MNS) queue resides. Valid values: cn-qingdao, cn-beijing, cn-zhangjiakou, cn-huhehaote, cn-wulanchabu, cn-hangzhou, cn-shanghai, cn-shenzhen, cn-guangzhou, cn-chengdu, cn-hongkong, ap-southeast-1, ap-southeast-2, ap-southeast-3, ap-southeast-5, ap-northeast-1, eu-central-1, us-west-1, us-east-1, ap-south-1, me-east-1, and cn-north-2-gov-1. |
cn-hangzhou |
| QueueName |
string |
No |
The name of the Simple Message Queue (formerly MNS) queue. |
MyQueue |
| IsBase64Decode |
boolean |
No |
Specifies whether to enable Base64 decoding. A value of true indicates that Base64 decoding is enabled. Valid values: true and false. |
true |
| SourceRocketMQParameters |
object |
No |
The request parameter SourceRocketMQParameters. |
|
| RegionId |
string |
No |
The region where the ApsaraMQ for RocketMQ instance resides. |
cn-hangzhou |
| InstanceId |
string |
No |
The instance ID of the ApsaraMQ for RocketMQ instance. For more information, see Limits. |
MQ_INST_164901546557****_BAAN**** |
| Topic |
string |
No |
The topic name of the ApsaraMQ for RocketMQ instance. For more information, see Limits. |
mytopic |
| Tag |
string |
No |
The filter tag of the message. |
test |
| Offset |
string |
No |
The consumption offset of the message. Valid values:
|
CONSUME_FROM_LAST_OFFSET |
| Timestamp |
integer |
No |
The timestamp. This parameter takes effect only when the Offset parameter is set to CONSUME_FROM_TIMESTAMP. |
1636597951964 |
| GroupID |
string |
No |
The group ID of the ApsaraMQ for RocketMQ instance. |
GID-test |
| InstanceType |
string |
No |
The instance type. Valid values:
|
Cloud_4 |
| InstanceNetwork |
string |
No |
The network type. |
PublicNetwork |
| InstanceVpcId |
string |
No |
The ID of the virtual private cloud (VPC). Required for VPCs. |
vpc-bp1a4gmlk31hyg6pt**** |
| InstanceVSwitchIds |
string |
No |
The vSwitch ID. Required for VPCs. |
vsw-bp10rbrt6rb6vrd89**** |
| InstanceSecurityGroupId |
string |
No |
The security group ID. Required for VPCs. |
sg-catalog-eventlist**** |
| AuthType |
string |
No |
The authentication type. Valid values: ACL. You can also leave this parameter empty. |
ACL |
| InstanceEndpoint |
string |
No |
The endpoint of the instance. |
registry-vpc****.aliyuncs.com |
| InstanceUsername |
string |
No |
The username of the instance. |
root |
| InstancePassword |
string |
No |
The password of the instance. |
yourPassword |
| SourceRabbitMQParameters |
object |
No |
The request parameter SourceRabbitMQParameters. |
|
| RegionId |
string |
No |
The region where the ApsaraMQ for RabbitMQ instance resides. |
cn-hangzhou |
| InstanceId |
string |
No |
The instance ID of the ApsaraMQ for RabbitMQ instance. For more information, see Limits. |
amqp-cn-nif22u74**** |
| VirtualHostName |
string |
No |
The vhost name of the ApsaraMQ for RabbitMQ instance. For more information, see Limits. |
eb-connect |
| QueueName |
string |
No |
The queue name of the ApsaraMQ for RabbitMQ instance, such as eb-connect. For more information, see Limits. |
demo |
| SourceSLSParameters |
object |
No |
The parameters for a Simple Log Service event source. |
|
| Project |
string |
No |
The Simple Log Service project. |
test-project |
| LogStore |
string |
No |
The Simple Log Service Logstore. |
test-logstore |
| ConsumePosition |
string |
No |
The start consumption offset. You can set this parameter to begin to consume from the earliest offset, end to consume from the latest offset, or a specific timestamp in seconds. |
end |
| RoleName |
string |
No |
When granting authorization to EventBridge to read Simple Log Service logs by using this role, the following conditions must be met: When you create the role in the Resource Access Management (RAM) console, you must select Alibaba Cloud Service as the trusted entity and EventBridge as the trusted service. For more information about the access policy for this role, see Custom event source: Simple Log Service. |
testRole |
| SourceHttpEventParameters |
object |
No |
The request parameter SourceHttpEventParameters. |
|
| Type |
string |
No |
The protocol type supported by the generated webhook. Valid values:
|
HTTPS |
| Method |
array |
No |
The HTTP request methods supported by the generated webhook. You can select multiple values. Valid values:
|
|
|
string |
No |
The HTTP request methods supported by the generated webhook. You can select multiple values. Valid values:
|
GET |
|
| SecurityConfig |
string |
No |
The type of the security configuration. Valid values:
|
none |
| Ip |
array |
No |
The CIDR block for security configuration. This parameter is required only when the SecurityConfig parameter is set to ip. You can enter a CIDR block or an IP address. |
|
|
string |
No |
The CIDR block for security configuration. This parameter is required only when the SecurityConfig parameter is set to ip. You can enter a CIDR block or an IP address. |
10.0.0.0/8 |
|
| Referer |
array |
No |
The secure domain name for security configuration. This parameter is required only when the SecurityConfig parameter is set to referer. You can enter a domain name. |
|
|
string |
No |
The secure domain name for security configuration. This parameter is required only when the SecurityConfig parameter is set to referer. You can enter a domain name. |
aliyundoc.com |
|
| SourceScheduledEventParameters |
object |
No |
The request parameter SourceScheduledEventParameters. |
|
| Schedule |
string |
No |
The cron expression. |
10 * * * * * |
| TimeZone |
string |
No |
The time zone for cron execution. |
GMT+0:00 |
| UserData |
string |
No |
The JSON string. |
{"a": "b"} |
| SourceKafkaParameters |
object |
No |
The request parameter SourceKafkaParameters. |
|
| InstanceId |
string |
No |
The instance ID. |
pc-2zehmg67txzuyuuwl**** |
| ConsumerGroup |
string |
No |
The group ID of the consumer that subscribes to the topic. |
wechat_peer_**** |
| Topic |
string |
No |
The name of the topic. |
prod_ma_dispatch_center_call_re**** |
| OffsetReset |
string |
No |
The consumption offset. |
latest |
| RegionId |
string |
No |
The region ID. |
cn-hangzhou |
| MaximumTasks |
integer |
No |
The concurrency quota, which is the number of consumers. |
1 |
| Network |
string |
No |
The network configuration. Valid values: Default and PublicNetwork. |
Default |
| SecurityGroupId |
string |
No |
The security group ID. Required for self-managed networks. |
sg-8vbf66aoyp0wfzrz**** |
| VSwitchIds |
string |
No |
The vSwitch ID. Required for self-managed networks. |
vsw-bp127azpeirmwu4q9**** |
| VpcId |
string |
No |
The VPC ID. Required for self-managed networks. |
vpc-2ze5ejm986a73qq3v**** |
| SourceOSSEventParameters |
object |
No |
The parameters for an OSS event source. |
|
| EventTypes |
array |
No |
The list of event types. |
|
|
string |
No |
The event type. |
ObjectCreated:PutObject |
|
| StsRoleArn |
string |
No |
The ARN of the STS role. |
acs:eventbridge:cn-hangzhou:** |
| MatchRules |
array<object> |
No |
The matching rules. |
|
|
array<object> |
No |
The event matching rule. |
||
|
object |
No |
|||
| Prefix |
string |
No |
The prefix. |
fun/document/ |
| Suffix |
string |
No |
The suffix. |
document |
| Name |
string |
No |
The name. |
bucketName |
| 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 request parameters. |
||
| Message |
string |
The error 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 |
string |
The request ID. |
2922208e-e1c6-43ee-bfd1-aca50263bc8a |
| Data |
object |
The returned data. |
|
| EventSourceARN |
string |
The resource ARN. |
acs:eventbridge:cn-hangzhou:164901546557****:eventbus/my-event-bus/eventsource/mymns.source |
| Code |
string |
The API response code. Valid values:
|
Success |
| Success |
boolean |
Indicates whether the operation is successful. |
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.