DescribeSecurityGroups

Last Updated: Dec 15, 2017

Description

Query by page returns the basic information about all custom security groups. Each page contains 10 entries by default and the data is listed in descending order by security group ID.

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: DescribeSecurityGroups.
RegionId String Yes The region.
VpcId String No The ID of the VPC, where the security group belongs to.
PageNumber Integer No Current page, the start value is 1 and the default value is 1.
PageSize Integer No Sets the number of lines per page for paging query. The maximum value is 50 and default value is 10.

Response parameters

Name Type Description
TotalCount Integer The total number of security groups.
PageNumber Integer The current page.
PageSize Integer The number of lines per page.
RegionId String The region ID of the security group.
SecurityGroups SecurityGroupItemType The security group information, composed by a SecurityGroupItemType collection.

Error codes

Error code Error message HTTP status code Meaning
MissingParameter The input parameter RegionId that is mandatory for processing this request is not supplied. 400 The RegionId parameter is not specified
InvalidParameter The specified parameter PageNumber is not valid. 400 The specified PageNumber parameter is invalid
InvalidParameter The specified parameter PageSize is not valid. 400 The specified PageSize parameter is invalid

Examples

Request example

  1. https://ecs.aliyuncs.com/?Action=DescribeSecurityGroups
  2. &RegionId=cn-hangzhou
  3. &<Common Request Parameters>

Response example

XML format

  1. <DescribeSecurityGroupsResponse>
  2. <RequestId>94D38899-626D-434A-891F-7E1F77A81525</RequestId>
  3. <TotalCount>4</TotalCount>
  4. <PageNumber>1</PageNumber>
  5. <PageSize>10</PageSize>
  6. <RegionId>cn-hangzhou</RegionId>
  7. <SecurityGroups>
  8. <SecurityGroup>
  9. <SecurityGroupId>sg-F876FF7BA</SecurityGroupId>
  10. <Description>Test</Description>
  11. </SecurityGroup>
  12. <SecurityGroup>
  13. <SecurityGroupId>sg-086FFC27A</SecurityGroupId>
  14. <Description>test00212</Description>
  15. </SecurityGroup>
  16. <SecurityGroup>
  17. <SecurityGroupId>sg-BA4B7975B</SecurityGroupId>
  18. <Description>cn-hangzhou test group</Description>
  19. </SecurityGroup>
  20. <SecurityGroup>
  21. <SecurityGroupId>sg-35F20777C</SecurityGroupId>
  22. <Description>cn-hangzhou test group</Description>
  23. </SecurityGroup>
  24. </SecurityGroups>
  25. </DescribeSecurityGroupsResponse>

JSON format

  1. {
  2. "RequestId": "94D38899-626D-434A-891F-7E1F77A81525",
  3. "TotalCount": 4,
  4. "PageSize": "10",
  5. "RegionId": "cn-hangzhou",
  6. "PageNumber": "1",
  7. "SecurityGroups": {
  8. "SecurityGroup": [{
  9. "SecurityGroupId": "sg-F876FF7BA",
  10. "Description": "TestByXcf"
  11. },
  12. {
  13. "SecurityGroupId": "sg-086FFC27A",
  14. "Description": "test00212"
  15. },
  16. {
  17. "SecurityGroupId": "sg-BA4B7975B",
  18. "Description": "cn-hangzhou test group"
  19. },
  20. {
  21. "SecurityGroupId": "sg-35F20777C",
  22. "Description": "cn-hangzhou test group"
  23. }]
  24. }
  25. }
Thank you! We've received your feedback.