Get Host Candidate NIC Information
Headers
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/cluster/hosts-network-interfaces?hostUuids=5712f3960ae23d24988f4e091bf5704f&interfaceType=all&intersecting=true&limit=1000&start=0Parameter List
Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
hostUuids | List | query | Host UUIDs |
| 4.7.0 |
interfaceType (optional) | String | query | NIC type |
| 4.1.0 |
limit (optional) | Integer | query |
|
| 4.7.0 |
start (optional) | Integer | query |
|
| 4.7.0 |
systemTags (optional) | List | body | System tag |
| 4.7.0 |
userTags (optional) | List | body | User tag |
| 4.7.0 |
intersecting (optional) | boolean | query |
|
| 4.1.0 |
API Response
Response Example
{
"slaveNames": [
"eth0",
"eth1"
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| slaveNames | List | NIC names | 4.7.0 |
| success | boolean | 4.7.0 | |
| candidateNics | List | See details candidateNics | 4.7.0 |
| error | ErrorCode | Error code. If not null, the operation failed. If null, the operation succeeded. See details error | 4.7.0 |
candidateNics
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, uniquely identifies the resource | 3.5.0 |
| hostUuid | String | Host UUID | 3.5.0 |
| bondingUuid | String | Bond UUID | 3.5.0 |
| interfaceName | String | NIC name | 3.5.0 |
| interfaceType | String | NIC usage state, can be nomaster, bridgeSlave, bondSlave | 3.5.0 |
| speed | Long | NIC speed | 3.5.0 |
| slaveActive | Boolean | Bond link status | 3.5.0 |
| carrierActive | Boolean | Physical link status | 3.5.0 |
| ipAddresses | List | IP addresses | 3.5.0 |
| gateway | String | Gateway address | 4.7.0 |
| mac | String | MAC address | 3.5.0 |
| callBackIp | String | Callback address | 4.7.0 |
| pciDeviceAddress | String | NIC PCI address | 3.5.0 |
| offloadStatus | String | 4.7.0 | |
| description | String | Resource description | 4.7.0 |
| createDate | Timestamp | Creation time | 3.5.0 |
| lastOpDate | Timestamp | Last modification time | 3.5.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier of the error, e.g. SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field, default is null | 0.6 |
| opaque | LinkedHashMap | Reserved field, default is null | 0.6 |
| cause | ErrorCode | Root cause, the error that caused the current error. If there is no original error, this field is null | 0.6 |
SDK Examples
Java SDK
GetCandidateNetworkInterfacesAction action = new GetCandidateNetworkInterfacesAction();
action.hostUuids = asList("5712f3960ae23d24988f4e091bf5704f");
action.interfaceType = "all";
action.intersecting = true;
action.limit = 1000;
action.start = 0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetCandidateNetworkInterfacesAction.Result res = action.call();Python SDK
GetCandidateNetworkInterfacesAction action = GetCandidateNetworkInterfacesAction()
action.hostUuids = [5712f3960ae23d24988f4e091bf5704f]
action.interfaceType = "all"
action.intersecting = true
action.limit = 1000
action.start = 0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetCandidateNetworkInterfacesAction.Result res = action.call()