Updated on 2022-09-19 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

Project ID.

instance_id

Yes

String

Instance ID.

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

tags

Array of ResourceTag objects

Tag list.

Table 3 ResourceTag

Parameter

Type

Description

key

String

Tag key.

  • This field cannot be left blank.
  • The key value of a resource must be unique.
  • The tag key can contain a maximum of 36 characters.
  • The tag key must be unique and cannot be empty.

value

String

Tag value.

  • This parameter is mandatory when action is set to create and is optional when action is set to delete.
  • The tag value can contain a maximum of 43 characters.

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 Codes

Status Code

Description

200

Instance tags queried successfully.

Error Codes

See Error Codes.