Update Host Kernel Interface

PUT/zstack/v1/l2-networks/kernel-interfaces/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateHostKernelInterface": {
    "name": "test2",
    "description": "test2-descrption",
    "requiredIp": "172.16.100.100",
    "netmask": "255.255.255.0",
    "trafficTypes": [
      "Management"
    ]
  },
  "systemTags": [],
  "userTags": []
}

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/actions

Parameter 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

  • Management

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"
  }
}
NameTypeDescriptionStarting Version
successboolean 4.1.0
inventoryHostKernelInterfaceInventorySee inventory4.1.0
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. See error4.1.0

inventory

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifies the resource4.1.0
nameStringResource name4.1.0
descriptionStringResource description4.1.0
hostUuidStringHost UUID4.1.0
l2PortGroupUuidStringPort group UUID4.1.0
l3NetworkUuidStringDistributed Port Group UUID4.1.0
usedIpsListIP configuration4.1.0
trafficTypesListTraffic type4.1.0
createDateTimestampCreate date4.1.0
lastOpDateTimestampLast update date4.1.0

error

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