Creates an exchange.
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateExchange | The operation that you want to perform. Set the value to CreateExchange. |
AutoDeleteState | Boolean | Yes | false | Specifies whether the Auto Delete attribute is configured. Valid values:
|
ExchangeName | String | Yes | DemoExchange | The name of the exchange. Description:
|
ExchangeType | String | Yes | DIRECT | The type of the exchange. Valid values:
|
InstanceId | String | Yes | amqp-cn-v0h1kb9nu*** | The ID of the instance. |
Internal | Boolean | Yes | false | Specifies whether an exchange is an internal exchange. Valid values:
|
RegionId | String | Yes | cn-hanghzou | The ID of the region where your instance resides. |
VirtualHost | String | Yes | test | The vhost where an exchange resides. |
AlternateExchange | String | No | DemoAE | The alternate exchange. An alternate exchange is configured for an existing exchange. It is used to receive messages that fail to be routed to queues from the existing exchange. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 021788F6-E50C-4BD6-9F80-66B0A19A6*** | The ID of the request. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=CreateExchange
&AutoDeleteState=false
&ExchangeName=DemoExchange
&ExchangeType=DIRECT
&InstanceId=amqp-cn-v0h1kb9nu***
&Internal=false
&RegionId=cn-hanghzou
&VirtualHost=test
&<Common request parameters>
Sample success responses
XML
format
<CreateExchangeResponse>
<RequestId>021788F6-E50C-4BD6-9F80-66B0A19A6***</RequestId>
</CreateExchangeResponse>
JSON
format
{
"RequestId": "021788F6-E50C-4BD6-9F80-66B0A19A6***"
}
Error codes
For a list of error codes, visit the API Error Center.