• Simple Message Notification

smn
  1. Help Center
  2. Simple Message Notification
  3. API Reference
  4. APIs
  5. Resource Tag Operations
  6. Querying Resource Tags

Querying Resource Tags

Description

  • API name

    ListResourceTags

  • Function

    Query tags of a specified resource.

    TMS may use this API to query all tags of a specified SMN resource.

URI

  • URI format

    GET /v2/{project_id}/{resource_type}/{resource_id}/tags

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID

    resource_type

    Yes

    String

    Resource type

    The value can be smn_topic.

    resource_id

    Yes

    String

    Resource ID

    Obtain a resource ID:

    • Add X-SMN-RESOURCEID-TYPE=name in the request header and set the resource ID to the topic name.
    • Call the GetResourceInstances API to obtain the resource ID.

Request

  • Parameter description

    None

  • Request example
    GET /v2/{project_id}/{resource_type}/{resource_id}/tags

Response

  • Parameter description

    Parameter

    Type

    Description

    tags

    Resource tag structure array

    Tag list. For details, see section Resource Tag Structure.

  • Response example
    {
           "tags": [
            {
                "key": "key1",
                "value": "value1"
            },
            {
                "key": "key2",
                "value": "value3"
            }
        ]
    }

Returned Value

See section Returned Value.

Error Code

See section Error Code.