Help Center/ Global Accelerator/ API Reference/ API/ Tag/ Querying Tags of a Specific Resource
Updated on 2024-11-11 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.

URI

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

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

resource_type

Yes

Object

Specifies the resource type.

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

Specifies the tag key. The key must meet the following requirements:

  • The key can contain 1 to 128 characters.

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

  • Tags starting with _sys_ are system tags and cannot be entered by tenants.

value

String

Specifies the tag value. The value must meet the following requirements:

  • The value can contain 0 to 255 characters.

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

  • The 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.