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

Querying All Tags of a Specific Resource

Function

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

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/{resource_type}/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.

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 tagValues objects

Tag list.

Table 4 tagValues

Parameter

Type

Description

key

String

Key. It can contain a maximum of 128 Unicode characters. The tag key cannot be left blank. (This parameter is not verified in the search process.)

values

Array of strings

Value list. Each value can contain a maximum of 255 Unicode characters. An asterisk (*) is a reserved character. If the value starts with an asterisk, fuzzy matching will work for the string following the asterisk. If this parameter is not specified, any value is matched. All values are in the OR relationship.

Example Requests

None

Example Responses

Status code: 200

Tag list.

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

Status Codes

Status Code

Description

200

Tag list.

Error Codes

See Error Codes.