You can call this operation to query whether a specified security group is authorized by other security groups.

Description

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

  • Security group authorization includes authorization for inbound and outbound traffic rules.
  • A maximum of 100 authorization entries can be returned each time.
  • When you fail to delete a security group (DeleteSecurityGroup), you can call this operation to query whether the specified security group has been authorized by other security groups. If the security group is authorized by other security groups, you must revoke the authorization before the security group can be deleted.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
RegionId String Yes cn-hangzhou

The ID of the region to which the security group belongs.

SecurityGroupId.N RepeatList Yes sg-securitygroupid1

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

Action String No DescribeSecurityGroupReferences

The operation that you want to perform. Set the value to DescribeSecurityGroupReferences.

OwnerAccount String No ECSforCloud@Alibaba.com

The logon name of a RAM user.

Response parameters

Parameter Type Example Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

SecurityGroupReferences Array

An array consisting of SecurityGroupReference data.

SecurityGroupReference

The information about references between security groups.

ReferencingSecurityGroups Array

An array consisting of ReferencingSecurityGroup data.

ReferencingSecurityGroup

The information of other security groups referencing this security group.

AliUid String 1557809237**

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

SecurityGroupId String sg-bp67acfmxazb4ph***

The ID of the security group.

SecurityGroupId String sg-bp67acfmxazb4pj***

The ID of the queried security group.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=DescribeSecurityGroupReferences
&RegionId=cn-hangzhou
&SecurityGroupId.1=sg-bp67acfmxazb4ph***
&<Common request parameters>

Sample success responses

XML format

<DescribeSecurityGroupReferencesResponse>
      <RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
      <SecurityGroupReferences>
          <SecurityGroupReference>
              <SecurityGroupId>sg-bp67acfmxazb4ph***</SecurityGroupId>
              <ReferencingSecurityGroups>
                  <ReferencingSecurityGroup>
                      <SecurityGroupId>sg-bp67acfmxazb4pi***</SecurityGroupId>
                      <AliUid>15578092****</AliUid>
                  </ReferencingSecurityGroup>
                  <ReferencingSecurityGroup>
                      <SecurityGroupId>sg-bp67acfmxazb4pj***</SecurityGroupId>
                      <AliUid>15578092****</AliUid>
                  </ReferencingSecurityGroup>
              </ReferencingSecurityGroups>
          </SecurityGroupReference>
      </SecurityGroupReferences>
</DescribeSecurityGroupReferencesResponse>

JSON format

{
	"RequestId":"CEF72CEB-54B6-4AE8-B225-F876FF7BA984",
	"SecurityGroupReferences":[
		{
			"SecurityReferencingGroups":[
				{
					"SecurityGroupId":"sg-bp67acfmxazb4ph***",
					"AliUid":"1557809237**"
				},
				{
					"SecurityGroupId":"sg-bp67acfmxazb4ph***",
					"AliUid":"1557809237**"
				}
			],
			"SecurityGroupId":"sg-bp67acfmxazb4ph***",
		}
	]
}

Error codes

HTTP status code Error code Error message Description
400 InvalidSecurityGroupId.Malformed The specified parameter SecurityGroupId is essential and size should less than 10 The error message returned because the specified SecurityGroupId parameter is invalid.
404 InvalidSecurityGroupId.NotFound The SecurityGroupId provided does not exist in our records. The error message returned because the specified SecurityGroupId parameter does not exist under this account. Check whether the security group ID is correct.

For a list of error codes, visit the API Error Center.