Adding a Tag to a Security Group
Function
This API is used to create a tag for a security group. The API is idempotent. If a to-be-created tag has the same key as an existing tag, the tag will be created and overwrite the existing one.
Debugging
You can debug this API through automatic authentication in API Explorer.
URI
POST /v2.0/{project_id}/security-groups/{security_group_id}/tags
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID |
|
security_group_id |
Yes |
String |
Security Group ID |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
tag |
Yes |
ResourceTag object |
Request body for creating a security group tag. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
Yes |
String |
|
|
value |
Yes |
String |
|
Response Parameters
Status code: 204
The response to the request is normal. For more status codes, see Status Codes.
None
Example Requests
Creating a Tag for a Security Group
POST https://{Endpoint}/v2.0/{project_id}/security-groups/{security_group_id}/tags
{
"tag" : {
"key" : "key1",
"value" : "value1"
}
}
Example Responses
None
Status Codes
|
Status Code |
Description |
|---|---|
|
204 |
The response to the request is normal. For more status codes, see Status Codes. |
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