Queries exchanges.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringYesListExchanges

The operation that you want to perform. Set the value to

ListExchanges.

InstanceIdStringYesamqp-cn-7pp2mwbc****

The ID of the instance.

MaxResultsIntegerYes1

The maximum number of entries to return. Valid values:

1 to 100.

VirtualHostStringYestest

The name of the virtual host (vhost).

NextTokenStringNoAAAANDQBYW1xcC1jbi03cHAybXdiY3AwMGEBdmhvc3QBAXNkZndhYWJhATE2NDkzMTM4OTU5NDIB4o3z1pPwWzk4aYuiRffi8R6-****

The token that is used to query the next page. Set the value to:

  • If you call this operation for the first time or a next query is not required, leave this parameter empty.
  • If a next query is to be sent, set the value to the value of NextToken that is returned from the last call.

Response parameters

ParameterTypeExampleDescription
DataStruct

The returned data.

ExchangesArray of ExchangeVO

An array of exchanges.

AttributesMaptest

The current version does not support this parameter.

The attributes.

AutoDeleteStateBooleanfalse

Indicates whether the exchange was automatically deleted.

CreateTimeLong1580886216000

The time when the instance was created. This value is a UNIX timestamp. Unit: milliseconds.

ExchangeTypeStringDIRECT

The type of the exchange.

NameStringamq.direct

The name of the exchange.

VHostNameStringtest

The name of the virtual host (vhost).

MaxResultsInteger1

The maximum number of entries returned.

NextTokenStringAAAANDQBYW1xcC1jbi03cHAybXdiY3AwMGEBdmhvc3QBAXNkZndhYWJhATE2NDkzMTM4OTU5NDIB4o3z1pPwWzk4aYuiRffi8R6-****

The token that marks the end of the current returned page.

  • If the value of this parameter is empty, the next query is not required and the token used to start the next query is unavailable.
  • If the value of this parameter is not empty, the next query is required, and the value is the token used to start the next query.
RequestIdStringFEBA5E0C-50D0-4FA6-A794-4901E5465***

The ID of the request.

Examples

Sample requests

http(s)://amqp-open.cn-hangzhou.aliyuncs.com/?Action=ListExchanges
&InstanceId=amqp-cn-7pp2mwbc****
&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.