Help Center/ Domain Name Service/ API Reference/ APIs/ Tags/ Querying Tags of a Specific Instance
Updated on 2025-08-19 GMT+08:00

Querying Tags of a Specific Instance

Function

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

Calling Method

For details, see Calling APIs.

URI

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

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

resource_type

Yes

String

Resource type. The value can be DNS-public_zone, DNS-private_zone, DNS-public_recordset, DNS-private_recordset, or DNS-ptr_record.

resource_id

Yes

String

Resource ID

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

The user token.

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

For details about how to obtain a user token, seeObtaining a User Token.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

tags

Array of tag objects

Tag list.

Table 4 tag

Parameter

Type

Description

key

String

Definition

The tag key.

Range

  • Cannot be left blank.

  • Must be unique for each resource.

  • Contains up to 128 characters.

  • Cannot start or end with a space, or start with sys. Only letters, digits, spaces, and the following special characters are allowed: _.:=+-@

value

String

Definition

The tag value.

Range

  • Can be left blank.

  • Can contain a maximum of 255 characters.

  • Only letters, digits, spaces, and the following special characters are allowed: _.:/=+-@

Example Requests

None

Example Responses

Status code: 200

Response to the request for querying resource tags

{
  "tags" : [ {
    "key" : "key1",
    "value" : "value1"
  }, {
    "key" : "key2",
    "value" : "value2"
  } ]
}

Status Codes

Status Code

Description

200

Response to the request for querying resource tags

Error Codes

See Error Codes.