Updated on 2025-12-29 GMT+08:00

Querying Tags of a DCS Instance

Function

This API is used to query the tags of an instance by its instance ID.

URI

GET /v2/{project_id}/instances/{instance_id}/tags

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition:

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

Constraints:

N/A

Range:

N/A

Default Value:

N/A

instance_id

Yes

String

Definition:

Instance ID. It can be viewed on the instance details page on the DCS console.

Constraints:

N/A

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 QueryResourceTag objects

Definition:

Tag list.

Table 3 QueryResourceTag

Parameter

Type

Description

key

String

Definition:

Tag key.

Range:

N/A

value

String

Definition:

Tag 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: 401

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.

Status code: 403

Table 6 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: 404

Table 7 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 8 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

GET https://{dcs_endpoint}/v2/{project_id}/instances/{instance_id}/tags

Example Responses

Status code: 200

Instance tags queried successfully.

{
  "tags" : [ {
    "value" : "a",
    "key" : "1"
  }, {
    "value" : "b",
    "key" : "2"
  } ]
}

Status code: 400

Invalid request.

{
  "error_code" : "DCS.4005",
  "error_msg" : "The message body contains invalid characters or is not in JSON format."
}

Status Codes

Status Code

Description

200

Instance tags queried successfully.

400

Invalid request.

401

Authentication failed.

403

Request rejected.

404

Incorrect path.

500

Internal error.

Error Codes

See Error Codes.