Queries bindings.

Request parameters

Parameter Type Required Example Description
Action String Yes ListBindings

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

ListBindings.

InstanceId String Yes 1880770869023***

The ID of the instance.

MaxResults Integer Yes 1

The maximum number of entries to return. Valid values:

1~100
RegionId String Yes cn-hangzhou

The ID of the region.

VirtualHost String Yes Test

The name of the virtual host (vhost).

NextToken String No caeba0bbb2be03f84eb48b699f0a****

The token that marks the end position of the result to return. To obtain the next batch of data, call the operation again by using the value of the NextToken parameter returned by the previous request. The first time you call this operation, set the NextToken parameter to an empty string. If you want to query all results, set the NextToken parameter to an empty string.

Response parameters

Parameter Type Example Description
Data Struct

The returned data.

Bindings Array of BindingDO

An array of bindings.

Argument String all

The x-match attribute. Valid values:

  • all: A headers exchange routes a message to a queue only if all binding attributes of the queue except for x-match match the headers attributes of the message. This value is a default value.
  • any: A headers exchange routes a message to a queue if one or more binding attributes of the queue except for x-match match the headers attributes of the message.

This parameter applies to only headers exchanges.

BindingKey String amq.test

The binding key.

  • If the source exchange is not a topic exchange, the binding key meets the following requirements:
    • The binding key can contain only letters, digits, and the following special characters: -_./@
    • The binding key must be 1 to 255 characters in length.
  • If the source exchange is a topic exchange, the binding key meets the following requirements:
    • The binding key can contain letters, digits, and the following special characters: -_*.#/@
    • The binding key cannot start or end with a period (.). If the binding key starts with a number sign (#) or an asterisk (*), a period (.) must be specified after the number sign (#) or asterisk (*). If the binding key ends with a number sign (#) or an asterisk (*), a period (.) must be specified before the number sign (#) or asterisk (*). If the binding key does not start or end with a number sign (#) or an asterisk (*), the key must start with a period (.) and end with a period (.).
    • The binding key must be 1 to 255 characters in length.
BindingType String QUEUE

The type of the object to which the source exchange is bound. Valid values:

  • QUEUE
  • EXCHANGE
DestinationName String QueueTest

The name of the object to which the source exchange is bound.

SourceExchange String test

The name of the source exchange.

MaxResults Integer 1

The maximum number of entries returned.

NextToken String caebacccb2be03f84eb48b699f0a****

The token that marks the end position of the returned result. If this parameter is empty, all data is returned.

RequestId String E0A71208-3E87-4732-81CC-B18E0B4B1***

The ID of the request.

Examples

Sample requests

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

Sample success responses

XML format

<ListBindingsResponse>
      <RequestId>E0A71208-3E87-4732-81CC-B18E0B4B1***</RequestId>
      <Data>
            <NextToken>,</NextToken>
            <MaxResults>1</MaxResults>
            <Bindings>
                  <SourceExchange>test</SourceExchange>
                  <Argument>all</Argument>
                  <BindingType>QUEUE</BindingType>
                  <BindingKey>amq.test</BindingKey>
                  <DestinationName>QueueTest</DestinationName>
            </Bindings>
      </Data>
</ListBindingsResponse>

JSON format

{
    "RequestId":"E0A71208-3E87-4732-81CC-B18E0B4B1***",
    "Data":{
        "NextToken":",",
        "MaxResults":"1",
        "Bindings":[
            {
                "SourceExchange":"test",
                "Argument":"all",
                "BindingType":"QUEUE",
                "BindingKey":"amq.test",
                "DestinationName":"QueueTest"
            }
        ]
    }
}

Error codes

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