Get Candidate Host Kernel Interfaces
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/hosts/kernel-interfaces?hostUuids=ff0192fa70113da886101145c084bd00&cidr=192.168.1.0/24&trafficTypes=Management&containsRejected=true&limit=1000&start=0Parameter List
Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
hostUuids | List | query | Host UUID list |
| 4.10.20 |
cidr (Optional) | String | query | Classless Inter-Domain Routing |
| 4.10.20 |
trafficTypes (Optional) | List | query | Traffic type |
| 4.10.20 |
containsRejected (Optional) | boolean | query | Whether to include rejected candidates |
| 4.10.20 |
limit (Optional) | Integer | query | Maximum number of records to return, similar to MySQL limit, default value is 1000 |
| 4.10.20 |
start (Optional) | Integer | query | Starting query record position, similar to MySQL offset. Use with |
| 4.10.20 |
systemTags (Optional) | List | query | System tags |
| 4.10.20 |
userTags (Optional) | List | query | User tags |
| 4.10.20 |
API Response
Response Example
{
"results": [
{
"candidate": {
"uuid": "ff054502e59933a8a494cea5dc88d700",
"name": "host-kernel-interface",
"description": "example",
"hostUuid": "ff0192fa70113da886101145c084bd00",
"l2NetworkUuid": "ff0915ef0d3e32708d3150708a72c400",
"l3NetworkUuid": "ff07d561c51c3ef996d682825dcff700",
"usedIps": [
{
"hostKernelInterfaceUuid": "ff054502e59933a8a494cea5dc88d700",
"uuid": "ff0d1627c13c3337a92767d011d03a00",
"l3NetworkUuid": "ff07d561c51c3ef996d682825dcff700",
"ipVersion": 4,
"ip": "192.168.0.2",
"netmask": "255.255.255.0",
"ipInLong": 3232235522,
"ipInBinary": [
-64,
-88,
0,
2
],
"createDate": "Nov 14, 2017 2:20:57 PM",
"lastOpDate": "Nov 14, 2017 2:20:57 PM"
}
],
"trafficTypes": [
"Management"
],
"createDate": "Nov 14, 2017 2:20:57 PM",
"lastOpDate": "Nov 14, 2017 2:20:57 PM"
},
"finalDecision": "ACCEPTED",
"decisions": []
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| results | List | List of candidate Host Kernel Interface results | 4.10.20 |
| success | boolean | 4.10.20 | |
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. See error | 4.10.20 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code, a 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, defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 0.6 |
| cause | ErrorCode | Root cause, the source error that caused the current error, null if no original error | 0.6 |
SDK Examples
Java SDK
GetCandidateHostKernelInterfacesAction action = new GetCandidateHostKernelInterfacesAction();
action.hostUuids = asList("ff0192fa70113da886101145c084bd00");
action.cidr = "192.168.1.0/24";
action.trafficTypes = asList("Management");
action.containsRejected = true;
action.limit = 1000;
action.start = 0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetCandidateHostKernelInterfacesAction.Result res = action.call();Python SDK
action = GetCandidateHostKernelInterfacesAction()
action.hostUuids = [ff0192fa70113da886101145c084bd00]
action.cidr = "192.168.1.0/24"
action.trafficTypes = [Management]
action.containsRejected = true
action.limit = 1000
action.start = 0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()