Updated on 2025-01-14 GMT+08:00

Listing All Tags of a Tenant

Function

This API is used to query the tags of all resources owned by a tenant in a specific project.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/dcs/tags

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Parameter description:

Project ID. For details, see Obtaining a Project ID.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

tags

Array of Tag objects

Parameter description:

Tag list.

Value range:

N/A.

Table 3 Tag

Parameter

Type

Description

key

String

Parameter description:

Tag key. The key contains a maximum of 128 characters.

Value range:

N/A.

values

Array of strings

Parameter description:

Tag value.

Value range:

N/A.

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_msg

String

Parameter description:

Error message.

Value range:

N/A.

error_code

String

Parameter description:

Error code.

Value range:

For details, see Error Codes.

error_ext_msg

String

Parameter description:

Extended error information. This parameter is not used currently and is set to null.

Value range:

N/A.

Status code: 500

Table 5 Response body parameters

Parameter

Type

Description

error_msg

String

Parameter description:

Error message.

Value range:

N/A.

error_code

String

Parameter description:

Error code.

Value range:

For details, see Error Codes.

error_ext_msg

String

Parameter description:

Extended error information. This parameter is not used currently and is set to null.

Value range:

N/A.

Example Requests

POST https://{dcs_endpoint}/v2/{project_id}/dcs/tags

Example Responses

Status code: 200

Successfully queried all tags of the tenant.

{
  "tags" : [ {
    "values" : [ "value1", "value2" ],
    "key" : "1"
  }, {
    "values" : [ "value1", "value2" ],
    "key" : "2"
  } ]
}

Status Codes

Status Code

Description

200

Successfully queried all tags of the tenant.

400

Invalid request.

500

Internal service error.

Error Codes

See Error Codes.