Batch Adding Tags to a Security Group
Function
This API is used to add multiple tags to a security group at a time.
The API is idempotent. When you create tags, if there are duplicate keys in the request body, an error is reported. During tag creation, duplicate keys are not allowed. If a key already exists in the database, its value will be overwritten by the new duplicate key.
Constraints
The API is idempotent. When you create tags, if there are duplicate keys in the request body, an error is reported. During tag creation, duplicate keys are not allowed. If a key already exists in the database, its value will be overwritten by the new duplicate key.
URI
POST /v2.0/{project_id}/security-groups/{security_group_id}/tags/action
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID |
security_group_id |
Yes |
String |
Security Group ID |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
action |
Yes |
String |
Operation |
tags |
Yes |
Array of ResourceTag objects |
Tag list |
Response Parameters
Status code: 400
Parameter |
Type |
Description |
---|---|---|
code |
String |
Error code returned for a request. |
message |
String |
Error message returned for a request. |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
code |
String |
Error code returned for a request. |
message |
String |
Error message returned for a request. |
Status code: 403
Parameter |
Type |
Description |
---|---|---|
code |
String |
Error code returned for a request. |
message |
String |
Error message returned for a request. |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
code |
String |
Error code returned for a request. |
message |
String |
Error message returned for a request. |
Status code: 409
Parameter |
Type |
Description |
---|---|---|
code |
String |
Error code returned for a request. |
message |
String |
Error message returned for a request. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
code |
String |
Error code returned for a request. |
message |
String |
Error message returned for a request. |
Example Requests
-
example-1: Deleting a tag
POST https://{Endpoint}/v2.0/{project_id}/security-groups/{security_group_id}/tags/action { "action" : "delete", "tags" : [ { "key" : "key1", "value" : "value1" }, { "key" : "key2", "value" : "value3" } ] }
-
example-2: Creating a tag
POST https://{Endpoint}/v2.0/{project_id}/security-groups/{security_group_id}/tags/action { "action" : "create", "tags" : [ { "key" : "key1", "value" : "value1" }, { "key" : "key2", "value" : "value3" } ] }
Example Responses
None
Status Codes
Status Code |
Description |
---|---|
204 |
Normal response. |
400 |
The server failed to process the request. |
401 |
Username and password are required to access the page requested. |
403 |
You are forbidden to access the requested page. |
404 |
The server could not find the requested page. |
409 |
The request could not be processed due to a conflict. |
500 |
Failed to complete the request because of an internal service 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