Describes the basic information about your security groups, such as the security group ID and description. We return and display your security groups in a descending order by the security group ID.

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: DescribeSecurityGroups.
RegionId String Yes Regional ID. For more information, call DescribeRegions to obtain the latest region list.
VpcId String No The ID of the VPC to which the security groups belong.
Tag.n.Key  String No The tag key of security groups. The valid range of n is [1, 5]. Once you use this parameter, it cannot be a null string.
Tag.n.Value String No The tag value of security groups. The valid range of n is [1, 5]. Once you use this parameter, it can be a null string.
PageNumber Integer No Displays the security groups on several pages. Initial value: 1.

Default value: 1.

PageSize Integer No The maximum entries on a page. Maximum value: 50.

Default value: 10.

Response parameters

Name Type Description
TotalCount Integer The total number of security groups.
PageNumber Integer Current page number.
PageSize Integer The number of entries on each page.
RegionId String The region ID.
SecurityGroups SecurityGroupItemType The security group information, composed by a SecurityGroupItemType collection.


Request example
&<Common Request Parameters>
Return example

XML format

            <Description>cn-hangzhou test group</Description>
            <Description>cn-hangzhou test group</Description>
JSON format
    "RequestId": "94D38899-626D-434A-891F-7E1F77A81525",
    "TotalCount": 4,
    "PageSize": "10",
    "RegionId": "cn-hangzhou",
    "PageNumber": "1",
    "SecurityGroups": {
        "SecurityGroup": [{
            "SecurityGroupId": "sg-F876FF7BA",
            "Description": "TestByXcf"
            "SecurityGroupId": "sg-086FFC27A",
            "Description": "test00212"
            "SecurityGroupId": "sg-BA4B7975B",
            "Description": "cn-hangzhou test group"
            "SecurityGroupId": "sg-35F20777C",
            "Description": "cn-hangzhou test group"

Error codes

All are common error codes. For more error codes, see API Error Center.