Create Bond Interface

POST/zstack/v1/hosts/bondings

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "hostUuids": [
      "83e1a4a2ca0d3b0e836b032118196455"
    ],
    "type": "LinuxBonding",
    "mode": "802.3ad",
    "xmitHashPolicy": "layer2+3"
  },
  "systemTags": [],
  "userTags": []
}

In the above example, systemTags and userTags fields can be omitted. They are listed to indicate that these two fields can be included in the body.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"hostUuids":["83e1a4a2ca0d3b0e836b032118196455"],"type":"LinuxBonding","mode":"802.3ad","xmitHashPolicy":"layer2+3"}}' http://localhost:8080/zstack/v1/hosts/bondings

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

hostUuids

List

body (contained in params structure)

Host UUID list

 

5.0.0

bondingName

String

body (contained in params structure)

Bond name

 

4.7.0

slaveUuids (optional)

List

body (contained in params structure)

Slave NIC UUID list

 

5.0.0

slaveNames (optional)

List

body (contained in params structure)

Slave NIC name list

 

5.0.0

type

String

body (contained in params structure)

Bond type

  • LinuxBonding
  • OvsBonding

4.7.0

mode

String

body (contained in params structure)

Bond mode

  • 802.3ad
  • active-backup

4.7.0

xmitHashPolicy (optional)

String

body (contained in params structure)

Hash policy

  • layer2
  • layer2+3
  • layer3+4

4.7.0

description (optional)

String

body (contained in params structure)

Resource description

 

4.7.0

resourceUuid (optional)

String

body (contained in params structure)

Resource UUID

 

4.7.0

tagUuids (optional)

List

body (contained in params structure)

Tag UUID list

 

4.7.0

systemTags (optional)

List

body

System tag

 

4.7.0

userTags (optional)

List

body

User tag

 

4.7.0

API Response

Response Example

{
  "inventory": [
    {
      "hostUuid": "ad58bd08605338648dce127f256f332e",
      "bondingName": "test",
      "mode": "802.3ad",
      "xmitHashPolicy": "layer2+3",
      "ipAddresses": [
        "192.168.1.1"
      ],
      "type": "LinuxBonding",
      "slaves": [
        {
          "uuid": "97e1e9fb0cd73af8bd3e84376e59fa26",
          "hostUuid": "ad58bd08605338648dce127f256f332e",
          "interfaceName": "eno1",
          "interfaceType": "bondingSlave",
          "speed": 1000,
          "slaveActive": true,
          "carrierActive": true,
          "createDate": "Nov 14, 2017 10:20:57 PM",
          "lastOpDate": "Nov 14, 2017 10:20:57 PM"
        }
      ]
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 4.7.0
inventoryListSee details inventory4.7.0
errorErrorCodeError code. If not null, the operation failed. If null, the operation succeeded. See details error4.7.0

inventory

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource4.7.0
hostUuidStringHost UUID4.7.0
bondingNameStringBond name4.7.0
bondingTypeStringBond usage state, can be noBridge, bridgeSlave4.7.0
speedLongBond speed4.7.0
modeStringBond mode4.7.0
xmitHashPolicyStringHash policy4.7.0
miiStatusStringMII status4.7.0
macStringMAC address4.7.0
ipAddressesListIP addresses4.7.0
gatewayStringGateway address4.7.0
callBackIpStringCallback address4.7.0
miimonLongMII monitor interval4.7.0
typeStringBond type4.7.0
allSlavesActiveBoolean 4.7.0
descriptionStringResource description4.7.0
createDateTimestampCreation time4.7.0
lastOpDateTimestampLast modification time4.7.0
slavesListSee details slaves4.7.0

slaves

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource4.7.0
hostUuidStringHost UUID4.7.0
bondingUuidStringBond UUID4.7.0
interfaceModelStringNIC model5.0.0
vendorIdStringVendor ID5.0.0
deviceIdStringDevice ID5.0.0
subvendorIdStringSub-vendor ID5.0.0
subdeviceIdStringSub-device ID5.0.0
interfaceNameStringNIC name4.7.0
interfaceTypeStringNIC usage state, can be nomaster, bridgeSlave, bondSlave4.7.0
speedLongNIC speed4.7.0
slaveActiveBooleanBond link status4.7.0
carrierActiveBooleanPhysical link status4.7.0
ipAddressesListIP addresses4.7.0
gatewayStringGateway address4.7.0
macStringMAC address4.7.0
callBackIpStringCallback address4.7.0
pciDeviceAddressStringNIC PCI address4.7.0
offloadStatusString 4.7.0
descriptionStringResource description4.7.0
createDateTimestampCreation time4.7.0
lastOpDateTimestampLast modification time4.7.0

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier of the error, e.g. SYS.1000, HOST.10014.7.0
descriptionStringBrief description of the error4.7.0
detailsStringDetailed error information4.7.0
elaborationStringReserved field, default is null4.7.0
opaqueLinkedHashMapReserved field, default is null4.7.0
causeErrorCodeRoot cause, the error that caused the current error. If there is no original error, this field is null4.7.0

SDK Examples

Java SDK

CreateBondingAction action = new CreateBondingAction();
action.hostUuids = asList("83e1a4a2ca0d3b0e836b032118196455");
action.type = "LinuxBonding";
action.mode = "802.3ad";
action.xmitHashPolicy = "layer2+3";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateBondingAction.Result res = action.call();

Python SDK

CreateBondingAction action = CreateBondingAction()
action.hostUuids = [83e1a4a2ca0d3b0e836b032118196455]
action.type = "LinuxBonding"
action.mode = "802.3ad"
action.xmitHashPolicy = "layer2+3"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateBondingAction.Result res = action.call()