Chuyển tới nội dung chính

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.

Request​

Tham số​

security_group_idstringbắt buộcpath

ID của security group.

security_groupobjectbắt buộcbody

Object bọc security group.

2 trường
namestringbắt buộcbody

Tên mới.

descriptionstringbody

Mô 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 - OKSecurity group đã được cập nhật.

Lỗi​

MãMô tả
400 - Bad RequestBody không hợp lệ.
401 - UnauthorizedCần xác thực trước khi gửi request.
403 - ForbiddenPolicy không cho phép user hiện tại thực hiện thao tác này.
404 - Not FoundSecurity 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.