Files
doc-exports/docs/smn/api-ref/smn_api_56006.html
2025-12-11 08:04:34 +00:00

11 KiB

Querying Tags in a Specified Project

Description

  • API name

    GetProjectTags

  • Function

    Query all tags of a resource type in a specified project.

URI

  • URI format

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

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID

    See Obtaining a Project ID.

    resource_type

    Yes

    String

    Resource type

    Only smn_topic (topic) is supported.

Request

  • Parameter description

    None

  • Example request
    GET https://{SMN_Endpoint}/v2/{project_id}/{resource_type}/tags

Response

  • Parameter description

    Parameter

    Type

    Description

    tags

    Tags structure array

    Tag list. For details, see Table 1.

    Table 1 Tags structure

    Parameter

    Type

    Description

    key

    String

    The tag key.

    • A tag key can contain a maximum of 127 Unicode characters.

    • key cannot be left blank.

    values

    String list

    The list of tag values.

    • Each tag contains a maximum of 10 values.

    • Each value must be unique.

    • Each value contains a maximum of 255 Unicode characters.

    • If values is left blank, it defaults to any_value.

    • Multiple values are linked by an OR operator, meaning only one needs to match.

  • Example response
    {
          "tags": [
            {
                "key": "key1",
                "values": [
                  "value1",
                  "value2"
                  ]
            },
            {
                "key": "key2",
                "values": [
                  "value1",
                  "value2"
                  ]
            }
        ]
    }

Returned Value

See Returned Value.

Error Codes

See Error Codes.