分布式端口组相关接口
查询IP地址
Headers
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/l3-networks/ip-addresscurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/l3-networks/ip-address/87b2ab50f6c13ebb9dd73ca46bb22bc7可查询字段
运行CLI命令行工具,输入QueryIpAddress并按Tab键查看所有可查询字段以及可跨表查询的资源名。
API返回
返回示例
{
"inventories": [
{
"uuid": "3ccfbfd6bd483a5eaeabed00b284f4fc",
"ipRangeUuid": "1b3a29978ea73f0db4ce8d8c2d0bd479",
"l3NetworkUuid": "c11b366475f836078e5aa86469de2eef",
"ipVersion": 4.0,
"ip": "192.168.1.100",
"netmask": "255.255.255.0",
"gateway": "192.168.1.1",
"ipInLong": 0.0,
"vmNicUuid": "28e22f67b2893b208547333dfef7cfa8"
}
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考errot | 3.1.0 |
| inventories | List | 详情参考inventories | 3.1.0 |
error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 3.1.0 |
| description | String | 错误的概要描述 | 3.1.0 |
| details | String | 错误的详细信息 | 3.1.0 |
| elaboration | String | 保留字段,默认为null | 3.1.0 |
| opaque | LinkedHashMap | 保留字段,默认为null | 3.1.0 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 3.1.0 |
inventories
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.1.0 |
| ipRangeUuid | String | IP段UUID | 3.1.0 |
| l3NetworkUuid | String | 分布式端口组UUID | 3.1.0 |
| ipVersion | Integer | IP协议号 | 3.1.0 |
| ip | String | IP地址 | 3.1.0 |
| netmask | String | 网络掩码 | 3.1.0 |
| gateway | String | 网关地址 | 3.1.0 |
| usedFor | String | 3.1.0 | |
| ipInLong | long | 3.1.0 | |
| vmNicUuid | String | 虚拟机网卡UUID | 3.1.0 |
| createDate | Timestamp | 创建时间 | 3.1.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.1.0 |
SDK示例
Java SDK
QueryIpAddressAction action = new QueryIpAddressAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryIpAddressAction.Result res = action.call();Python SDK
QueryIpAddressAction action = QueryIpAddressAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryIpAddressAction.Result res = action.call()