DescribeSecurityGroupAttribute

Last Updated: Mar 28, 2018

Description

Describes one of your security groups.

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: DescribeSecurityGroupAttribute.
RegionId String Yes The ID of the region to which the security group belongs.
SecurityGroupId String Yes The security group ID.
NicType String No The network interface type. Optional values:
  • internet
  • intranet
Default value: internet.
Direction String No The type of a rule. Optional values:
  • egress: The outbound authorization rules.
  • ingres: The inbound authorization rules.
  • all: Both the outbound and inbound authorization rules.
Default value: all.

Response parameters

Name Type Description
SecurityGroupId String The security group ID.
SecurityGroupName String The security group name.
RegionId String The region ID.
Description String The security group description.
InnerAccessPolicy String Whether the requests from specified clients or security groups are allowed or not. Optional values:
  • Accept: The requests are allowed.
  • Drop: The requests are rejected.
Permissions PermissionType Composed of a PermissionType collection indicates the permission rules in the security group.
VpcId String The VPC ID. If a VpcId is returned, the security group is VPC-Connected. If not, it is a classic network-connected security group.

Examples

Request example

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

Response example

XML format

  1. <DescribeSecurityGroupAttributeResponse>
  2. <RequestId>1651FBB6-4FBF-49FF-A9F5-DF5D696C7EC6</RequestId>
  3. <RegionId>cn-hangzhou</RegionId>
  4. <SecurityGroupId>C0003E8B-B930-4F59-ADC0-0E209A9012B0</SecurityGroupId>
  5. <Description>for demo</Description>
  6. <Permissions>
  7. <Permission>
  8. <IpProtocol>ALL</IpProtocol>
  9. <PortRange>-1/-1</PortRange>
  10. <SourceGroupId>8dsmf982</SourceGroupId>
  11. <SourceGroupOwnerAccount>test@aliyun.com</SourceGroupOwnerAccount>
  12. <Policy>Accept</Policy>
  13. <NicType>intranet</NicType>
  14. </Permission>
  15. <Permission>
  16. <IpProtocol>tcp</IpProtocol>
  17. <PortRange>1/65535</PortRange>
  18. <SourceCidrIp>0.0.0.0/0</SourceCidrIp>
  19. <Policy>accept</Policy>
  20. <NicType>internet</NicType>
  21. </Permission>
  22. </Permissions>
  23. </DescribeSecurityGroupAttributeResponse>

JSON format

  1. {
  2. "RequestId": "1651FBB6-4FBF-49FF-A9F5-DF5D696C7EC6",
  3. "RegionId": "cn-hangzhou",
  4. "SecurityGroupId": "C0003E8B-B930-4F59-ADC0-0E209A9012B0",
  5. "Description": "for demo",
  6. "Permissions": {
  7. "Permission": [{
  8. "IpProtocol": "ALL",
  9. "PortRange": "-1/-1",
  10. "SourceGroupId": "8dsmf982",
  11. "SourceGroupOwnerAccount": "test@aliyun.com"
  12. "Policy": "Accept",
  13. "NicType": "intranet"
  14. },
  15. {
  16. "IpProtocol": "tcp",
  17. "PortRange": "1/65535",
  18. "SourceCidrIp": "0.0.0.0/0",
  19. "Policy": "accept",
  20. "NicType": "internet"
  21. }]
  22. }
  23. }

Error codes

Error code Error message HTTP status code Meaning
InvalidNicType.ValueNotSupported The specified NicType does not exist. 400 The specified NicType does not exist.
InvalidRegionId.NotFound The specified RegionId does not exist. 404 The specified RegionId does not exist.
InvalidSecurityGroupId.NotFound The specified SecurityGroupId does not exist. 404 The specified SecurityGroupId does not exist.
Thank you! We've received your feedback.