Updated on 2024-11-06 GMT+08:00

Adding or Deleting Tags in Batches

Function

This API is used to add or delete tags in batches for a DCS instance.

This API is available only in the AP-Singapore region.

URI

POST /v1.0/{project_id}/dcs/{instance_id}/tags/action

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

instance_id

Yes

String

Instance ID.

Example

Post https://{dcs_endpoint}/v1.0/{project_id}/dcs/{instance_id}/tags/action

Request

Request parameters

Table 1 Request

Parameter

Mandatory

Type

Description

action

Yes

String

Operation to be performed. The value can be create or delete only.

tags

Yes

Array of objects

List of tags. For details, see Table 2.

Table 2 tags parameters

Parameter

Mandatory

Type

Description

key

Yes

String

Tag key, which

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

value

No

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

{
    "action": "create",
    "tags": [
        {
            "key": "dcs001",
            "value": "002"
        },
        {
            "key": "dcs003",
            "value": "004"
        }
]
}

Response parameters

None

Return Value

Return Value

Description

200

Tags added/deleted successfully.

Error Codes

None