Querying Virtual Hosts
Function
This API is used to query virtual hosts.
Calling Method
For details, see Calling APIs.
URI
GET /v2/rabbitmq/{project_id}/instances/{instance_id}/vhosts
Parameter | Mandatory | Type | Description |
|---|---|---|---|
project_id | Yes | String | Definition Project ID. For details, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
instance_id | Yes | String | Definition: Instance ID. You can call the API for querying all instances to obtain the instance ID. The instance ID is in the response body. Constraints: N/A Range: N/A Default Value: N/A |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
offset | No | Integer | Definition: Offset from which the query starts. Constraints: N/A Range: ≥ 0 Default Value: 0 |
limit | No | Integer | Definition: Number of records on a page. Constraints: N/A Range: 0–50 Default Value: 10 |
Request Parameters
None
Response Parameters
Status code: 200
Parameter | Type | Description |
|---|---|---|
size | Integer | Definition: Number of current virtual hosts. Range: N/A |
total | Integer | Definition: Total number of queried virtual hosts. Range: N/A |
items | Array of ShowVhostDetailResp objects | Definition: Queried virtual host details. |
Example Requests
Querying virtual hosts
GET https://{endpoint}/v2/rabbitmq/{project_id}/instances/{instance_id}/vhosts?offset=0&limit=10 Example Responses
Status code: 200
Successful
{
"size" : 10,
"total" : 13,
"items" : [ {
"name" : "/",
"tracing" : false
}, {
"name" : "test-vhost1",
"tracing" : false
}, {
"name" : "test-vhost10",
"tracing" : false
}, {
"name" : "test-vhost2",
"tracing" : false
}, {
"name" : "test-vhost3",
"tracing" : false
}, {
"name" : "test-vhost4",
"tracing" : false
}, {
"name" : "test-vhost5",
"tracing" : false
}, {
"name" : "test-vhost6",
"tracing" : false
}, {
"name" : "test-vhost7",
"tracing" : false
}, {
"name" : "test-vhost8",
"tracing" : false
} ]
} Status Codes
Status Code | Description |
|---|---|
200 | Successful |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.

