接口功能介绍
查看某个子网已使用IP
接口约束
URI
GET /v4/vpc/list-used-ips
请求参数
Query 参数
参数 | 参数类型 | 是否必填 | 说明 | 示例 |
---|---|---|---|---|
regionID | String | 是 | 资源池 ID | 81f7728662dd11ec810800155d307d5b |
subnetID | String | 是 | 子网 ID | port-dasgdwevf |
ip | String | 否 | 子网内的 IP 地址 | 192.168.0.1 |
pageNumber | Integer | 否 | 列表的页码,默认值为 1。 | 1 |
pageNo | Integer | 否 | 列表的页码,默认值为 1, 推荐使用该字段, pageNumber 后续会废弃 | 1 |
pageSize | Integer | 否 | 分页查询时每页的行数,最大值为 50,默认值为 10。 | 5 |
响应参数
参数 | 参数类型 | 说明 | 示例 |
---|---|---|---|
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
参数 | 参数类型 | 说明 | 示例 |
---|---|---|---|
usedIPs | Array of Objects | 已使用的 IP 数组 | 见下表 |
totalCount | Integer | 列表条目数 | 20 |
currentCount | Integer | 分页查询时每页的行数。 | 4 |
totalPage | Integer | 总页数 | 5 |
表 usedIPs
参数 | 参数类型 | 说明 | 示例 |
---|---|---|---|
ipv4Address | String | ipv4 地址 | 172.16.0.2 |
ipv6Address | String | ipv6 地址 | fe80::f816:3eff:fe91:d0fe |
use | String | 用途:instance, pm_instance, vip, load_balance_rules, snat, ip_occupy, network:router_interface, system| instance | |
useDesc | String | 用途中文描述:云主机, 裸金属, 高可用虚 IP, SNAT, 负载均衡, 预占内网 IP, 内网网关接口, system | 云主机 |
请求示例
GET /v4/vpc/list-used-ips?regionID=81f7728662dd11ec810800155d307d5b&subnetID=subnet-p9wdqcm8er&pageSize=15
请求体Body
无
响应示例
{
"statusCode": 800,
"errorCode": "SUCCESS",
"message": "success",
"description": "成功",
"returnObj": {
"usedIPs": [
{
"ipv4Address": "172.16.0.1",
"ipv6Address": "fe80::f816:3eff:fe5b:bdea",
"use": "ip_occupy",
"useDesc": "预占内网 IP"
},
{
"ipv4Address": "172.16.0.2",
"ipv6Address": "fe80::f816:3eff:fe91:d0fe",
"use": "ip_occupy",
"useDesc": "预占内网 IP"
},
{
"ipv4Address": "172.16.0.3",
"ipv6Address": "",
"use": "instance",
"useDesc": "云主机"
},
{
"ipv4Address": "172.16.0.4",
"ipv6Address": "",
"use": "instance",
"useDesc": "云主机"
},
{
"ipv4Address": "172.16.0.5",
"ipv6Address": "",
"use": "instance",
"useDesc": "云主机"
},
{
"ipv4Address": "172.16.0.6",
"ipv6Address": "",
"use": "instance",
"useDesc": "云主机"
},
{
"ipv4Address": "172.16.0.9",
"ipv6Address": "",
"use": "ip_occupy",
"useDesc": "预占内网 IP"
},
{
"ipv4Address": "172.16.0.10",
"ipv6Address": "",
"use": "ip_occupy",
"useDesc": "预占内网 IP"
},
{
"ipv4Address": "172.16.0.8",
"ipv6Address": "",
"use": "instance",
"useDesc": "云主机"
},
{
"ipv4Address": "172.16.0.14",
"ipv6Address": "",
"use": "ip_occupy",
"useDesc": "预占内网 IP"
},
{
"ipv4Address": "172.16.0.16",
"ipv6Address": "",
"use": "instance",
"useDesc": "云主机"
},
{
"ipv4Address": "172.16.0.17",
"ipv6Address": "",
"use": "load_balance_rules",
"useDesc": "负载均衡"
},
{
"ipv4Address": "172.16.0.7",
"ipv6Address": "",
"use": "load_balance_rules",
"useDesc": "负载均衡"
},
{
"ipv4Address": "172.16.0.11",
"ipv6Address": "",
"use": "instance",
"useDesc": "云主机"
},
{
"ipv4Address": "172.16.0.13",
"ipv6Address": "",
"use": "instance",
"useDesc": "云主机"
}
],
"totalCount": 31,
"currentCount": 15,
"totalPage": 3
}
}
状态码
状态码 | 描述 |
---|---|
200 | 表示请求成功。 |
错误码
请参考 错误码说明。