Network ResourcesDistributed Switch Related Interfaces

UpdateVirtualSwitchUplinkBondings

PUT/zstack/v1/l2-networks/virtual-switch/{uuid}/uplink-bondings

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateVirtualSwitchUplinkBondings": {
    "mode": "active-backup 1",
    "xmitHashPolicy": "layer2 0"
  },
  "systemTags": [],
  "userTags": []
}

In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.

Curl Sample

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateVirtualSwitchUplinkBondings":{"mode":"active-backup 1","xmitHashPolicy":"layer2 0"}}' http://localhost:8080/zstack/v1/l2-networks/virtual-switch/d558d0c667c735cbb2c9a34ef7e7c5c3/uplink-bondings

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

uuid

String

url

The resource UUID.

 

4.1.0

mode

String

body (contained in updateVirtualSwitchUplinkBondings structure)

The bonding mode.

  • 802.3ad
  • active-backup

4.1.0

xmitHashPolicy (Optional)

String

body (contained in updateVirtualSwitchUplinkBondings structure)

Optional. The hash policy.

  • layer2
  • layer2+3
  • layer3+4

4.1.0

systemTags (Optional)

List

body

Optional. The system tags.

 

4.1.0

userTags (Optional)

List

body

Optional. The user tags.

 

4.1.0

API Response

Sample Response

{
  "inventories": [
    {
      "uuid": "f05eb769fbba34388625771c17666383",
      "hostUuid": "7b9b76f4f9663d27a72fb81f4b4ad5b0",
      "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": "96b9aafc2c9c3b9c862771543dc9bdc8",
          "hostUuid": "7b9b76f4f9663d27a72fb81f4b4ad5b0",
          "bondingUuid": "f05eb769fbba34388625771c17666383",
          "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": "8bf85f6d802438588dc292908bb4e928",
          "hostUuid": "7b9b76f4f9663d27a72fb81f4b4ad5b0",
          "bondingUuid": "f05eb769fbba34388625771c17666383",
          "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"
        }
      ]
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 4.1.0
inventoriesListSee inventories.4.1.0
errorErrorCodeThe error code. If not null, the operation fails, or vice versa. For more information, see error.4.1.0

inventories

NameTypeDescriptionStarting Version
uuidStringThe resource UUID.4.1.0
hostUuidStringThe host UUID.4.1.0
bondingNameStringThe Bond name.4.1.0
bondingTypeStringThe Bond application status. Valid values include noBridge and bridgeSlave.4.1.0
speedLongThe Bond speed.4.1.0
modeStringThe Bond mode.4.1.0
xmitHashPolicyStringThe hash policy.4.1.0
miiStatusStringThe MII status.4.1.0
macStringThe MAC address.4.1.0
ipAddressesListThe IP addresses.4.1.0
gatewayStringThe gateway address.4.1.0
callBackIpStringThe callback address.4.1.0
miimonLongThe MII monitor interval.4.1.0
typeStringThe Bond type.4.1.0
allSlavesActiveBoolean 4.1.0
descriptionStringThe detailed description of the resource.4.1.0
createDateTimestampThe creation date.4.1.0
lastOpDateTimestampThe last operation date.4.1.0
slavesListSee slaves.4.1.0

slaves

NameTypeDescriptionStarting Version
uuidStringThe resource UUID.4.1.0
hostUuidStringThe host UUID.4.1.0
bondingUuidStringThe Bond UUID.4.1.0
interfaceModelStringThe NIC model. 
vendorIdStringThe vendor ID. 
deviceIdStringThe device ID. 
subvendorIdStringThe subvendor ID. 
subdeviceIdStringThe subdevice ID. 
interfaceNameStringThe NIC name.4.1.0
interfaceTypeStringThe NIC application status. Valid values include nomaster, bridgeSlave, and bondSlave.4.1.0
speedLongThe NIC speed.4.1.0
slaveActiveBooleanThe Bond link status.4.1.0
carrierActiveBooleanThe physical link status.4.1.0
ipAddressesListThe IP addresses.4.1.0
gatewayStringThe gateway address.4.1.0
macStringThe MAC address.4.1.0
callBackIpStringThe callback address.4.1.0
pciDeviceAddressStringThe NIC PCI address.4.1.0
offloadStatusString 4.1.0
descriptionStringThe detailed description of the resource.4.1.0
createDateTimestampThe creation date.4.1.0
lastOpDateTimestampThe last operation date.4.1.0

error

NameTypeDescriptionStarting Version
codeStringThe error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.4.1.0
descriptionStringThe brief description of the error.4.1.0
detailsStringThe details about the error.4.1.0
elaborationStringThe reserved field. Default value: null.4.1.0
opaqueLinkedHashMapThe reserved field. Default value: null.4.1.0
causeErrorCodeThe root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.4.1.0

SDK Sample

Java SDK

UpdateVirtualSwitchUplinkBondingsAction action = new UpdateVirtualSwitchUplinkBondingsAction();
action.uuid = "d558d0c667c735cbb2c9a34ef7e7c5c3";
action.mode = "active-backup 1";
action.xmitHashPolicy = "layer2 0";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateVirtualSwitchUplinkBondingsAction.Result res = action.call();

Python SDK

UpdateVirtualSwitchUplinkBondingsAction action = UpdateVirtualSwitchUplinkBondingsAction()
action.uuid = "d558d0c667c735cbb2c9a34ef7e7c5c3"
action.mode = "active-backup 1"
action.xmitHashPolicy = "layer2 0"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateVirtualSwitchUplinkBondingsAction.Result res = action.call()