Queries the rules of a security group.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
SecurityGroupId | string | Yes | The ID of the security group. | sg-bp1gxw6bznjjvhu3**** |
RegionId | string | Yes | The region ID of the security group. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
NicType | string | No | The network interface controller (NIC) type of the security group rule.
| intranet |
Direction | string | No | The direction in which the security group rule is applied. Valid values:
Default value: all. | all |
NextToken | string | No | The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken. | AAAAAdDWBF2**** |
MaxResults | integer | No | The maximum number of entries per page.
Default value: 500. | 500 |
Response parameters
Examples
Sample success responses
JSON
format
{
"VpcId": "vpc-bp1opxu1zkhn00gzv****",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"InnerAccessPolicy": "Accept",
"Description": "This is description.",
"SecurityGroupId": "sg-bp1gxw6bznjjvhu3****",
"SecurityGroupName": "SecurityGroupName Sample",
"RegionId": "cn-hangzhou",
"Permissions": {
"Permission": [
{
"SecurityGroupRuleId": "sgr-bp12kewq32dfwrdi****",
"Direction": "ingress",
"SourceGroupId": "sg-bp12kc4rqohaf2js****",
"DestGroupOwnerAccount": "1234567890",
"DestPrefixListId": "pl-x1j1k5ykzqlixabc****",
"DestPrefixListName": "DestPrefixListName Sample",
"SourceCidrIp": "0.0.0.0/0",
"Ipv6DestCidrIp": "2001:db8:1233:1a00::***",
"CreateTime": "2018-12-12T07:28:38Z",
"Ipv6SourceCidrIp": "2001:db8:1234:1a00::***",
"DestGroupId": "sg-bp1czdx84jd88i7v****",
"DestCidrIp": "0.0.0.0/0",
"IpProtocol": "TCP",
"Priority": "1",
"DestGroupName": "testDestGroupName",
"NicType": "intranet",
"Policy": "Accept",
"Description": "Description Sample 01",
"PortRange": "80/80",
"SourcePrefixListName": "SourcePrefixListName Sample",
"SourcePrefixListId": "pl-x1j1k5ykzqlixdcy****",
"SourceGroupOwnerAccount": "1234567890",
"SourceGroupName": "testSourceGroupName1",
"SourcePortRange": "80/80"
}
]
},
"NextToken": "AAAAAdDWBF2****"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidNicType.ValueNotSupported | The specified NicType does not exist. | The specified NicType parameter does not exist. |
400 | InvalidParamter | Invalid Parameter. | The specified parameter is invalid. |
400 | InvalidSecurityGroupId.Malformed | The specified parameter "SecurityGroupId" is not valid. | - |
400 | MissingParameter.RegionId | The parameter "RegionId" should not be null. | - |
404 | InvalidRegionId.NotFound | The specified RegionId does not exist. | The specified region ID does not exist. |
404 | InvalidSecurityGroupId.NotFound | The specified SecurityGroupId does not exist. | The specified security group does not exist in this account. Check whether the security group ID is correct. |
500 | InternalError | The request processing has failed due to some unknown error. | An internal error has occurred. Try again later. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-05-21 | The Error code has changed. The request parameters of the API has changed. The response structure of the API has changed | View Change Details |