Network ResourcesDistributed Switch Related Interfaces
UpdateVirtualSwitchUplinkBondings
Headers
Authorization: OAuth the-session-uuidBody
{
"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-bondingsParameter List
Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
uuid | String | url | The resource UUID. |
| 4.1.0 |
mode | String | body (contained in | The bonding mode. |
| 4.1.0 |
xmitHashPolicy (Optional) | String | body (contained in | Optional. The hash policy. |
| 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"
}
]
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 4.1.0 | |
| inventories | List | See inventories. | 4.1.0 |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.1.0 |
inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 4.1.0 |
| hostUuid | String | The host UUID. | 4.1.0 |
| bondingName | String | The Bond name. | 4.1.0 |
| bondingType | String | The Bond application status. Valid values include noBridge and bridgeSlave. | 4.1.0 |
| speed | Long | The Bond speed. | 4.1.0 |
| mode | String | The Bond mode. | 4.1.0 |
| xmitHashPolicy | String | The hash policy. | 4.1.0 |
| miiStatus | String | The MII status. | 4.1.0 |
| mac | String | The MAC address. | 4.1.0 |
| ipAddresses | List | The IP addresses. | 4.1.0 |
| gateway | String | The gateway address. | 4.1.0 |
| callBackIp | String | The callback address. | 4.1.0 |
| miimon | Long | The MII monitor interval. | 4.1.0 |
| type | String | The Bond type. | 4.1.0 |
| allSlavesActive | Boolean | 4.1.0 | |
| description | String | The detailed description of the resource. | 4.1.0 |
| createDate | Timestamp | The creation date. | 4.1.0 |
| lastOpDate | Timestamp | The last operation date. | 4.1.0 |
| slaves | List | See slaves. | 4.1.0 |
slaves
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 4.1.0 |
| hostUuid | String | The host UUID. | 4.1.0 |
| bondingUuid | String | The Bond UUID. | 4.1.0 |
| interfaceModel | String | The NIC model. | |
| vendorId | String | The vendor ID. | |
| deviceId | String | The device ID. | |
| subvendorId | String | The subvendor ID. | |
| subdeviceId | String | The subdevice ID. | |
| interfaceName | String | The NIC name. | 4.1.0 |
| interfaceType | String | The NIC application status. Valid values include nomaster, bridgeSlave, and bondSlave. | 4.1.0 |
| speed | Long | The NIC speed. | 4.1.0 |
| slaveActive | Boolean | The Bond link status. | 4.1.0 |
| carrierActive | Boolean | The physical link status. | 4.1.0 |
| ipAddresses | List | The IP addresses. | 4.1.0 |
| gateway | String | The gateway address. | 4.1.0 |
| mac | String | The MAC address. | 4.1.0 |
| callBackIp | String | The callback address. | 4.1.0 |
| pciDeviceAddress | String | The NIC PCI address. | 4.1.0 |
| offloadStatus | String | 4.1.0 | |
| description | String | The detailed description of the resource. | 4.1.0 |
| createDate | Timestamp | The creation date. | 4.1.0 |
| lastOpDate | Timestamp | The last operation date. | 4.1.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 4.1.0 |
| description | String | The brief description of the error. | 4.1.0 |
| details | String | The details about the error. | 4.1.0 |
| elaboration | String | The reserved field. Default value: null. | 4.1.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 4.1.0 |
| cause | ErrorCode | The 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()