Queries exchanges.

Request parameters

Parameter Type Required Example Description
Action String Yes ListExchanges

The operation that you want to perform.

Set the value to ListExchanges.

InstanceId String Yes 1880770869023***

The ID of the instance.

MaxResults Integer Yes 1

The maximum number of result entries to return.

RegionId String Yes cn-hangzhou

The ID of the region.

VirtualHost String Yes test

The name of the vhost.

NextToken String No ,

The token used to view data of the next page. This parameter is left empty for the first call.

Response parameters

Parameter Type Example Description
Data Struct

The returned data.

Exchanges Array of ExchangeVO

An array of exchanges.

Attributes Map test

The attributes.

AutoDeleteState Boolean false

Indicates whether the Auto Delete attribute is configured.

CreateTime Long 1580886216000

The creation time.

ExchangeType String DIRECT

The type of the exchange.

Name String amq.direct

The name of the exchange.

VHostName String test

The name of the vhost.

MaxResults Integer 1

The maximum number of returned result entries.

NextToken String ,

The token used to view data of the next page.

RequestId String FEBA5E0C-50D0-4FA6-A794-4901E5465***

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListExchanges
&InstanceId=1880770869023***
&MaxResults=1
&RegionId=cn-hangzhou
&VirtualHost=test
&<Common request parameters>

Sample success responses

XML format

<ListExchangesResponse>
      <RequestId>FEBA5E0C-50D0-4FA6-A794-4901E5465***</RequestId>
      <Data>
            <NextToken>,</NextToken>
            <MaxResults>1</MaxResults>
            <Exchanges>
                  <VHostName>test</VHostName>
                  <CreateTime>1580886216000</CreateTime>
                  <AutoDeleteState>false</AutoDeleteState>
                  <ExchangeType>DIRECT</ExchangeType>
                  <Name>amq.direct</Name>
            </Exchanges>
      </Data>
</ListExchangesResponse>

JSON format

{
  "RequestId": "FEBA5E0C-50D0-4FA6-A794-4901E5465***",
  "Data": {
    "NextToken": ",",
    "MaxResults": 1,
    "Exchanges": [
      {
        "VHostName": "test",
        "CreateTime": 1580886216000,
        "AutoDeleteState": false,
        "ExchangeType": "DIRECT",
        "Name": "amq.direct"
      }
    ]
  }
}

Error codes

For a list of error codes, visit the API Error Center.