Help Center/ VPC Endpoint/ API Reference/ API/ Tags/ Querying Resource Tags

Querying Resource Tags

Updated on 2025-05-15 GMT+08:00

Function

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

Calling Method

For details, see Calling APIs.

URI

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

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

resource_type

Yes

String

Specifies the resource type.

  • endpoint_service: indicates the VPC endpoint service.

  • endpoint: indicates the VPC endpoint.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token. It can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token.

Content-Type

No

String

Specifies the MIME type of the request body. Default value application/json is recommended. For APIs used to upload objects or images, the MIME type varies depending on the flow type.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

tags

Array of TagValuesList objects

Tags are included. A maximum of 10 tag keys are included, and each tag value can have a maximum of 10 values.

Each tag value can be an empty array, but the tag structure cannot be missing. Tag keys must be unique.

Values of the same tag key must be unique. Specifies all returned tags of the resource.

Keys are in the AND relationship while values in the key-value structure are in the OR relationship.

If no filtering condition for tags is specified, full data is returned.

Table 4 TagValuesList

Parameter

Type

Description

key

String

Specifies the tag key.

Each tag key can contain a maximum of 128 Unicode characters but cannot be left blank. (The system does not verify the value of key when searching for resources.)

key cannot be an empty string or spaces. Before using key, delete single-byte character (SBC) spaces before and after the key.

values

Array of strings

Specifies the tag values.

Each tag value contains a maximum of 255 Unicode characters. Before you verify and use it, delete spaces at the beginning and end of the tag value.

The tag value can be an empty array but cannot be left blank. If values are left blank, it indicates any_value (querying any value).

Values are in the OR relationship. The system does not verify the character set of values when searching for resources, but only verifies the length.

Example Requests

  • Querying tags of a VPC endpoint service

    GET https://{endpoint}/v1/{project_id}/endpoint_service/tags
  • Querying tags of a VPC endpoint

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

Example Responses

Status code: 200

Indicates the list of tags.

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

Status Codes

Status Code

Description

200

Indicates the list of tags.

Error Codes

See Error Codes.

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback