- APIs V2 (Recommended)
- Tag Management
- Batch Adding or Deleting Tags
Batch Adding or Deleting Tags¶
Function¶
This API is used to add or delete tags in batches for a DCS instance.
URI¶
POST /v2/{project_id}/dcs/{instance_id}/tags/action
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Project ID. For details, see Obtaining a Project ID. |
instance_id | Yes | String | Instance ID. |
Request Parameters¶
Parameter | Mandatory | Type | Description |
---|---|---|---|
action | Yes | String | Operation to be performed. The value can be create or delete. |
tags | Yes | Array of ResourceTag objects | Tag list. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
key | Yes | String | Tag key.
|
value | No | String | Tag value.
|
Response Parameters¶
None
Example Requests¶
Adding tags to a specified resource in batches
POST https://{dcs_endpoint}/v2/7dddae81f0e34f62adb9618bc8c8b1fe/dcs/01928d55-7020-4500-9c29-774caabe4bc4/tags/action { "action" : "create", "tags" : [ { "value" : "2", "key" : "dcs001" }, { "value" : "4", "key" : "dcs003" } ] }
Deleting tags from a specified instance in batches
POST https://{dcs_endpoint}/v2/7dddae81f0e34f62adb9618bc8c8b1fe/dcs/01928d55-7020-4500-9c29-774caabe4bc4/tags/action { "action" : "delete", "tags" : [ { "key" : "key1", "value" : "11" } ] }
Example Responses¶
None
Status Codes¶
Status Code | Description |
---|---|
204 | Tags added or deleted successfully. |
Error Codes¶
See Error Codes.