Queries virtual hosts (vhosts).

Request parameters

Parameter Type Required Example Description
Action String Yes ListVirtualHosts

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

ListVirtualHosts.

InstanceId String Yes 1880770869023***

The ID of the instance.

MaxResults Integer Yes 2

The maximum number of entries to return. Valid values:

1 to 100

RegionId String Yes cn-hangzhou

The ID of the region.

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.

MaxResults Integer 2

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.

VirtualHosts Array of VhostVO

An array of vhosts.

Name String test

The name of the vhost.

RequestId String EF4DB019-DA4A-4CE3-B220-223BBC93F***

The ID of the request.

Examples

Sample requests

http(s)://amqp-open.cn-hangzhou.aliyuncs.com/?Action=ListVirtualHosts
&InstanceId=1880770869023***
&MaxResults=2
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

<ListVirtualHostsResponse>
      <RequestId>EF4DB019-DA4A-4CE3-B220-223BBC93F***</RequestId>
      <Data>
            <NextToken></NextToken>
            <MaxResults>2</MaxResults>
            <VirtualHosts>
                  <Name>test</Name>
            </VirtualHosts>
      </Data>
</ListVirtualHostsResponse>

JSON format

{
    "RequestId":"EF4DB019-DA4A-4CE3-B220-223BBC93F***",
    "Data":{
        "NextToken":"",
        "MaxResults":"2",
        "VirtualHosts":[
            {
                "Name":"test"
            }
        ]
    }
}

Error codes

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