获取可供负载均衡器服务器组添加的云主机网卡(GetCandidateVmNicsForLoadBalancerServerGroup)
API请求
URLs
GET zstack/v1/load-balancers/servergroups/candidate-nicsHeaders
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/load-balancers/servergroups/candidate-nics?servergroupUuid=8e19c3c1227635b39799ff85cd2e01b4&loadBalancerUuid=786271b7eea63f0785ed67e3a36bfe35参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| servergroupUuid (可选) | String | query | 4.0.0 | ||
| loadBalancerUuid (可选) | String | query | 负载均衡器UUID | 4.0.0 | |
| systemTags (可选) | List | query | 系统标签 | 4.0.0 | |
| userTags (可选) | List | query | 用户标签 | 4.0.0 | |
| ipVersion (可选) | Integer | query |
|
5.1.0 |
API返回
返回示例
{
"inventories": [
{
"uuid": "798c7b209b34303aa9a48593594bccee",
"vmInstanceUuid": "c158c92bdda63bbb97c8dea6d284350a",
"usedIpUuid": "702b0b20aebe3d4a880abe851940462d",
"l3NetworkUuid": "a1cebc14f5b236578049889964686822",
"ip": "192.168.1.10",
"mac": "00:0c:29:bd:99:fc",
"hypervisorType": "KVM",
"netmask": "255.255.255.0",
"gateway": "192.168.1.1",
"deviceId": 0.0,
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 4.0.0 |
| inventories | List | 详情参考inventories | 4.0.0 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 4.0.0 |
| description | String | 错误的概要描述 | 4.0.0 |
| details | String | 错误的详细信息 | 4.0.0 |
| elaboration | String | 保留字段,默认为null | 4.0.0 |
| opaque | LinkedHashMap | 保留字段,默认为null | 4.0.0 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 4.0.0 |
#inventories
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 4.0.0 |
| vmInstanceUuid | String | 云主机UUID | 4.0.0 |
| l3NetworkUuid | String | 三层网络UUID | 4.0.0 |
| ip | String | IP地址 | 4.0.0 |
| mac | String | MAC地址 | 4.0.0 |
| hypervisorType | String | 虚拟化类型 | 4.0.0 |
| netmask | String | 子网掩码 | 4.0.0 |
| gateway | String | 网关 | 4.0.0 |
| metaData | String | 4.0.0 | |
| ipVersion | Integer | IP地址版本 | 4.0.0 |
| deviceId | Integer | 设备ID | 4.0.0 |
| type | String | 网卡类型 | 4.0.0 |
| createDate | Timestamp | 创建时间 | 4.0.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 4.0.0 |
| usedIps | List | 详情参考usedIps | 4.0.0 |
#usedIps
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 4.0.0 |
| ipRangeUuid | String | IP段UUID | 4.0.0 |
| l3NetworkUuid | String | 三层网络UUID | 4.0.0 |
| ipVersion | Integer | IP协议号 | 4.0.0 |
| ip | String | IP地址 | 4.0.0 |
| netmask | String | 网络掩码 | 4.0.0 |
| gateway | String | 网关地址 | 4.0.0 |
| usedFor | String | 4.0.0 | |
| ipInLong | long | 4.0.0 | |
| vmNicUuid | String | 云主机网卡UUID | 4.0.0 |
| createDate | Timestamp | 创建时间 | 4.0.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 4.0.0 |
SDK示例
Java
SDK
GetCandidateVmNicsForLoadBalancerServerGroupAction action = new GetCandidateVmNicsForLoadBalancerServerGroupAction();
action.servergroupUuid = "8e19c3c1227635b39799ff85cd2e01b4";
action.loadBalancerUuid = "786271b7eea63f0785ed67e3a36bfe35";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetCandidateVmNicsForLoadBalancerServerGroupAction.Result res = action.call();Python
SDK
GetCandidateVmNicsForLoadBalancerServerGroupAction action = GetCandidateVmNicsForLoadBalancerServerGroupAction()
action.servergroupUuid = "8e19c3c1227635b39799ff85cd2e01b4"
action.loadBalancerUuid = "786271b7eea63f0785ed67e3a36bfe35"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetCandidateVmNicsForLoadBalancerServerGroupAction.Result res = action.call()