Querying a Topic Permission
Function
This API is used to query the permission of a topic.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
URI
GET /v2/{project_id}/mqs/instances/{instance_id}/topics/{topic_name}/accesspolicy
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details about how to obtain a project ID, see "Appendix" > "Obtaining a Project ID" in this document. |
|
instance_id |
Yes |
String |
Instance ID. |
|
topic_name |
Yes |
String |
Topic name. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
offset |
No |
String |
Offset of the pagination query. |
|
limit |
No |
String |
Maximum number of records to be displayed on a page. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token, which can be obtained by calling the IAM API (value of X-Subject-Token in the response header). |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
name |
String |
Topic name. |
|
policies |
Array of policies objects |
Policy list. |
|
total |
Integer |
Total number of policies. |
|
size |
Integer |
Number of policies queried. |
|
operation |
String |
Topic name. |
|
Parameter |
Type |
Description |
|---|---|---|
|
owner |
Boolean |
Whether the application is the one selected during topic creation. |
|
user_name |
String |
Application key. |
|
access_policy |
String |
Permission type.
|
|
app_name |
String |
Application name. |
|
tag |
String |
Tag corresponding to the permission type. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
Example Requests
GET https://{endpoint}/v2/{project_id}/mqs/instances/{instance_id}/topics/{topic_name}/accesspolicy
Example Responses
Status code: 200
OK
{
"name" : "topic-test",
"policies" : [ {
"owner" : true,
"user_name" : "c5abd910-02b1-4bc4-b587-c3fe4c49dab9",
"access_policy" : "pub",
"app_name" : "topic test",
"tag" : "11 || 22 || aa || bb"
} ],
"total" : 1,
"size" : 1,
"operation" : "topic-test"
}
Status code: 400
Bad Request
{
"error_code" : 400,
"error_msg" : "Bad Request"
}
Status code: 403
Forbidden
{
"error_code" : 403,
"error_msg" : "Forbidden"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
|
400 |
Bad Request |
|
403 |
Forbidden |
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