All Products
Search
Document Center

ApsaraMQ for RabbitMQ:ListExchanges

Last Updated:Sep 12, 2024

Queries all exchanges that are created in a virtual host (vhost).

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
amqp:GetInstanceget
  • Instance
    acs:amqp:{#regionId}:{#accountId}:/instances/{#instanceId}
    none
  • amqp:ListExchange

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the ApsaraMQ for RabbitMQ instance.

amqp-cn-7pp2mwbc****
VirtualHoststringYes

The vhost name.

test
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results. Valid values:

  • 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 previous request.
AAAANDQBYW1xcC1jbi03cHAybXdiY3AwMGEBdmhvc3QBAXNkZndhYWJhATE2NDkzMTM4OTU5NDIB4o3z1pPwWzk4aYuiRffi8R6-****
MaxResultsintegerYes

The maximum number of entries to return. Valid values: 1 to 100

1

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

FEBA5E0C-50D0-4FA6-A794-4901E5465***
Dataobject

The returned data.

MaxResultsinteger

The maximum number of entries returned.

1
NextTokenstring

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.``
AAAANDQBYW1xcC1jbi03cHAybXdiY3AwMGEBdmhvc3QBAXNkZndhYWJhATE2NDkzMTM4OTU5NDIB4o3z1pPwWzk4aYuiRffi8R6-****
Exchangesarray<object>

The exchanges.

object
AutoDeleteStateboolean

Indicates whether the exchange was automatically deleted.

false
CreateTimelong

The timestamp that indicates when the exchange was created. Unit: milliseconds.

1580886216000
Attributesobject

The attributes. This parameter is unavailable in the current version.

test
VHostNamestring

The vhost name.

test
Namestring

The exchange name.

amq.direct
ExchangeTypestring

The exchange type.

DIRECT

Examples

Sample success responses

JSONformat

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

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-07-30The internal configuration of the API is changed, but the call is not affectedView Change Details