Help Center> Cloud Backup and Recovery> API Reference> CBR APIs> Tags> Querying Tags of an Associated Resource

Querying Tags of an Associated Resource

Function

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

TMS uses this API to query all tags of a specified resource.

URI

GET /v3/{project_id}/vault/{vault_id}/tags

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

vault_id

Yes

String

Resource ID

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

tags

Array of Tag objects

Tag list.

Keys in the tag list must be unique.

sys_tags

Array of SysTag objects

Only users with the op_service permission can obtain this field. Currently, only one structure resource_tag is used. key: _sys_enterprise_project_id value: Enterprise project ID. The value 0 indicates the default enterprise project. This field is not returned in a non-op_service scenario.

Table 3 Tag

Parameter

Type

Description

key

String

Key.

It consists of up to 36 characters.

It cannot be an empty string.

Spaces before and after a key will be deprecated.

It cannot contain ASCII (0-31) or the following characters: =*<>,|/

It can contain only Chinese characters, letters, digits, hyphens, and underscores.

value

String

Value.

The value of this parameter is mandatory when a tag is added and optional when a tag is deleted.

It consists of up to 43 characters.

It can be an empty string.

Spaces before and after a value will be deprecated.

It cannot contain ASCII (0-31) or the following characters: =*<>,|/

It can contain only Chinese characters, letters, digits, hyphens, and underscores.

Table 4 SysTag

Parameter

Type

Description

key

String

Key. Key of the system tag, which is obtained from the whitelist and cannot be defined randomly. Currently, only the _sys_enterprise_project_id field is supported, and the corresponding value indicates the enterprise project ID.

value

String

Value. Currently, only the enterprise project ID is used. The default enterprise project ID is 0.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

For details, see Error Codes.

error_msg

String

Error message

Example Requests

None

Example Responses

None

Status Codes

Status Code

Description

200

OK

400

Bad Request

Error Codes

See Error Codes.