获取云主机网卡(GetCandidateVmNicsForLoadBalancer)
获取可供负载均衡器添加的云主机网卡。
API请求
URLs
GET zstack/v1/load-balancers/listeners/{listenerUuid}/vm-instances/candidate-nicsHeaders
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth e75a29e482104fd094dde90d69b212c6" \
-X GET http://localhost:8080/zstack/v1/load-balancers/listeners/4fe68eaa71ec47699c19b7819bd52f80/vm-instances/candidate-nics参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| listenerUuid | String | url | 负载均衡监听器UUID | 0.6 | |
| systemTags (可选) | List | query | 系统标签 | 0.6 | |
| userTags (可选) | List | query | 用户标签 | 0.6 |
API返回
返回示例
{
"inventories": [
{
"uuid": "241c356448ea4dfab7e95dd1e52a163d",
"vmInstanceUuid": "5d0f9bee14d94943a4e6ec34c599dc19",
"usedIpUuid": "2974a99c5bc2481cb54759c83fea8f52",
"l3NetworkUuid": "a3dfb2211d6e4d538a73bb3453876654",
"ip": "192.168.1.10",
"mac": "00:0c:29:bd:99:fc",
"netmask": "255.255.255.0",
"gateway": "192.168.1.1",
"deviceId": 0.0,
"createDate": "Jun 7, 2017 9:21:22 PM",
"lastOpDate": "Jun 7, 2017 9:21:22 PM"
}
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 0.6 |
| inventories | List | 详情参考inventories | 0.6 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 0.6 |
| description | String | 错误的概要描述 | 0.6 |
| details | String | 错误的详细信息 | 0.6 |
| elaboration | String | 保留字段,默认为null | 0.6 |
| opaque | LinkedHashMap | 保留字段,默认为null | 0.6 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 0.6 |
#inventories
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 0.6 |
| vmInstanceUuid | String | 云主机UUID | 0.6 |
| l3NetworkUuid | String | 三层网络UUID | 0.6 |
| ip | String | 0.6 | |
| mac | String | 0.6 | |
| netmask | String | 0.6 | |
| gateway | String | 0.6 | |
| metaData | String | 0.6 | |
| deviceId | Integer | 0.6 | |
| createDate | Timestamp | 创建时间 | 0.6 |
| lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
SDK示例
Java
SDK
GetCandidateVmNicsForLoadBalancerAction action = new GetCandidateVmNicsForLoadBalancerAction();
action.listenerUuid = "939a6fd54937468b9b9c27c4d3903c6e";
action.sessionId = "af93732431cf45e7828b579fcb9e46bc";
GetCandidateVmNicsForLoadBalancerAction.Result res = action.call();Python
SDK
GetCandidateVmNicsForLoadBalancerAction action = GetCandidateVmNicsForLoadBalancerAction()
action.listenerUuid = "a100b63272ff460eb0301f5759ff2fce"
action.sessionId = "423e456aac8041aa9bfdf4ce26ab32ce"
GetCandidateVmNicsForLoadBalancerAction.Result res = action.call()