ListUserDefinedEventSources

更新时间:
复制 MD 格式

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

NameTypeExampleDescription
StatusStringActivatedThe status of the event source.
Valid value:
  • Activated: The feature is active.
TypeStringUserDefinedThe type of the event source.
Valid value:
  • UserDefined: a user-defined event source.
SourceMNSParametersObjectThe event provider is Simple Message Queue (formerly MNS).
SourceRocketMQParametersObjectThe event provider is ApsaraMQ for RocketMQ.
SourceRabbitMQParametersObjectThe event provider is ApsaraMQ for RabbitMQ.
SourceHttpEventParametersObjectThe event provider is HTTP or HTTPS.
SourceSLSParametersObjectThe event provider is Simple Log Service (SLS).
CtimeString1626360902642The time when the event source was created. This value is a UNIX timestamp in milliseconds.
EventBusNameStringdemo-busThe event bus that is associated with the event source.
ARNStringacs:eventbridge:cn-hangzhou:164901546557****:eventbus/my-event-bus/eventsource/myRocketMQ.sourceThe Alibaba Cloud Resource Name (ARN) of the event source.
NameStringrocketmq.sourceThe name of the event source.

Response parameters for SourceMNSParameters

NameTypeExampleDescription
RegionIdStringcn-zhangjiakouSimple Message Queue (formerly MNS): The region that hosts the queue.
QueueNameStringMyQueueSimple Message Queue (formerly MNS) queue.
IsBase64DecodeStringtrueIndicates whether Base64 encoding is enabled.

Response parameters for SourceRocketMQParameters

NameTypeExampleDescription
RegionIdStringcn-zhangjiakouApsaraMQ for RocketMQ instance resides.
InstanceIdStringMQ_INST_164901546557****_BAAN****ApsaraMQ for RocketMQ instance. For more information, see Limits.
TopicStringmytopicApsaraMQ for RocketMQ instance. For more information, see Limits.
TagStringtestThe tag that is used to filter messages.
OffsetStringCONSUME_FROM_TIMESTAMPThe consumer offset of messages. Valid values:
  • CONSUME_FROM_LAST_OFFSET: Start consumption from the latest offset.
  • CONSUME_FROM_FIRST_OFFSET: Start consumption from the earliest offset.
  • CONSUME_FROM_TIMESTAMP: Start consumption from the offset at a specified point in time.
TimestampLong1636597951964The timestamp. This parameter is valid only when the Offset parameter is set to CONSUME_FROM_TIMESTAMP.
GroupIDStringGID_group1ApsaraMQ for RocketMQ Group.

Response parameters for SourceRabbitMQParameters

NameTypeExampleDescription
RegionIdStringcn-zhangjiakouApsaraMQ for RabbitMQ instance is located.
InstanceIdStringamqp-cn-nif22u74****ApsaraMQ for RabbitMQ instance. For more information, see Limits.
VirtualHostNameStringeb-connectApsaraMQ for RabbitMQ instance. For more information, see Limits.
QueueNameStringdemoApsaraMQ for RabbitMQ instance. For more information, see Limits.

Response parameters for SourceHttpEventParameters

NameTypeRequiredExampleDescription
TypeStringYesHTTPSThe protocol type supported by the generated webhook. Valid values:
  • HTTP
  • HTTPS
  • HTTP&HTTPS
MethodListYesGETThe HTTP request methods supported by the generated webhook. You can select multiple values. Valid values:
  • GET
  • POST
  • PUT
  • PATCH
  • DELETE
  • HEAD
  • OPTIONS
  • TRACE
  • CONNECT
SecurityConfigStringYesipThe type of security configuration. Valid values:
  • none: No configuration is required.
  • ip: CIDR block.
  • referer: Security domain.
IpListNo10.0.0.0/8The 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.
RefererListNoaliyundoc.comThe 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

NameTypeRequiredExampleDescription
ProjectStringYestest-projectThe Simple Log Service (SLS) log project.
LogStoreStringYestest-logstoreThe SLS Logstore.
ConsumePositionStringNoendThe 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.
RoleNameStringYestestRoleThe 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: 26

Sample 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
}