Get Candidate Host Kernel Interfaces

GET/zstack/v1/hosts/kernel-interfaces

Headers

Authorization: OAuth the-session-uuid

Curl 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=0

Parameter 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

  • Management
  • Storage

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 limit for pagination

 

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": []
    }
  ]
}
NameTypeDescriptionStarting Version
resultsListList of candidate Host Kernel Interface results4.10.20
successboolean 4.10.20
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. See error4.10.20

error

NameTypeDescriptionStarting Version
codeStringError code, a globally unique identifier of the error, e.g. SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, defaults to null0.6
opaqueLinkedHashMapReserved field, defaults to null0.6
causeErrorCodeRoot cause, the source error that caused the current error, null if no original error0.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()