Kernel Adapter Related Interfaces
CreateHostKernelInterface
API Request
URLs
POST zstack/v1/l2-networks/kernel-interfacesHeaders
Authorization: OAuth the-session-uuidBody
Note: The systemTags and userTags fields can be omitted in the above example. They are listed to indicate that the body can contain these two fields.
{
"params": {
"name": "zs-kernel",
"description": "test-description",
"hostUuid": "ac64f7d9591b34b5a9286d7124e9787c",
"l2NetworkUuid": "c68967a38bf132bf96f7ca42cdc5c47b",
"l3NetworkUuid": "1c9547c6bd89392e8c0f50efa83ac990",
"requiredIp": "172.16.1.1",
"netmask": "255.255.255.0",
"trafficTypes": [
"Management"
]
},
"systemTags": [],
"userTags": []
}
Note: The systemTags and userTags fields can be omitted in the above example. They are listed to indicate that the body can contain these two fields.Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"zs-kernel","description":"test-description","hostUuid":"ac64f7d9591b34b5a9286d7124e9787c","l2NetworkUuid":"c68967a38bf132bf96f7ca42cdc5c47b","l3NetworkUuid":"1c9547c6bd89392e8c0f50efa83ac990","requiredIp":"172.16.1.1","netmask":"255.255.255.0","trafficTypes":["Management"]}}' http://localhost:8080/zstack/v1/l2-networks/kernel-interfacesParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| name | String | body(contained in params structure) | Resource name | 4.1.0 | |
| description (Optional) | String | body(contained in params structure) | Resource description | 4.1.0 | |
| hostUuid | String | body(contained in params structure) | Host UUID | 4.1.0 | |
| l2NetworkUuid | String | body(contained in params structure) | Port group Distributed Switch UUID | 4.1.0 | |
| l3NetworkUuid | String | body(contained in params structure) | Distributed Port Group UUID | 4.1.0 | |
| requiredIp (Optional) | String | body(contained in params structure) | Required IP | 4.1.0 | |
| netmask (Optional) | String | body(contained in params structure) | Netmask | 4.1.0 | |
| trafficTypes (Optional) | List | body(contained in params structure) | Traffic type |
|
4.1.0 |
| resourceUuid (Optional) | String | body(contained in params structure) | Resource UUID | 4.1.0 | |
| tagUuids (Optional) | List | body(contained in params structure) | Tag UUID list | 4.1.0 | |
| systemTags (Optional) | List | body | System tags | 4.1.0 | |
| userTags (Optional) | List | body | User tags | 4.1.0 |
API Response
Response Example
{
"inventory": {
"uuid": "748beaeb70273060a8b599d871a195e6",
"name": "test-kernel",
"description": "test-kernel",
"hostUuid": "3a620091153d3027af5df7c27a0f8fd8",
"l2NetworkUuid": "f66b2fcb35ae3779a69447cf56a153e3",
"l3NetworkUuid": "c2372a1dd7ce338d80ce1de8c658e9a6",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
}#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource, uniquely identifies the resource | 4.1.0 |
| name | String | Resource name | 4.1.0 |
| description | String | Resource description | 4.1.0 |
| hostUuid | String | Host UUID | 4.1.0 |
| l2PortGroupUuid | String | Port group UUID | 4.1.0 |
| l3NetworkUuid | String | Distributed Port Group UUID | 4.1.0 |
| usedIps | List | IP configuration | 4.1.0 |
| trafficTypes | List | Traffic type | 4.1.0 |
| createDate | Timestamp | Create date | 4.1.0 |
| lastOpDate | Timestamp | Last update date | 4.1.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code, a globally unique identifier of the error, e.g. SYS.1000, HOST.1001 | 4.1.0 |
| description | String | Brief description of the error | 4.1.0 |
| details | String | Detailed error information | 4.1.0 |
| elaboration | String | Reserved field, defaults to null | 4.1.0 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 4.1.0 |
| cause | ErrorCode | Root cause, the source error that caused the current error, null if no original error | 4.1.0 |
SDK Examples
Java
SDK
CreateHostKernelInterfaceAction action = new CreateHostKernelInterfaceAction();
action.name = "zs-kernel";
action.description = "test-description";
action.hostUuid = "ac64f7d9591b34b5a9286d7124e9787c";
action.l2NetworkUuid = "c68967a38bf132bf96f7ca42cdc5c47b";
action.l3NetworkUuid = "1c9547c6bd89392e8c0f50efa83ac990";
action.requiredIp = "172.16.1.1";
action.netmask = "255.255.255.0";
action.trafficTypes = asList("Management");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateHostKernelInterfaceAction.Result res = action.call();Python
SDK
CreateHostKernelInterfaceAction action = CreateHostKernelInterfaceAction()
action.name = "zs-kernel"
action.description = "test-description"
action.hostUuid = "ac64f7d9591b34b5a9286d7124e9787c"
action.l2NetworkUuid = "c68967a38bf132bf96f7ca42cdc5c47b"
action.l3NetworkUuid = "1c9547c6bd89392e8c0f50efa83ac990"
action.requiredIp = "172.16.1.1"
action.netmask = "255.255.255.0"
action.trafficTypes = [Management]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateHostKernelInterfaceAction.Result res = action.call()DeleteHostKernelInterface
API Request
URLs
DELETE zstack/v1/l2-networks/kernel-interfaces/{uuid}Headers
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/l2-networks/kernel-interfaces/a5fc3dae62d832cb9bdbaa18d7bbe475Parameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | UUID of the resource, uniquely identifies the resource | 4.1.0 | |
| systemTags (Optional) | List | body | System tags | 4.1.0 | |
| userTags (Optional) | List | body | User tags | 4.1.0 | |
| deleteMode (Optional) | String | body | Delete mode (Permissive or Enforcing, default is Permissive) | 4.0.1 |
API Response
On success, this API returns an empty JSON structure
{}. On error, the returned JSON structure contains an error field, for example:{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Examples
Java
SDK
DeleteHostKernelInterfaceAction action = new DeleteHostKernelInterfaceAction();
action.uuid = "a5fc3dae62d832cb9bdbaa18d7bbe475";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteHostKernelInterfaceAction.Result res = action.call();Python
SDK
DeleteHostKernelInterfaceAction action = DeleteHostKernelInterfaceAction()
action.uuid = "a5fc3dae62d832cb9bdbaa18d7bbe475"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteHostKernelInterfaceAction.Result res = action.call()UpdateHostKernelInterface
API Request
URLs
PUT zstack/v1/l2-networks/kernel-interfaces/{uuid}/actionsHeaders
Authorization: OAuth the-session-uuidBody
Note: The systemTags and userTags fields can be omitted in the above example. They are listed to indicate that the body can contain these two fields.
{
"updateHostKernelInterface": {
"name": "test2",
"description": "test2-descrption",
"requiredIp": "172.16.100.100",
"netmask": "255.255.255.0",
"trafficTypes": [
"Management"
]
},
"systemTags": [],
"userTags": []
}
Note: The systemTags and userTags fields can be omitted in the above example. They are listed to indicate that the body can contain these two fields.Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateHostKernelInterface":{"name":"test2","description":"test2-descrption","requiredIp":"172.16.100.100","netmask":"255.255.255.0","trafficTypes":["Management"]}}' http://localhost:8080/zstack/v1/l2-networks/kernel-interfaces/6a57407c26ed39838c25650452da1526/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | UUID of the resource, uniquely identifies the resource | 4.1.0 | |
| name | String | body(contained in updateHostKernelInterface structure) |
Resource name | 4.1.0 | |
| description (Optional) | String | body(contained in updateHostKernelInterface structure) |
Resource description | 4.1.0 | |
| requiredIp (Optional) | String | body(contained in updateHostKernelInterface structure) |
Required IP | 4.1.0 | |
| netmask (Optional) | String | body(contained in updateHostKernelInterface structure) |
Netmask | 4.1.0 | |
| trafficTypes (Optional) | List | body(contained in updateHostKernelInterface structure) |
Traffic type |
|
4.1.0 |
| systemTags (Optional) | List | body | System tags | 4.1.0 | |
| userTags (Optional) | List | body | User tags | 4.1.0 |
API Response
Response Example
{
"inventory": {
"uuid": "d8704bf64eb3387c9eaddd22c28258ed",
"name": "test-kernel",
"description": "test-kernel",
"hostUuid": "925a0c209777387e92203118f48359d0",
"l2NetworkUuid": "e36292d8f0d4366f88224b5c725927f7",
"l3NetworkUuid": "981959800846388e8e3be6bf91a85d01",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
}#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource, uniquely identifies the resource | 4.1.0 |
| name | String | Resource name | 4.1.0 |
| description | String | Resource description | 4.1.0 |
| hostUuid | String | Host UUID | 4.1.0 |
| l2PortGroupUuid | String | Port group UUID | 4.1.0 |
| l3NetworkUuid | String | Distributed Port Group UUID | 4.1.0 |
| usedIps | List | IP configuration | 4.1.0 |
| trafficTypes | List | Traffic type | 4.1.0 |
| createDate | Timestamp | Create date | 4.1.0 |
| lastOpDate | Timestamp | Last update date | 4.1.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code, a globally unique identifier of the error, e.g. SYS.1000, HOST.1001 | 4.1.0 |
| description | String | Brief description of the error | 4.1.0 |
| details | String | Detailed error information | 4.1.0 |
| elaboration | String | Reserved field, defaults to null | 4.1.0 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 4.1.0 |
| cause | ErrorCode | Root cause, the source error that caused the current error, null if no original error | 4.1.0 |
SDK Examples
Java
SDK
UpdateHostKernelInterfaceAction action = new UpdateHostKernelInterfaceAction();
action.uuid = "6a57407c26ed39838c25650452da1526";
action.name = "test2";
action.description = "test2-descrption";
action.requiredIp = "172.16.100.100";
action.netmask = "255.255.255.0";
action.trafficTypes = asList("Management");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateHostKernelInterfaceAction.Result res = action.call();Python
SDK
UpdateHostKernelInterfaceAction action = UpdateHostKernelInterfaceAction()
action.uuid = "6a57407c26ed39838c25650452da1526"
action.name = "test2"
action.description = "test2-descrption"
action.requiredIp = "172.16.100.100"
action.netmask = "255.255.255.0"
action.trafficTypes = [Management]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateHostKernelInterfaceAction.Result res = action.call()QueryHostKernelInterface
Query Host Kernel Interface
API Request
URLs
GET zstack/v1/l3-networks/kernel-interfaces
GET zstack/v1/l3-networks/kernel-interfaces/{uuid}
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/l3-networks/kernel-interfaces?
curl -H "Content-Type: application/json;charset=UTF-8" -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" -X GET http://localhost:8080/zstack/v1/l3-networks/kernel-interfaces/4acac30252e03f82a198e3e3b8eb8f7f
Queryable Fields
Run the CLI tool and enter QueryHostKernelInterface, and press Tab to view all queryable fields and the names of resources available for cross-table queries.
API Response
Response Example
{
"inventories": [
{
"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"
}
]
}
| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the request succeeded | 4.1.0 |
| inventories | List | For details, see inventories | 4.1.0 |
| error | ErrorCode | For details, see error | 4.1.0 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, which uniquely identifies the resource | 4.1.0 |
| name | String | Resource name | 4.1.0 |
| description | String | Detailed resource description | 4.1.0 |
| hostUuid | String | Host UUID | 4.1.0 |
| l2NetworkUuid | String | Layer 2 network UUID | 4.1.0 |
| l3NetworkUuid | String | Distributed Port Group UUID | 4.1.0 |
| trafficTypes | List | The traffic type | 4.1.0 |
| createDate | Timestamp | Creation time | 4.1.0 |
| lastOpDate | Timestamp | Last modification time | 4.1.0 |
| usedIps | List | For details, see usedIps | 4.1.0 |
#usedIps
| Name | Type | Description | Starting Version |
|---|---|---|---|
| hostKernelInterfaceUuid | String | Kernel adapter UUID | 4.1.0 |
| uuid | String | Resource UUID, which uniquely identifies the resource | 4.1.0 |
| ipRangeUuid | String | IP Range UUID | 4.1.0 |
| l3NetworkUuid | String | Distributed Port Group UUID | 4.1.0 |
| ipVersion | Integer | IP protocol number | 4.1.0 |
| ip | String | IP address | 4.1.0 |
| netmask | String | Subnet mask | 4.1.0 |
| gateway | String | Gateway address | 4.1.0 |
| usedFor | String | Allocation reason | 4.1.0 |
| ipInLong | Long | Long stored IP address, only valid for ipv4 | 4.1.0 |
| vmNicUuid | String | Virtual Machine NIC UUID | 4.1.0 |
| createDate | Timestamp | Creation time | 4.1.0 |
| lastOpDate | Timestamp | Last modification time | 4.1.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code, which globally and uniquely identifies the error, for example, SYS.1000 or HOST.1001 | 0.6 |
| description | String | Summary description of the error | 0.6 |
| details | String | Details of the error | 0.6 |
| elaboration | String | Reserved field. The default value is null | 0.6 |
| opaque | LinkedHashMap | Reserved field. The default value is null | 0.6 |
| cause | ErrorCode | Root error that caused the current error. This field is null if there is no source error | 0.6 |
SDK Examples
Java SDK
QueryHostKernelInterfaceAction action = new QueryHostKernelInterfaceAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryHostKernelInterfaceAction.Result res = action.call();
Python SDK
action = QueryHostKernelInterfaceAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()
BatchCreateHostKernelInterface
API Request
URLs
POST zstack/v1/l3-networks/{l3NetworkUuid}/kernel-interfacesHeaders
Authorization: OAuth the-session-uuidBody
Note: The
{
"params": {
"structs": [
{
"name": "host-kernel-interface-1",
"description": "example",
"hostUuid": "ff0192fa70113da886101145c084bd00",
"ip": "192.168.0.1",
"netmask": "255.255.255.0"
},
{
"name": "host-kernel-interface-2",
"description": "example",
"hostUuid": "ff0956f0005a313e8e1178392c01cd00",
"ip": "192.168.0.2",
"netmask": "255.255.255.0"
}
],
"trafficTypes": [
"Management"
]
},
"systemTags": [],
"userTags": []
}
Note: The systemTags and userTags fields can be omitted in the above example. They are listed to indicate that the body can contain these two fields.Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"structs":[{"name":"host-kernel-interface-1","description":"example","hostUuid":"ff0192fa70113da886101145c084bd00","ip":"192.168.0.1","netmask":"255.255.255.0"},{"name":"host-kernel-interface-2","description":"example","hostUuid":"ff0956f0005a313e8e1178392c01cd00","ip":"192.168.0.2","netmask":"255.255.255.0"}],"trafficTypes":["Management"]}}' \
http://localhost:8080/zstack/v1/l3-networks/ff07d561c51c3ef996d682825dcff700/kernel-interfacesParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| structs | List | body(contained in params structure) |
Kernel adapter structure list | 4.10.20 | |
| l3NetworkUuid | String | url | Distributed Port Group UUID | 4.10.20 | |
| trafficTypes (Optional) | List | body(contained in params structure) |
Traffic type |
|
4.10.20 |
| systemTags (Optional) | List | body | System tags | 4.10.20 | |
| userTags (Optional) | List | body | User tags | 4.10.20 |
API Response
Response Example
{
"results": [
{
"inventory": {
"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"
}
}
]
}#results
#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 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource, uniquely identifies the resource | 4.1.0 |
| name | String | Resource name | 4.1.0 |
| description | String | Resource description | 4.1.0 |
| hostUuid | String | Host UUID | 4.1.0 |
| l2NetworkUuid | String | Distributed Switch UUID | 4.1.0 |
| l3NetworkUuid | String | Distributed Port Group UUID | 4.1.0 |
| trafficTypes | List | Traffic type | 4.1.0 |
| createDate | Timestamp | Create date | 4.1.0 |
| lastOpDate | Timestamp | Last update date | 4.1.0 |
| usedIps | List | See usedIps | 4.1.0 |
#usedIps
| Name | Type | Description | Starting Version |
|---|---|---|---|
| hostKernelInterfaceUuid | String | Kernel adapter UUID | 4.1.0 |
| uuid | String | UUID of the resource, uniquely identifies the resource | 4.1.0 |
| ipRangeUuid | String | IP Range UUID | 4.1.0 |
| l3NetworkUuid | String | Distributed Port Group UUID | 4.1.0 |
| ipVersion | Integer | IP protocol number | 4.1.0 |
| ip | String | IP address | 4.1.0 |
| netmask | String | Netmask | 4.1.0 |
| gateway | String | Gateway address | 4.1.0 |
| usedFor | String | Allocation reason | 4.1.0 |
| ipInLong | Long | IP address stored in long format, only valid for IPv4 | 4.1.0 |
| vmNicUuid | String | Virtual Machine NIC UUID | 4.1.0 |
| createDate | Timestamp | Create date | 4.1.0 |
| lastOpDate | Timestamp | Last update date | 4.1.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code, a globally unique identifier of the error, e.g. SYS.1000, HOST.1001 | 4.1.0 |
| description | String | Brief description of the error | 4.1.0 |
| details | String | Detailed error information | 4.1.0 |
| elaboration | String | Reserved field, defaults to null | 4.1.0 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 4.1.0 |
| cause | ErrorCode | Root cause, the source error that caused the current error, null if no original error | 4.1.0 |
SDK Examples
Java SDK
BatchCreateHostKernelInterfaceAction action = new BatchCreateHostKernelInterfaceAction();
action.structs = asList([name:host-kernel-interface-1, description:example, hostUuid:ff0192fa70113da886101145c084bd00, ip:192.168.0.1, netmask:255.255.255.0],[name:host-kernel-interface-2, description:example, hostUuid:ff0956f0005a313e8e1178392c01cd00, ip:192.168.0.2, netmask:255.255.255.0]);
action.l3NetworkUuid = "ff07d561c51c3ef996d682825dcff700";
action.trafficTypes = asList("Management");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
BatchCreateHostKernelInterfaceAction.Result res = action.call();Python SDK
action = BatchCreateHostKernelInterfaceAction()
action.structs = [[name:host-kernel-interface-1, description:example, hostUuid:ff0192fa70113da886101145c084bd00, ip:192.168.0.1, netmask:255.255.255.0], [name:host-kernel-interface-2, description:example, hostUuid:ff0956f0005a313e8e1178392c01cd00, ip:192.168.0.2, netmask:255.255.255.0]]
action.l3NetworkUuid = "ff07d561c51c3ef996d682825dcff700"
action.trafficTypes = [Management]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()GetCandidateHostKernelInterfaces
API Request
URLs
GET zstack/v1/hosts/kernel-interfacesHeaders
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 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": []
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| results | List | List of candidate Host Kernel Interface results | 4.10.20 |
| success | boolean | Whether the operation succeeded. | 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()