DeleteSecurityGroup

Last Updated: Mar 26, 2018

Description

Deletes one of your security groups.

Make sure the security group is not authorized by other security groups (DescribeSecurityGroupReferences) and the security group manages no instance. Otherwise, the DeleteSecurityGroup action fails.

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: DeleteSecurityGroup.
RegionId String Yes The ID of the region to which the security group belongs. For more information, see Regions and zones, or call DescribeRegions to obtain the latest region list.
SecurityGroupId String Yes The security group ID.

Response parameters

All parameters are common response parameters. For more information, see Common parameters.

Examples

Request example

  1. https://ecs.aliyuncs.com/?Action=DeleteSecurityGroup
  2. &RegionId=cn-hangzhou
  3. &SecurityGroupId=sg-F876FF7BA
  4. &<Common Request Parameters>

Response example

XML format

  1. <DeleteSecurityGroupResponse>
  2. <RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
  3. </DeleteSecurityGroupResponse>

JSON format

  1. {
  2. "RequestId":"CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
  3. }

Error codes

Error code Error message HTTP status code Meaning
DependencyViolation There is still instance(s) in the specified security group. 403 The specified security group is managing instances.
DependencyViolation The specified security group has been authorized in another one. 403 The specified security group is authorized by other security groups.
InvalidRegionId.NotFound The specified RegionId does not exist. 404 The specified RegionId does not exist.
Thank you! We've received your feedback.