Querying Users
Function
This API is used to query users of a RabbitMQ AMQP instance.
Calling Method
For details, see Calling APIs.
URI
GET /v2/{project_id}/instances/{instance_id}/users
| 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 it. The instance ID is in the response body. Constraints N/A Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| offset | No | String | Definition: Query offset. Constraints: N/A Range: ≥ 0 Default Value: 0. |
| limit | No | String | 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 |
|---|---|---|
| users | Array of AMQPUser objects | Definition: User list. |
| total | Integer | Definition: Total number of users. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| access_key | String | Definition: Username. Range: N/A |
| secret_key | String | Definition: Key. Range: |
| vhosts | Array of AMQPUserPerm objects | Definition: Virtual hosts to be granted permissions for. Each user can have permissions for multiple virtual hosts. |
| Parameter | Type | Description |
|---|---|---|
| vhost | String | Definition: Name of the virtual host to be granted permissions for. Each user can have permissions for multiple virtual hosts. Range: N/A |
| conf | String | Definition: Granting resource permissions using regular expressions. For example, if you enter ^janeway-.* in the text box, it indicates that the user is authorized to configure all the resources whose names start with janeway- in this virtual host. Range: N/A |
| write | String | Definition: Granting resource write permissions using regular expressions. For example, if you enter .* in the text box, it indicates that the user is authorized to write to all resources in this virtual host. Range: N/A |
| read | String | Definition: Granting resource read permissions using regular expressions. For example, if you enter .* in the text box, it indicates that the user is authorized to read all resources in this virtual host. Range: N/A |
Example Requests
Querying users
GET https://{endpoint}/v2/{project_id}/instances/{instance_id}/users?offset=0&limit=10 Example Responses
Status code: 200
Successful
{
"users" : [ {
"access_key" : "admin123",
"secret_key" : "**************",
"vhosts" : [ {
"vhost" : "default",
"conf" : ".*",
"write" : ".*",
"read" : ".*"
} ]
} ],
"total" : 1
} 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.