获取主机交集绑定信息(GetCandidateNetworkBondings)

API请求

URLs
GET zstack/v1/cluster/hosts-network-bondings
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/cluster/hosts-network-bondings?hostUuids=dc20018ed3483aeea38fd742f129a59b&limit=1000&start=0
参数列表
名字 类型 位置 描述 可选值 起始版本
hostUuids List query 主机UUIDs 4.1.0
limit (可选) Integer query 4.1.0
start (可选) Integer query 4.1.0
systemTags (可选) List query 系统标签 4.1.0
userTags (可选) List query 用户标签 4.1.0

API返回

返回示例
{
  "inventories": [
    {
      "uuid": "b8f160bbdb5d392fbcb5720f3509bf0b",
      "hostUuid": "19506ab5300b3e169a616e9e0dd86d33",
      "bondingName": "bond0",
      "mode": "active-backup 1",
      "xmitHashPolicy": "layer2 0",
      "miiStatus": "up",
      "mac": "ac:1f:6b:93:6c:8c",
      "ipAddresses": [
        "172.20.0.116/16"
      ],
      "miimon": 100,
      "type": "LinuxBonding",
      "allSlavesActive": true,
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM",
      "slaves": [
        {
          "uuid": "fac6c85bbb743381a2edcaeb01e3a885",
          "hostUuid": "19506ab5300b3e169a616e9e0dd86d33",
          "bondingUuid": "b8f160bbdb5d392fbcb5720f3509bf0b",
          "interfaceName": "eno1",
          "interfaceType": "bondingSlave",
          "speed": 1000,
          "slaveActive": true,
          "carrierActive": true,
          "mac": "ac:1f:6b:93:6c:8c",
          "createDate": "Nov 14, 2017 10:20:57 PM",
          "lastOpDate": "Nov 14, 2017 10:20:57 PM"
        },
        {
          "uuid": "828ab68794dc31d89aa600a2792a0ac5",
          "hostUuid": "19506ab5300b3e169a616e9e0dd86d33",
          "bondingUuid": "b8f160bbdb5d392fbcb5720f3509bf0b",
          "interfaceName": "eno2",
          "interfaceType": "bondingSlave",
          "speed": 1000,
          "slaveActive": false,
          "carrierActive": false,
          "mac": "ac:1f:6b:93:6c:8c",
          "createDate": "Nov 14, 2017 10:20:57 PM",
          "lastOpDate": "Nov 14, 2017 10:20:57 PM"
        }
      ]
    }
  ]
}
名字 类型 描述 起始版本
success boolean 4.1.0
inventories List 详情参考inventories 4.1.0
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 4.1.0
#inventories
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 4.1.0
hostUuid String 主机UUID 4.1.0
bondingName String Bond名称 4.1.0
bondingType String Bond应用状态,有noBridge、bridgeSlave 4.1.0
speed Long Bond速率 4.1.0
mode String Bond模式 4.1.0
xmitHashPolicy String 哈希策略 4.1.0
miiStatus String mii状态 4.1.0
mac String MAC地址 4.1.0
ipAddresses List IP地址 4.1.0
gateway String 网关地址 4.1.0
callBackIp String 回调地址 4.1.0
miimon Long mii监控间隔 4.1.0
type String Bond类型 4.1.0
allSlavesActive Boolean 4.1.0
description String 资源的详细描述 4.1.0
createDate Timestamp 创建时间 4.1.0
lastOpDate Timestamp 最后一次修改时间 4.1.0
slaves List 详情参考slaves 4.1.0
#slaves
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 4.1.0
hostUuid String 主机UUID 4.1.0
bondingUuid String Bond UUID 4.1.0
interfaceName String 网卡名称 4.1.0
interfaceType String 网卡应用状态,有nomaster、bridgeSlave、bondSlave 4.1.0
speed Long 网卡速率 4.1.0
slaveActive Boolean Bond链路状态 4.1.0
carrierActive Boolean 物理链路状态 4.1.0
ipAddresses List IP地址 4.1.0
gateway String 网关地址 4.1.0
mac String MAC地址 4.1.0
callBackIp String 回调地址 4.1.0
pciDeviceAddress String 网卡PCI地址 4.1.0
offloadStatus String 4.1.0
description String 资源的详细描述 4.1.0
createDate Timestamp 创建时间 4.1.0
lastOpDate Timestamp 最后一次修改时间 4.1.0
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 4.1.0
description String 错误的概要描述 4.1.0
details String 错误的详细信息 4.1.0
elaboration String 保留字段,默认为null 4.1.0
opaque LinkedHashMap 保留字段,默认为null 4.1.0
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 4.1.0

SDK示例

Java SDK
GetCandidateNetworkBondingsAction action = new GetCandidateNetworkBondingsAction();
action.hostUuids = asList("dc20018ed3483aeea38fd742f129a59b");
action.limit = 1000;
action.start = 0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetCandidateNetworkBondingsAction.Result res = action.call();
Python SDK
GetCandidateNetworkBondingsAction action = GetCandidateNetworkBondingsAction()
action.hostUuids = [dc20018ed3483aeea38fd742f129a59b]
action.limit = 1000
action.start = 0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetCandidateNetworkBondingsAction.Result res = action.call()
开发手册 | ZStack ZSphere · ZVF | ZStack 资源中心