Help Center/ Global Accelerator/ API Reference/ API/ Tag/ Querying Tags of a Specific Resource
Updated on 2025-11-04 GMT+08:00

Querying Tags of a Specific Resource

Function

This API is used to query tags of a specific resource.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    ga:tag:get

    Read

    accelerator

    g:ResourceTag/<tag-key>

    -

    -

    listener

    g:ResourceTag/<tag-key>

URI

GET /v1/{resource_type}/{resource_id}/tags

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

resource_type

Yes

Object

Resource type. Value range:

  • ga-accelerators: Global accelerators

  • ga-listeners: Listeners

resource_id

Yes

String

Specifies the resource ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token. The token can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

tags

Array of ResourceTag objects

Specifies the tags.

request_id

String

Specifies the request ID.

Table 4 ResourceTag

Parameter

Type

Description

key

String

The tag key.

  • A key can contain 1 to 128 characters. It cannot be left blank.

  • A key can contain UTF-8 letters, digits, spaces, and the following characters _.:=+-@

  • Do not enter a tag key starting with sys. Tag keys starting with sys are system tags.

value

String

The tag value.

  • A value can contain 0 to 255 characters.

  • A value can contain UTF-8 letters, digits, spaces, and the following characters _.:/=+-@

  • The tag value can be empty or null.

Example Requests

Querying tags of a specific resource

GET https://{ga_endpoint}/v1/{resource_type}/{resource_id}/tags

Example Responses

Status code: 200

Operation succeeded.

{
  "tags" : [ {
    "key" : "tagKey",
    "value" : "tagValue"
  } ],
  "request_id" : "915a14a6-867b-4af7-83d1-70efceb146f9"
}

Status Codes

Status Code

Description

200

Operation succeeded.

Error Codes

See Error Codes.