Help Center> Domain Name Service> API Reference> APIs> Tag Management> Querying All Tags of a Specific Resource
Updated on 2024-03-25 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

User token. It can be obtained by calling an 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 tagValues objects

Tag list

Table 4 tagValues

Parameter

Type

Description

key

String

Tag key. A key can contain a maximum of 127 Unicode characters. key must be specified. (This parameter is not verified during search.)

values

Array of strings

Tag value. Each value can contain a maximum of 255 Unicode characters. The asterisk () is a reserved character. If the value starts with an asterisk (), fuzzy search is performed based on the value following the asterisk (*). If values is missing, any value is matched. All values of a tag key 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.