• Data Warehouse Service

dws
  1. Help Center
  2. Data Warehouse Service
  3. API Reference
  4. API Description
  5. Tag Management APIs
  6. Querying Resource Tags

Querying Resource Tags

Function

This interface is used to query tags of a specified resource.

URI

  • URI format

    GET /v1.0/{project_id}/clusters/{resource_id}/tags

  • Parameter description
    Table 1 URI parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

    resource_id

    Yes

    String

    Resource ID. Example: 7d85f602-a948-4a30-afd4-e84f47471c15

Request

  • Sample request
    GET /v1.0/89cd04f168b84af6be287f71730fdb4b/clusters/7d85f602-a948-4a30-afd4-e84f47471c15/tags

Response

  • Sample response
    {
        "tags": [
            {
                "key": "Flower",
                "value": "rose"
            },
            {
                "key": "Food",
                "value": "pie"
            }
        ]
    }
  • Parameter description
    Table 2 Response parameter description

    Parameter

    Mandatory

    Type

    Description

    tags

    Yes

    List<resource_tag>

    Tag list. For details, see Table 3.

    Table 3 resource_tag field description

    Parameter

    Mandatory

    Type

    Description

    key

    Yes

    String

    Key. A tag key can contain a maximum of 36 Unicode characters, which cannot be null. The first and last characters cannot be spaces.

    It can contain uppercase letters (A to Z), lowercase letters (a to z), digits (0-9), hyphens (-), and underscores (_).

    value

    Yes

    String

    Key value. A tag value can contain a maximum of 43 Unicode characters, which can be null. The first and last characters cannot be spaces. It can contain uppercase letters (A to Z), lowercase letters (a to z), digits (0-9), hyphens (-), and underscores (_).

Returned Value

  • Normal

    200

  • Abnormal
    Table 4 Returned value for failed requests

    Returned Value

    Description

    400

    Invalid parameters.

    401

    Authentication failed.

    403

    You do not have the rights to perform the operation.

    404

    The requested resource was not found.

    500

    Internal service error.