All Products
Search
Document Center

Elastic Compute Service:DescribeSecurityGroupReferences

Last Updated:Mar 19, 2024

Checks whether a security group is referenced by the rules of other security groups.

Operation description

When you call this operation, take note of the following items:

  • A security group can be referenced by the inbound or outbound rules of other security groups.
  • Up to 100 entries can be returned each time.
  • If a security group cannot be deleted by calling the DeleteSecurityGroup operation, you can call the DescribeSecurityGroupReferences operation to check whether the security group is referenced by the rules of other security groups. If the security group is referenced by the rules of other security groups, you must remove the reference before you can delete the security group.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the security group.

cn-hangzhou
SecurityGroupIdarrayYes

The ID of security group N. Valid values of N: 1 to 10.

stringYes

The ID of security group N. Valid values of N: 1 to 10.

sg-bp14vtedjtobkvi****

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****
SecurityGroupReferencesobject []

Details about the references to the specified security groups.

SecurityGroupIdstring

The ID of the specified security group.

sg-bp67acfmxazb4p****
ReferencingSecurityGroupsobject []

Details about the security groups whose rules are referencing the specified security groups.

SecurityGroupIdstring

The ID of the security group.

sg-bp67acfmxazb4j****
AliUidstring

The ID of the Alibaba Cloud account to which the security group belongs.

123456****

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "SecurityGroupReferences": {
    "SecurityGroupReference": [
      {
        "SecurityGroupId": "sg-bp67acfmxazb4p****",
        "ReferencingSecurityGroups": {
          "ReferencingSecurityGroup": [
            {
              "SecurityGroupId": "sg-bp67acfmxazb4j****",
              "AliUid": "123456****"
            }
          ]
        }
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidSecurityGroupId.MalformedThe specified parameter SecurityGroupId is essential and size should less than 10The SecurityGroupId.N parameter is required and the value of N cannot exceed 10.
404InvalidRegionId.NotFoundThe RegionId provided does not exist in our records.The RegionId provided does not exist
404InvalidSecurityGroupId.NotFoundThe SecurityGroupId provided does not exist in our records.The specified security group does not exist in this account. Check whether the security group ID is correct.

For a list of error codes, visit the Service error codes.