QueryHostNetworkBonding
API Request
URLs
GET zstack/v1/hosts/bondingsGET zstack/v1/hosts/bondings/{uuid}Headers
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/hosts/bondingscurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/hosts/bondings/4557b1f12ef7393c926b8b7223ddebacQueryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryHostNetworkBonding, and pressing the Tab key.
API Response
Sample
Response
{
"inventories": [
{
"uuid": "2e2226e18e853f20a5791684a1b644c8",
"hostUuid": "903696c585a639bb8049713b98d93437",
"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.0,
"allSlavesActive": true,
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM",
"slaves": [
{
"uuid": "17a40aa475cf322494ea82e09066892e",
"hostUuid": "903696c585a639bb8049713b98d93437",
"bondingUuid": "2e2226e18e853f20a5791684a1b644c8",
"interfaceName": "eno1",
"interfaceType": "bondingSlave",
"speed": 1000.0,
"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": "c3716c87b9173cbb8315e7d7f3645bc4",
"hostUuid": "903696c585a639bb8049713b98d93437",
"bondingUuid": "2e2226e18e853f20a5791684a1b644c8",
"interfaceName": "eno2",
"interfaceType": "bondingSlave",
"speed": 1000.0,
"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 |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.9.0 |
| inventories | List | See inventories. | 3.9.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. | 3.9.0 |
| description | String | The brief description of the error. | 3.9.0 |
| details | String | The details about the error. | 3.9.0 |
| elaboration | String | The reserved field. Default value: null. | 3.9.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.9.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. | 3.9.0 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.9.0 |
| hostUuid | String | The host UUID. | 3.9.0 |
| bondingName | String | The bond name. | 3.9.0 |
| mode | String | The bond mode. | 3.9.0 |
| xmitHashPolicy | String | The hash policy. | 3.9.0 |
| miiStatus | String | The MII status. | 3.9.0 |
| mac | String | The MAC address. | 3.9.0 |
| ipAddresses | List | The IP address. | 3.9.0 |
| miimon | Long | The MII monitoring interval. | 3.9.0 |
| allSlavesActive | Boolean | 3.9.0 | |
| createDate | Timestamp | The creation date. | 3.9.0 |
| lastOpDate | Timestamp | The last operation date. | 3.9.0 |
| slaves | List | See slaves. | 3.9.0 |
#slaves
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.9.0 |
| hostUuid | String | The host UUID. | 3.9.0 |
| bondingUuid | String | The bond UUID. | 3.9.0 |
| interfaceName | String | The interface name. | 3.9.0 |
| interfaceType | String | The interface type. Options: nomaster, bridgeSlave, and bondSlave. | 3.9.0 |
| speed | Long | The interface speed. | 3.9.0 |
| slaveActive | Boolean | The bond link status. | 3.9.0 |
| carrierActive | Boolean | The physical link status. | 3.9.0 |
| ipAddresses | List | The IP address. | 3.9.0 |
| mac | String | The MAC address. | 3.9.0 |
| pciDeviceAddress | String | The PCI address of the interface. | 3.9.0 |
| createDate | Timestamp | The creation date. | 3.9.0 |
| lastOpDate | Timestamp | The last operation date. | 3.9.0 |
SDK Sample
Java
SDK
QueryHostNetworkBondingAction action = new QueryHostNetworkBondingAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryHostNetworkBondingAction.Result res = action.call();Python
SDK
QueryHostNetworkBondingAction action = QueryHostNetworkBondingAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryHostNetworkBondingAction.Result res = action.call()