This operation lists all user-defined event sources.
URI
/openapi/listUserDefinedEventSources
Notes
Only one of the following parameters is returned at a time: SourceMNSParameters, SourceRocketMQParameters, SourceRabbitMQParameters, SourceHttpEventParameters, and SourceSLSParameters.
Request parameters
None.
Response parameters
| Name | Type | Example | Description |
| Status | String | Activated | The status of the event source. Valid value:
|
| Type | String | UserDefined | The type of the event source. Valid value:
|
| SourceMNSParameters | Object | The event provider is Simple Message Queue (formerly MNS). | |
| SourceRocketMQParameters | Object | The event provider is ApsaraMQ for RocketMQ. | |
| SourceRabbitMQParameters | Object | The event provider is ApsaraMQ for RabbitMQ. | |
| SourceHttpEventParameters | Object | The event provider is HTTP or HTTPS. | |
| SourceSLSParameters | Object | The event provider is Simple Log Service (SLS). | |
| Ctime | String | 1626360902642 | The time when the event source was created. This value is a UNIX timestamp in milliseconds. |
| EventBusName | String | demo-bus | The event bus that is associated with the event source. |
| ARN | String | acs:eventbridge:cn-hangzhou:164901546557****:eventbus/my-event-bus/eventsource/myRocketMQ.source | The Alibaba Cloud Resource Name (ARN) of the event source. |
| Name | String | rocketmq.source | The name of the event source. |
Response parameters for SourceMNSParameters
| Name | Type | Example | Description |
| RegionId | String | cn-zhangjiakou | Simple Message Queue (formerly MNS): The region that hosts the queue. |
| QueueName | String | MyQueue | Simple Message Queue (formerly MNS) queue. |
| IsBase64Decode | String | true | Indicates whether Base64 encoding is enabled. |
Response parameters for SourceRocketMQParameters
| Name | Type | Example | Description |
| RegionId | String | cn-zhangjiakou | ApsaraMQ for RocketMQ instance resides. |
| InstanceId | String | MQ_INST_164901546557****_BAAN**** | ApsaraMQ for RocketMQ instance. For more information, see Limits. |
| Topic | String | mytopic | ApsaraMQ for RocketMQ instance. For more information, see Limits. |
| Tag | String | test | The tag that is used to filter messages. |
| Offset | String | CONSUME_FROM_TIMESTAMP | The consumer offset of messages. Valid values:
|
| Timestamp | Long | 1636597951964 | The timestamp. This parameter is valid only when the Offset parameter is set to CONSUME_FROM_TIMESTAMP. |
| GroupID | String | GID_group1 | ApsaraMQ for RocketMQ Group. |
Response parameters for SourceRabbitMQParameters
| Name | Type | Example | Description |
| RegionId | String | cn-zhangjiakou | ApsaraMQ for RabbitMQ instance is located. |
| InstanceId | String | amqp-cn-nif22u74**** | ApsaraMQ for RabbitMQ instance. For more information, see Limits. |
| VirtualHostName | String | eb-connect | ApsaraMQ for RabbitMQ instance. For more information, see Limits. |
| QueueName | String | demo | ApsaraMQ for RabbitMQ instance. For more information, see Limits. |
Response parameters for SourceHttpEventParameters
| Name | Type | Required | Example | Description |
| Type | String | Yes | HTTPS | The protocol type supported by the generated webhook. Valid values:
|
| Method | List | Yes | GET | The HTTP request methods supported by the generated webhook. You can select multiple values. Valid values:
|
| SecurityConfig | String | Yes | ip | The type of security configuration. Valid values:
|
| Ip | List | No | 10.0.0.0/8 | The secure CIDR block configuration. This parameter is required only when SecurityConfig is set to ip. You can enter a CIDR block or an IP address. |
| Referer | List | No | aliyundoc.com | The secure domain name configuration. This parameter is required only when SecurityConfig is set to referer. You can enter a domain name. |
Response parameters for SourceSLSParameters
| Name | Type | Required | Example | Description |
| Project | String | Yes | test-project | The Simple Log Service (SLS) log project. |
| LogStore | String | Yes | test-logstore | The SLS Logstore. |
| ConsumePosition | String | No | end | The starting consumer offset. Valid values are `begin` for the earliest offset, `end` for the latest offset, or a UNIX timestamp in seconds to start consumption from a specific time. |
| RoleName | String | Yes | testRole | The role that grants EventBridge permissions to read logs from SLS. When you create this role in the RAM console, select Alibaba Cloud Service as the trusted entity and EventBridge as the trusted service. |
Examples
Sample request
POST /openapi/listUserDefinedEventSources HTTP/1.1
Host: 123456789098****.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: 26Sample response
HTTP/1.1 200 OK
Server: AliyunEventBridge
Connection: keep-alive
Content-Type: application/json;charset=utf-8
Content-Length: 79
x-eventbridge-request-id: 608C6467-3195-42A3-97B5-C51FB976****
Date: Sat, 18 Apr 2020 05:30:41 GMT
{
"code":"200",
"data":{
"RequestId":"608C6467-3195-42A3-97B5-C51FB976****",
"Data":{
"eventSourceList":[
{
"Status":"Activated",
"Type":"UserDefined",
"Ctime":1626360902642,
"EventBusName": "demo-bus",
"SourceRocketMQParameters":{
"InstanceId":"MQ_INST_164901546557****_BXmr****",
"Tag":"",
"RegionId":"cn-hangzhou",
"Topic":"demo-topic",
"GroupID":"GID_SOURCE",
"Offset":"CONSUME_FROM_LAST_OFFSET"
},
"ARN":"acs:eventbridge:cn-hangzhou:164901546557****:eventbus/my-event-bus/eventsource/myRocketMQ.source",
"Name":"demo.source"
}
]
},
"Code":"Success",
"Success":true
},
"httpStatusCode":"200",
"requestId":"608C6467-3195-42A3-97B5-C51FB976****",
"successResponse":true
}该文章对您有帮助吗?