Cập nhật security group
PUT
/v2.0/security-groups/{security_group_id}Cập nhật tên và mô tả của security group. Rule không thay đổi ở đây; hãy thêm hoặc xoá rule qua các endpoint rule.
info
Nguồn: update-security-group
Request
Tham số
security_group_idstringbắt buộcpathID của security group.
security_groupobjectbắt buộcbodyObject bọc security group.
2 trường
namestringbắt buộcbodyTên mới.
descriptionstringbodyMô tả mới. Mặc định: chuỗi rỗng.
Request mẫu
curl -ks -X PUT -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
-d '{
"security_group": {
"name": "mysecgroup",
"description": "My security group"
}
}' https://api.vietnix.cloud:9696/v2.0/security-groups/{security_group_id}
Response
Response mẫu
Response body
{
"security_group": {
"id": "e7489f02-f846-46f2-9edf-cc5a2640041a",
"name": "mysecgroup",
"description": "My security group",
"stateful": true,
"tenant_id": "f5d834d636c642c7bfe8af86139c6f26",
"project_id": "f5d834d636c642c7bfe8af86139c6f26",
"security_group_rules": [],
"tags": [],
"created_at": "2026-02-11T08:21:14Z",
"updated_at": "2026-02-11T08:31:47Z",
"revision_number": 2
}
}
Mã trạng thái
Thành công
| Mã | Mô tả |
|---|---|
| 200 - OK | Security group đã được cập nhật. |
Lỗi
| Mã | Mô tả |
|---|---|
| 400 - Bad Request | Body không hợp lệ. |
| 401 - Unauthorized | Cần xác thực trước khi gửi request. |
| 403 - Forbidden | Policy không cho phép user hiện tại thực hiện thao tác này. |
| 404 - Not Found | Security group không tồn tại. |
| 409 - Conflict | Đã tồn tại group cùng tên trong project. |
note
Đổi tên group không ảnh hưởng đến các VM đang dùng group: port tham chiếu group theo ID, không theo tên.