接口功能介绍
查询用户安全组列表。
接口约束
无
URI
GET /v4/vpc/new-query-security-groups
请求参数
Query 参数
参数 | 参数类型 | 是否必填 | 示例 | 说明 |
---|---|---|---|---|
regionID | String | 是 | 区域id | |
vpcID | String | 否 | 安全组所在的专有网络ID。 | |
queryContent | String | 否 | 【模糊查询】 安全组ID或名称 | |
instanceID | String | 否 | 实例 ID | |
pageNumber | Integer | 否 | 列表的页码,默认值为 1。 | 1 |
pageNo | Integer | 否 | 列表的页码,默认值为 1, 推荐使用该字段, pageNumber 后续会废弃 | 1 |
pageSize | Integer | 否 | 分页查询时每页的行数,最大值为 50,默认值为 10。 | 10 |
响应参数
参数 | 参数类型 | 说明 | 示例 |
---|---|---|---|
statusCode | Integer | 返回状态码(800为成功,900为失败) | 800 |
message | String | statusCode为900时的错误信息; statusCode为800时为success, 英文 | success |
description | String | statusCode为900时的错误信息; statusCode为800时为成功, 中文 | 成功 |
errorCode | String | statusCode为900时为业务细分错误码,三段式:product.module.code; statusCode为800时为SUCCESS | SUCCESS |
returnObj | Object | 返回结果 | 见下表 |
表 returnObj
参数 | 参数类型 | 说明 | 示例 |
---|---|---|---|
securityGroups | Array of Objects | 安全组列表 | 见下表 |
totalCount | Integer | 列表条目数 | 20 |
currentCount | Integer | 分页查询时每页的行数。 | 4 |
totalPage | Integer | 总页数 | 5 |
表 securityGroups
参数 | 参数类型 | 说明 | 示例 |
---|---|---|---|
securityGroupName | String | 安全组名称 | Default-Security-Group |
id | String | 安全组id | 4fc90292-5ab4-59bb-xxxx-8b9410df41f5 |
vmNum | String | 相关云主机 | 10 |
origin | String | 表示是否是默认安全组 | default |
vpcName | String | vpc名称 | vpc-pm0628 |
vpcID | String | 安全组所属的专有网络。 | 86fff760-d78c-xxxx-8730-9c04c932eefd |
creationTime | String | 创建时间 | 2022-06-28T12:19:43Z |
description | String | 安全组描述信息。 | dasfsdf |
securityGroupRuleList | Array of Objects | 安全组规则信息 | object |
表 securityGroupRuleList
参数 | 参数类型 | 说明 | 示例 |
---|---|---|---|
direction | String | 出方向-egress、入方向-ingress | egress |
priority | Integer | 优先级:0~100 | 100 |
ethertype | String | IP类型:IPv4、IPv6 | IPv4 |
protocol | String | 协议: ANY、TCP、UDP、ICMP、ICMP6 | ANY |
range | String | 接口范围/ICMP类型:1-65535 | 20-30 |
destCidrIp | String | 远端地址:0.0.0.0/0 | 0.0.0.0/0 |
description | String | 安全组规则描述信息。 | 出方向 |
createTime | String | 创建时间,UTC时间。 | 2022-06-28T20:19:43Z |
id | String | 唯一标识ID | 6135ab21-84f6-xxxx-89aa-a654f01389d6 |
securityGroupID | String | 安全组ID | 4fc90292-5ab4-59bb-xxxx-8b9410df41f5 |
action | String | 拒绝策略:允许-accept 拒绝-drop | |
orgin | String | 类型 | |
remoteSecurityGroupID | String | 远端安全组id | |
prefixListID | String | 前缀列表id |
请求示例
GET /v4/vpc/new-query-security-groups?regionID=xxx
请求体Body
无
响应示例
{
"statusCode": 800,
"errorCode": "SUCCESS",
"message": "success",
"description": "成功",
"returnObj": [
{
"securityGroupName": "Default-Security-Group",
"id": "sg-8hikg37xjs",
"vmNum": 0,
"origin": "0",
"vpcName": "vpc-yf-openapi",
"vpcID": "vpc-3piveayzqx",
"creationTime": "2022-10-11T06:53:52Z",
"description": "",
"securityGroupRuleList": [
{
"direction": "egress",
"priority": 100,
"ethertype": "IPv4",
"protocol": "ANY",
"range": "1-65535",
"destCidrIp": "0.0.0.0/0",
"description": "",
"origin": "user",
"createTime": "2022-10-11T14:53:52Z",
"id": "sgrule-g2v16hdklm",
"action": "accept",
"securityGroupID": "sg-8hikg37xjs",
"remoteSecurityGroupID": "",
"prefixListID": ""
},
{
"direction": "egress",
"priority": 100,
"ethertype": "IPv6",
"protocol": "ANY",
"range": "1-65535",
"destCidrIp": "::/0",
"description": "",
"origin": "user",
"createTime": "2022-10-11T14:53:52Z",
"id": "sgrule-a0rwrecd04",
"action": "accept",
"securityGroupID": "sg-8hikg37xjs"
},
{
"direction": "ingress",
"priority": 99,
"ethertype": "IPv4",
"protocol": "ICMP",
"range": "1-65535",
"destCidrIp": "0.0.0.0/0",
"description": "",
"origin": "user",
"createTime": "2022-10-11T14:53:52Z",
"id": "sgrule-r3jwcp5n4p",
"action": "accept",
"securityGroupID": "sg-8hikg37xjs",
"remoteSecurityGroupID": "",
"prefixListID": ""
},
{
"direction": "ingress",
"priority": 99,
"ethertype": "IPv4",
"protocol": "TCP",
"range": "3389",
"destCidrIp": "0.0.0.0/0",
"description": "",
"origin": "user",
"createTime": "2022-10-11T14:53:52Z",
"id": "sgrule-70zg4a497q",
"action": "accept",
"securityGroupID": "sg-8hikg37xjs",
"remoteSecurityGroupID": "",
"prefixListID": ""
}
]
},
],
"currentCount": 10,
"totalCount": 74,
"totalPage": 8
}
状态码
请参考状态码说明。
错误码
请参考错误码说明。