Skip to main content

Delete Security Group

DELETE/v2.0/security-groups/{security_group_id}

Deletes a security group together with its rules. The group must not be attached to any port.

Request​

Parameters​

security_group_idstringrequired

The ID of the security group.

Sample Request​

curl -ks -X DELETE -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
https://api.vietnix.cloud:9696/v2.0/security-groups/{security_group_id}

Response​

Status Code​

Success​

Status CodeDescription
204 - No ContentThe security group was deleted.

Error​

Status CodeDescription
401 - UnauthorizedUser must authenticate before making a request.
403 - ForbiddenPolicy does not allow current user to do this operation, or the group is the default group of the project.
404 - Not FoundThe security group does not exist.
409 - ConflictThe group is still attached to a port.
note

To delete a group that is in use, first move its ports to another group, or delete the VMs that own those ports. The default group cannot be deleted.