Updates the configuration of an event source.
URL
/openapi/updateEventSource
Usage notes
You can specify only one of the SourceMNSParameters, SourceRocketMQParameters, and SourceRabbitMQParameters parameters for an event source.
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
EventSourceName | String | Yes | myrabbitmq.source | The name of the event source. |
Description | String | Yes | Event source of the Message Queue for RabbitMQ type | The description of the event source. |
SourceMNSParameters | Object | No | The resource information that you configure when the event provider is MNS. | |
SourceRocketMQParameters | Object | No | The resource information that you configure when the event provider is Message Queue for Apache RocketMQ. | |
SourceRabbitMQParameters | Object | No | The resource information that you configure when the event provider is Message Queue for RabbitMQ. | |
EventBusName | String | Yes | my-event-bus | The name of the event bus with which the event source is associated. For more information, see Limits. |
Request parameter SourceMNSParameters
If you specify the SourceMNSParameters parameter, you can set the parameters described in the following table.
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
RegionId | String | Yes | cn-zhangjiakou | The ID of the region where the MNS queue resides. |
QueueName | String | Yes | MyQueue | The name of the MNS queue. |
IsBase64Decode | String | Yes | true | Specifies whether to enable Base64 decoding. Default value: true. |
Request parameter SourceRocketMQParameters
If you specify the SourceRocketMQParameters parameter, you can set the parameters described in the following table.
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
RegionId | String | Yes | cn-zhangjiakou | The ID of the region where the Message Queue for Apache RocketMQ instance resides. |
InstanceId | String | Yes | MQ_INST_164901546557****_BAAN**** | The ID of the Message Queue for Apache RocketMQ instance. For more information, see Limits. |
Topic | String | Yes | mytopic | The name of the topic in the Message Queue for Apache RocketMQ instance. For more information, see Limits. |
Tag | String | No | test | The tag that is used to filter messages. |
Offset | String | No | CONSUME_FROM_TIMESTAMP | The consumer offset of the message. Valid values:
Default value: CONSUME_FROM_LAST_OFFSET. |
Timestamp | Long | No | 1636597951964 | The timestamp of the offset from which the consumption starts. This parameter is valid only when you set the Offset parameter to CONSUME_FROM_TIMESTAMP. |
GroupID | String | Yes | GID_group1 | The ID of the group in Message Queue for Apache RocketMQ. |
Request parameter SourceRabbitMQParameters
If you specify the SourceRabbitMQParameters parameter, you can set the parameters described in the following table.
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
RegionId | String | Yes | cn-zhangjiakou | The ID of the region where the Message Queue for RabbitMQ instance resides. |
InstanceId | String | Yes | amqp-cn-nif22u74**** | The ID of the Message Queue for RabbitMQ instance. For more information, see Limits. |
VirtualHostName | String | Yes | eb-connect | The name of the vhost in the Message Queue for RabbitMQ instance. For more information, see Limits. |
QueueName | String | Yes | demo | The name of the queue in the Message Queue for RabbitMQ instance. For more information, see Limits. |
Response parameters
If the configuration of the event source is updated, the HTTP status code 200 is returned and no response body is returned.
Example: Modify the configuration of an event source of the Message Queue for Apache RocketMQ type
Sample request
POST /openapi/updateEventSource 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":"myRocketMQ.source",
"Description":"Event source of the Message Queue for Apache RocketMQ type",
"SourceRocketMQParameters":{
"InstanceId":"MQ_INST_164901546557****_BAAN****",
"GroupID":"GID_group1",
"Topic":"mytopic",
"Offset":"CONSUME_FROM_LAST_OFFSET",
"Tag":"test",
"RegionId":"cn-hangzhou"
},
"EventBusName":"my-event-bus"
}
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: 45d93c3b-7763-451b-b240-a5f1c2cc****
Date: Sat, 18 Apr 2020 05:30:41 GMT
{
"code":"200",
"data":{
"RequestId":"45d93c3b-7763-451b-b240-a5f1c2cc****",
"Data":true,
"Code":"Success",
"Success":true
},
"httpStatusCode":"200",
"requestId":"45d93c3b-7763-451b-b240-a5f1c2cc****",
"successResponse":true
}