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.
URI
POST /v1/{project_id}/instances/{instance_id}/topics/accesspolicy
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain it, see Obtaining a 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
Granting the root user the permission to publish and subscribe to topic-test
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 |
The update is successful. |
400 |
Invalid parameters. |
403 |
Authentication failed. |
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot