Querying Users Granted Permissions for a Topic
Function
This API is used to query the list of users that have been granted permissions for a topic.
URI
GET /v2/{project_id}/instances/{instance_id}/topics/{topic}/accesspolicy
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID. For details about how to obtain it, 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 |
| topic | Yes | String | Definition Topic name. Constraints N/A Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| offset | No | Integer | Definition Offset where the query starts. Constraints N/A Range ≥ 0 Default Value 0 |
| limit | No | Integer | Definition Number of records to query. Constraints N/A Range 1–50 Default Value 10 |
Request Parameters
None
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| policies | Array of policies objects | Definition User list. Constraints N/A Range N/A Default Value N/A |
| total | Number | Definition Total number of users. Constraints N/A Range N/A Default Value N/A |
| name | String | Definition Name of the topic or consumer group. Constraints N/A Range N/A Default Value N/A |
| Parameter | Type | Description |
|---|---|---|
| access_key | String | Definition Username. Constraints N/A Range N/A Default Value N/A |
| white_remote_address | String | Definition IP address whitelist. Constraints N/A Range N/A Default Value N/A |
| admin | Boolean | Definition Whether the user is an administrator. Constraints N/A Range Default Value N/A |
| perm | String | Definition User permissions. Constraints N/A Range Default Value N/A |
Example Requests
Querying the list of users granted permissions for a topic
GET https://{endpoint}/v2/{project_id}/instances/{instance_id}/topics/{topic}/accesspolicy Example Responses
Status code: 200
List of users granted permissions for a topic queried successfully.
{
"policies" : [ {
"access_key" : "dms_test",
"white_remote_address" : "192.168.1.1",
"admin" : true,
"perm" : "PUB|SUB"
} ],
"total" : 0,
"name" : "test"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | List of users granted permissions for a topic queried successfully. |
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.