• Simple Message Notification

smn
  1. Help Center
  2. Simple Message Notification
  3. API Reference
  4. APIs
  5. Topic Operations
  6. Querying Topic Attributes

Querying Topic Attributes

Description

  • API name

    ListTopicAttributes

  • Function

    Query the topic attribute information.

URI

  • URI format

    GET /v2/{project_id}/notifications/topics/{topic_urn}/attributes?name=access_policy

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID

    topic_urn

    Yes

    String

    Resource identifier of a topic, which is unique

    name

    No

    String

    Attribute name

    Only specified attribute names are supported. For details, see section Topic Attribute List.

    NOTE:

    If the name parameter is not specified, all attribute values of the topic are queried. The supported attribute values are provided in section Topic Attribute List.

Request

Request example
GET /v2/{project_id}/notifications/topics/urn:smn:regionId:8bad8a40e0f7462f8c1676e3f93a8183:test_create_topic_v2/attributes?name=access_policy

Response

  • Parameter description

    Parameter

    Type

    Description

    request_id

    String

    Request ID, which is unique

    attributes

    Map

    Attribute key-value pair

  • Response example
    {
       "request_id":"6837531fd3f54550927b930180a706bf",
       "attributes": {
       "access_policy": "{
             "Version": "2016-09-07", 
             "Id": "__default_policy_ID", 
             "Statement": [
                {
                  "Sid": "__user_pub_0",
                  "Effect": "Allow",
                  "Principal": {
                    "CSP": [
                             "urn:csp:iam::93dc1b4697ac493d9b7d089569f86b32:root"
                           ]
                     },
                  "Action": ["SMN:Publish","SMN:QueryTopicDetail"],
                  "Resource": "urn:smn:regionId:8bad8a40e0f7462f8c1676e3f93a8183:aaa"
                  },
                  {
                  "Sid": "__service_pub_0", 
                  "Effect": "Allow",
                  "Principal": {
                     "Service": ["obs"]
                     },
                  "Action": ["SMN:Publish","SMN:QueryTopicDetail"],
                  "Resource": "urn:smn:regionId:8bad8a40e0f7462f8c1676e3f93a8183:aaa"
                  }
                 ]
              }"
           }
      }
    NOTE:

    The value of access_policy is a JSON character string, which requires escape characters. While in the preceding example, the characters are not escaped. You need to escape them before using the policy.

Returned Value

See section Returned Value.

Error Code

See section Error Code.