Batch Adding or Deleting Tags
Function
This API is used to add or delete tags in batches for a DCS instance.
Calling Method
For details, see Calling APIs.
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
Status code: 204
Tags added or deleted successfully.
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.