• Domain Name Service

dns
  1. Help Center
  2. Domain Name Service
  3. API Reference
  4. API Description
  5. Tag Management
  6. Querying Tags of a Resource

Querying Tags of a Resource

Function

Query tags of a specified resource.

TMS may use this API to query all tags of a specified DNS resource.

URI

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

For details, see Table 1.
Table 1 Parameters in the URI

Parameter

Mandatory

Type

Description

project_id

Yes

string

Project ID of the tenant

resource_type

Yes

string

Resource type, which can be DNS-public_zoneDNS-private_zoneDNS-public_recordsetDNS-private_recordset, or DNS-ptr_record

resource_id

Yes

string

Resource ID

Request

None

Response

  • Parameter description
    Table 2 Parameter in the response

    Parameter

    Type

    Description

    tags

    List<tag>

    Tag list

    Table 3 Parameters in the tag list

    Parameter

    Type

    Description

    key

    string

    Tag key, which contains 36 Unicode characters at most and cannot be blank. It can contain only digits, letters, hyphens (-), and underscores (_).

    value

    string

    Tag value, which contains 43 Unicode characters at most and can be an empty string. It can contain only digits, letters, hyphens (-), and underscores (_).

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

Returned Value

  • Normal
    Table 4 Return code for successful requests

    Returned Value

    Description

    200

    OK

  • Abnormal
    Table 5 Return code for failed requests

    Returned Value

    Description

    400

    Invalid tag.

    401

    Authentication failed.

    403

    Insufficient permission.

    404

    The requested resource was not found.

    500

    An exception occurs in the system.