Updated on 2022-12-05 GMT+08:00

Updating a Topic Permission

Function

This API is used to update the permission of a topic.

URI

POST /v2/{project_id}/mqs/instances/{instance_id}/topics/accesspolicy

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Tenant's project ID.

instance_id

Yes

String

Instance ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

topics

Yes

Array of UpdateTopicAccessPolicyTopicsObject objects

Policy list.

Table 3 UpdateTopicAccessPolicyTopicsObject

Parameter

Mandatory

Type

Description

name

Yes

String

Topic name.

policies

Yes

Array of UpdateTopicAccessPolicyPoliciesObject objects

Access policies.

description

No

String

Description.

sensitive_word

No

String

Sensitive field.

Table 4 UpdateTopicAccessPolicyPoliciesObject

Parameter

Mandatory

Type

Description

app_id

Yes

String

Application ID.

app_name

Yes

String

Application name.

access_policy

Yes

String

Permission type.

  • all: publish+subscribe

  • pub: publish

  • sub: subscribe

owner

No

Boolean

Whether the application is the one selected during topic creation.

The default value is false.

tag

No

String

Tag corresponding to the permission type.

When the permission type is all, publish and subscribe tags are separated by ampersands (&).

Multiple tags are separated by double vertical bars (||).

Response Parameters

None

Example Requests

POST https://{endpoint}/v2/{project_id}/mqs/instances/{instance_id}/topics/accesspolicy

{
  "topics" : [ {
    "name" : "topic-test-mqs",
    "policies" : [ {
      "owner" : true,
      "access_policy" : "pub",
      "app_name" : "app-dhytest",
      "tag" : "",
      "selected" : {
        "access_policy" : "publish",
        "key" : "pub"
      },
      "app_id" : "cd28a9d9-2184-42ce-9fbe-f3785b6caada"
    } ],
    "sensitive_word" : "",
    "description" : ""
  } ]
}

Example Responses

None

Status Codes

Status Code

Description

204

No Content

400

Bad Request

403

Forbidden

Error Codes

See Error Codes.