Updated on 2022-08-06 GMT+08:00

Querying Tags of a Specified 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 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

instance_id

Yes

String

Instance ID.

Request

None

Response

Example response with status code 200:

Table 2 Response body parameter

Parameter

Type

Description

tags

Array of ResourceTag Objects

List of tags.

Table 3 ResourceTag

Parameter

Type

Description

key

String

Tag key, which:

  • Cannot be left blank.
  • Must be unique.
  • Can contain a maximum of 36 characters.

value

String

Tag value, which:

  • Is mandatory when action is set to create and optional when action is set to delete.
  • Can contain a maximum of 43 characters.

Example Request

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

Example Response

Example response with status code 200:

Instance tags queried successfully.

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

Status Code

Status Code

Description

200

Instance tags queried successfully.

Error Code

See Error Codes.