Granting User Permissions
Function
This API is used to grant user permissions.
User management is supported only when SASL is enabled for the Kafka instance.
Debugging
You can use API Explorer to debug this API.
URI
POST /v1/{project_id}/instances/{instance_id}/topics/accesspolicy
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. |
| instance_id | Yes | String | Instance ID. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| topics | Yes | Array of AccessPolicyTopicEntity objects | Topic list. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Topic name. |
| policies | Yes | Array of AccessPolicyEntity objects | Permission list. |
Response Parameters
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error description. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error description. |
Example Requests
This API is used to grant user permissions.
POST https://{endpoint}/v1/{project_id}/instances/{instance_id}/topics/accesspolicy
{
"topics" : [ {
"name" : "topic-test",
"policies" : [ {
"user_name" : "root",
"access_policy" : "all"
} ]
} ]
} Example Responses
None
Status Codes
| Status Code | Description |
|---|---|
| 204 | Update succeeded. |
| 400 | Invalid parameters. |
| 403 | Authorization failed. |
Error Codes
See Error Codes.
Last Article: Querying User Permissions
Next Article: Message Query
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.