Help Center/ VPC Endpoint/ API Reference/ APIs/ Tag Function/ Querying Tags of a Tenant's Resource
Updated on 2022-12-06 GMT+08:00

Querying Tags of a Tenant's Resource

Function

This API is used to obtain tags of resources of a tenant based on the tenant ID and resource type.

URI

GET /v1/{project_id}/{resource_type}/tags

Table 1 describes the required parameters.

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

resource_type

Yes

String

Specifies the resource type. The value is endpoint_service or endpoint.

Request

  • Parameter description

    None

  • Example request

    GET https://{endpoint}/v1/{project_id}/endpoint_service/tags

    or https://{endpoint}/v1/{project_id}/endpoint/tags GET /v1/{project_id}/{resource_type}/tags

Response

  • Parameter description
    Table 2 Response parameters

    Parameter

    Mandatory

    Type

    Description

    tags

    Yes

    List<resource_tag>

    Lists the tags.

    Table 3 Data structure of field resource_tag

    Parameter

    Mandatory

    Type

    Description

    key

    Yes

    String

    Specifies the tag key.

    values

    Yes

    List<String>

    Lists the tag values.

  • Example response
    {
        "tags": [
            {
                "key": "key1",
                "values": [
                    "*value1",
                    "value2"
                ]
            }
        ]
    }

Status Code

For details about status codes, see Status Code.