UpdateEventSource
Updates the configuration of an event source.
URL
/openapi/updateEventSource
Usage notes
You can specify only one of the SourceMNSParameters, SourceRocketMQParameters, SourceRabbitMQParameters, SourceHttpEventParameters, and SourceSLSParameters parameters for an event source.
Request parameters
| Parameter | Type | Required | Example | Description |
| EventSourceName | String | Yes | myrabbitmq.source | The name of the event source. For more information, see Limits. |
| Description | String | Yes | Event source of the Message Queue for RabbitMQ type | The description of the event source. |
| SourceMNSParameters | Object | No | Specifies that the event provider is Simple Message Queue (formerly MNS). For more information, see Request parameter SourceMNSParameters. | |
| SourceRocketMQParameters | Object | No | Specifies that the event provider is ApsaraMQ for RocketMQ. For more information, see Request parameter SourceRocketMQParameters. | |
| SourceRabbitMQParameters | Object | No | Specifies that the event provider is ApsaraMQ for RabbitMQ. For more information, see Request parameter SourceRabbitMQParameters. | |
| SourceHttpEventParameters | Object | No | Specifies that the event provider is HTTP or HTTPS. For more information, see Request parameter SourceHttpEventParameters. | |
| SourceSLSParameters | Object | No | Specifies that the event provider is Log Service. For more information, see Request parameter SourceSLSParameters. | |
| EventBusName | String | Yes | my-event-bus | The name of the event bus with which the event source is to be associated. For more information, see Limits. |
Request parameter SourceMNSParameters
If you specify the SourceMNSParameters parameter, you can configure the parameters described in the following table.
| Parameter | Type | Required | Example | Description |
| RegionId | String | Yes | cn-zhangjiakou | The ID of the region where the Simple Message Queue (formerly MNS) queue resides. |
| QueueName | String | Yes | MyQueue | The name of the queue in the Simple Message Queue (formerly MNS) instance. |
| IsBase64Decode | String | Yes | true | Specifies whether to enable Base64 decoding. Default value: true. |
Request parameter SourceRocketMQParameters
If you specify the SourceRocketMQParameters parameter, you can configure the parameters described in the following table.
| Parameter | Type | Required | Example | Description |
| RegionId | String | Yes | cn-zhangjiakou | The ID of the region where the ApsaraMQ for RocketMQ instance resides. |
| InstanceId | String | Yes | MQ_INST_164901546557****_BAAN**** | The ID of the ApsaraMQ for RocketMQ instance. For more information, see Limits. |
| Topic | String | Yes | mytopic | The name of the topic in the ApsaraMQ for RocketMQ instance. For more information, see Limits. |
| Tag | String | No | test | The tags that are used to filter messages. |
| Offset | String | No | CONSUME_FROM_TIMESTAMP | The consumer offset of messages. Valid values:
Default value: CONSUME_FROM_LAST_OFFSET. |
| Timestamp | Long | No | 1636597951964 | The timestamp of the offset from which consumption starts. Unit: milliseconds. This parameter is valid only if you set the Offset parameter to CONSUME_FROM_TIMESTAMP. |
| GroupID | String | Yes | GID_group1 | The ID of the group in the ApsaraMQ for RocketMQ instance. |
Request parameter SourceRabbitMQParameters
If you specify the SourceRabbitMQParameters parameter, you can configure the parameters described in the following table.
| Parameter | Type | Required | Example | Description |
| RegionId | String | Yes | cn-zhangjiakou | The ID of the region where the ApsaraMQ for RabbitMQ instance resides. |
| InstanceId | String | Yes | amqp-cn-nif22u74**** | The ID of the ApsaraMQ for RabbitMQ instance. For more information, see Limits. |
| VirtualHostName | String | Yes | eb-connect | The name of the vhost in the ApsaraMQ for RabbitMQ instance. For more information, see Limits. |
| QueueName | String | Yes | demo | The name of the queue in the ApsaraMQ for RabbitMQ instance. For more information, see Limits. |
Request parameter SourceHttpEventParameters
If you specify the SourceHttpEventParameters parameter, you can set the parameters described in the following table.
| Parameter | Type | Required | Example | Description |
| Type | String | Yes | HTTPS | The protocol type supported by the generated webhook URL. Valid values:
|
| Method | List | Yes | GET | The HTTP request method supported by the generated webhook URL. You can select multiple values. Valid values:
|
| SecurityConfig | String | Yes | ip | The type of security settings. Valid values:
|
| Ip | List | No | 10.0.0.0/8 | The CIDR blocks used for security settings. This parameter is required only if you set the SecurityConfig parameter to ip. You can enter CIDR blocks or IP addresses. Separate multiple CIDR blocks or IP addresses with commas (,). |
| Referer | List | No | aliyundoc.com | The security domain names. This parameter is required only when you set the SecurityConfig parameter to referer. You can enter domain names. |
Request parameters SourceSLSParameters
If you specify the SourceSLSParameters parameter, you can set the parameter described in the following table.
| Parameter | Type | Required | Example | Description |
| RoleName | String | Yes | testRole | When you authorize EventBridge to use this role to read the logs in Log Service, you must select Alibaba Cloud Service for the Selected Trusted Entity parameter, and select EventBridge for the Select Trusted Service parameter when you create the role in the Resource Access Management (RAM) console. |
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
}