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 |
Definition: Project ID. For details, see Obtaining a Project ID. Constraints: N/A Range: N/A Default Value: N/A |
|
instance_id |
Yes |
String |
Definition: Instance ID. It can be viewed on the instance details page on the DCS console. Constraints: N/A Range: N/A Default Value: N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
action |
Yes |
String |
Definition: Operation identifier. Constraints: N/A Range:
Default Value: N/A |
|
tags |
Yes |
Array of ResourceTag objects |
Definition: Tag list. Constraints: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
Yes |
String |
Definition: Tag key. Constraints:
Range: N/A Default Value: N/A |
|
value |
No |
String |
Definition: Tag value. Constraints:
Range: N/A Default Value: N/A |
Response Parameters
Status code: 204
Tags added or deleted successfully.
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
Parameter description: Error message. Value range: N/A. |
|
error_code |
String |
Parameter description: Error code. Value range: For details, see Error Codes. |
|
error_ext_msg |
String |
Parameter description: Extended error information. This parameter is not used currently and is set to null. Value range: N/A. |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
Parameter description: Error message. Value range: N/A. |
|
error_code |
String |
Parameter description: Error code. Value range: For details, see Error Codes. |
|
error_ext_msg |
String |
Parameter description: Extended error information. This parameter is not used currently and is set to null. Value range: N/A. |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
Parameter description: Error message. Value range: N/A. |
|
error_code |
String |
Parameter description: Error code. Value range: For details, see Error Codes. |
|
error_ext_msg |
String |
Parameter description: Extended error information. This parameter is not used currently and is set to null. Value range: N/A. |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
Parameter description: Error message. Value range: N/A. |
|
error_code |
String |
Parameter description: Error code. Value range: For details, see Error Codes. |
|
error_ext_msg |
String |
Parameter description: Extended error information. This parameter is not used currently and is set to null. Value range: N/A. |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
Parameter description: Error message. Value range: N/A. |
|
error_code |
String |
Parameter description: Error code. Value range: For details, see Error Codes. |
|
error_ext_msg |
String |
Parameter description: Extended error information. This parameter is not used currently and is set to null. Value range: N/A. |
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
Status code: 400
Invalid request.
{
"error_code" : "DCS.4005",
"error_msg" : "The message body contains invalid characters or is not in JSON format."
}
Status Codes
|
Status Code |
Description |
|---|---|
|
204 |
Tags added or deleted successfully. |
|
400 |
Invalid request. |
|
401 |
Authentication failed. |
|
403 |
Request rejected. |
|
404 |
Incorrect path. |
|
500 |
Internal error. |
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot