查询安全组列表
1. 接口描述
调用 DescribeSecurityGroupList 接口查询指定地域已创建的安全组列表。
2. 请求参数
名称 | 类型 | 是否必选 | 描述 |
---|---|---|---|
Action | String | 是 | 操作动作,固定取值:DescribeSecurityGroupList |
RegionCode | String | 是 | 资源所在地域 |
Field | String | 否 | 指定查询列,可选值为"securityGroupUUID"或"securityGroupName" |
Keyword | String | 否 | 指定查询关键字 |
PageNumber | Integer | 否 | 页码 |
PageSize | Integer | 否 | 每页条数 |
2. 返回数据
名称 | 类型 | 说明 |
---|---|---|
SecurityGroupList | List[ SecurityGroupInfo ] | 安全组信息列表 |
RequestId | String | 请求ID |
Amount | Integer | 安全组列表总数 |
4. 示例
请求示例
https://openapi.kaopuyun.com/?AccessKeyId=sz0000ei53aw
&Action=DescribeSecurityGroupList
&Format=JSON
&RegionCode=cn-fuzhou-5
&Field=securityGroupUUID
&Keyword=sg-sdjkadw456451
&SignatureMethod=HMAC-SHA1
&SignatureNonce=76a5d5e7-0992-462d-9a26-916650eca00f
&SignatureVersion=1.0
&Timestamp=2023-03-09T07%3A33%3A56Z
&Version=2014-05-26
&Signature=LH5UYKO7k%2FeQlyLH3p169uyRKyU%3D
&PageNumber=1
&PageSize=10
正常返回示例
{
"SecurityGroupList": [
{
"RuleInfoList": [
{
"SecurityGroupRuleUuid": "rul-dg0000025ush",
"SecurityGroupRulePendingStatus": "NONE",
"CreateTime": "2024-09-29 18:04:32",
"SecurityGroupRuleStatus": "AVAILABLE",
"UpdateTime": "2024-09-29 18:04:34",
"IpProtocol": "ALL",
"SecurityGroupUUID": "sg-dg0000025usd",
"RuleDirection": "OUT",
"AuthorizObject": "0.0.0.0/0",
"Remark": "预设规则"
},
{
"SecurityGroupRuleUuid": "rul-dg0000025usi",
"SecurityGroupRulePendingStatus": "NONE",
"CreateTime": "2024-09-29 18:04:32",
"SecurityGroupRuleStatus": "AVAILABLE",
"UpdateTime": "2024-09-29 18:04:34",
"IpProtocol": "ICMP",
"SecurityGroupUUID": "sg-dg0000025usd",
"RuleDirection": "IN",
"AuthorizObject": "0.0.0.0/0",
"Remark": "预设规则"
},
{
"Policy": "3389/3389",
"PortRange": "3389/3389",
"SecurityGroupRuleUuid": "rul-dg0000025usj",
"SecurityGroupRulePendingStatus": "NONE",
"CreateTime": "2024-09-29 18:04:32",
"SecurityGroupRuleStatus": "AVAILABLE",
"UpdateTime": "2024-09-29 18:04:34",
"IpProtocol": "TCP",
"SecurityGroupUUID": "sg-dg0000025usd",
"RuleDirection": "IN",
"AuthorizObject": "0.0.0.0/0",
"Remark": "预设规则"
},
{
"Policy": "22/22",
"PortRange": "22/22",
"SecurityGroupRuleUuid": "rul-dg0000025usk",
"SecurityGroupRulePendingStatus": "NONE",
"CreateTime": "2024-09-29 18:04:33",
"SecurityGroupRuleStatus": "AVAILABLE",
"UpdateTime": "2024-09-29 18:04:34",
"IpProtocol": "TCP",
"SecurityGroupUUID": "sg-dg0000025usd",
"RuleDirection": "IN",
"AuthorizObject": "0.0.0.0/0",
"Remark": "预设规则"
},
{
"Policy": "443/443",
"PortRange": "443/443",
"SecurityGroupRuleUuid": "rul-dg0000025usl",
"SecurityGroupRulePendingStatus": "NONE",
"CreateTime": "2024-09-29 18:04:33",
"SecurityGroupRuleStatus": "AVAILABLE",
"UpdateTime": "2024-09-29 18:04:34",
"IpProtocol": "TCP",
"SecurityGroupUUID": "sg-dg0000025usd",
"RuleDirection": "IN",
"AuthorizObject": "0.0.0.0/0",
"Remark": "预设规则"
},
{
"Policy": "80/80",
"PortRange": "80/80",
"SecurityGroupRuleUuid": "rul-dg0000025usm",
"SecurityGroupRulePendingStatus": "NONE",
"CreateTime": "2024-09-29 18:04:33",
"SecurityGroupRuleStatus": "AVAILABLE",
"UpdateTime": "2024-09-29 18:04:34",
"IpProtocol": "TCP",
"SecurityGroupUUID": "sg-dg0000025usd",
"RuleDirection": "IN",
"AuthorizObject": "0.0.0.0/0",
"Remark": "预设规则"
},
{
"Policy": "5432/5432",
"PortRange": "5432/5432",
"SecurityGroupRuleUuid": "rul-dg0000025usn",
"SecurityGroupRulePendingStatus": "NONE",
"CreateTime": "2024-09-29 18:04:33",
"SecurityGroupRuleStatus": "AVAILABLE",
"UpdateTime": "2024-09-29 18:04:34",
"IpProtocol": "TCP",
"SecurityGroupUUID": "sg-dg0000025usd",
"RuleDirection": "IN",
"AuthorizObject": "2.2.2.2/24",
"Remark": "PostgerSQL"
},
{
"Policy": "1433/1433",
"PortRange": "1433/1433",
"SecurityGroupRuleUuid": "rul-dg0000025uso",
"SecurityGroupRulePendingStatus": "NONE",
"CreateTime": "2024-09-29 18:04:34",
"SecurityGroupRuleStatus": "AVAILABLE",
"UpdateTime": "2024-09-29 18:04:34",
"IpProtocol": "TCP",
"SecurityGroupUUID": "sg-dg0000025usd",
"RuleDirection": "IN",
"AuthorizObject": "2.2.2.2/24",
"Remark": "MS SQL"
},
{
"Policy": "3306/3306",
"PortRange": "3306/3306",
"SecurityGroupRuleUuid": "rul-dg0000025usp",
"SecurityGroupRulePendingStatus": "NONE",
"CreateTime": "2024-09-29 18:04:34",
"SecurityGroupRuleStatus": "AVAILABLE",
"UpdateTime": "2024-09-29 18:04:34",
"IpProtocol": "TCP",
"SecurityGroupUUID": "sg-dg0000025usd",
"RuleDirection": "IN",
"AuthorizObject": "2.2.2.2/24",
"Remark": "MySQL"
},
{
"Policy": "80/80",
"PortRange": "80/80",
"SecurityGroupRuleUuid": "rul-dg0000025usq",
"SecurityGroupRulePendingStatus": "NONE",
"CreateTime": "2024-09-29 18:04:34",
"SecurityGroupRuleStatus": "AVAILABLE",
"UpdateTime": "2024-09-29 18:04:34",
"IpProtocol": "TCP",
"SecurityGroupUUID": "sg-dg0000025usd",
"RuleDirection": "IN",
"AuthorizObject": "2.2.2.2/24",
"Remark": "HTTP"
}
],
"BindIpAllowance": 100,
"SecurityGroupName": "test",
"RegionCode": "cn-dev-1",
"RegionName": "测试十区",
"CreateTime": "2024-09-29 18:04:30",
"RuleNumber": 10,
"SecurityGroupUUID": "sg-dg0000025usd",
"EcsNumber": 0
}
],
"RequestId": "866c9340-7ece-11ef-a820-aa0281f49de7",
"Amount": 11
}
5. 错误码
错误码 | 错误信息 |
---|---|
MissingParameter | RegionCode参数不能为空 |
InvalidPageNumber | 分页数错误 |
InvalidPageSize | 每页数量错误 |
AvailableRegionNotFound | 可用的地域未找到 |
DescribeSecurityGroupListFailed | 查询安全组列表失败:xxx |