UpdateVmNicDriver

API Request

URLs
PUT zstack/vm-instances/{vmInstanceUuid}/actions?vmNicUuid={vmNicUuid}
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateVmNicDriver": {
    "vmNicUuid": "1954794b830e32edbcf17f36344bbd14",
    "driverType": "e1000"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateVmNicDriver":{"vmNicUuid":"1954794b830e32edbcf17f36344bbd14","driverType":"e1000"}}' http://localhost:8080/zstack/v1/vm-instances/ca775a57e8d73a3ca85f490b53647b80/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
vmInstanceUuid String url The VM instance UUID. 3.9.0
vmNicUuid String url The VM NIC UUID. 3.9.0
driverType String body (contained in the params structure) The type of the VM NIC driver.
  • virtio
  • e1000
  • rtl8139
3.9.0
systemTags List body Optional. The system tags. 3.9.0
userTags List body Optional. The user tags. 3.9.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "b6af955c36b23be693fca2db0df03737",
    "vmInstanceUuid": "ed3f3ea119883726b1a97ec3cc4b1583",
    "usedIpUuid": "78b119bae906373d825fa7e68faf6a0b",
    "l3NetworkUuid": "307365f47f933bf09ff951cb67b52c5b",
    "ip": "192.168.1.10",
    "mac": "00:0c:29:bd:99:fc",
    "netmask": "255.255.255.0",
    "gateway": "192.168.1.1",
    "driverType": "e1000",
    "deviceId": 0.0
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.9.0
inventory VmNicInventory See inventory. 3.9.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.9.0
description String The brief description of the error. 3.9.0
details String The details about the error. 3.9.0
elaboration String The reserved field. Default value: null. 3.9.0
opaque LinkedHashMap The reserved field. Default value: null. 3.9.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.9.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.9.0
vmInstanceUuid String The VM instance UUID. 3.9.0
l3NetworkUuid String The L3 network UUID. 3.9.0
ip String 3.9.0
mac String 3.9.0
netmask String 3.9.0
gateway String 3.9.0
metaData String 3.9.0
ipVersion Integer The IP version. 3.9.0
deviceId Integer 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0
usedIps List See usedIps. 3.9.0
#usedIps
Name Type Description Starting Version
uuid String The resource UUID. 3.9.0
ipRangeUuid String The IP range UUID. 3.9.0
l3NetworkUuid String The L3 network UUID. 3.9.0
ipVersion Integer The IP version. 3.9.0
ip String The IP address. 3.9.0
netmask String The netmask. 3.9.0
gateway String The gateway. 3.9.0
usedFor String 3.9.0
ipInLong long 3.9.0
vmNicUuid String The VM NIC UUID. 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0

SDK Sample

Java SDK
UpdateVmNicDriverAction action = new UpdateVmNicDriverAction();
action.vmInstanceUuid = "ca775a57e8d73a3ca85f490b53647b80";
action.vmNicUuid = "1954794b830e32edbcf17f36344bbd14";
action.driverType = "e1000";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateVmNicDriverAction.Result res = action.call();
Python SDK
UpdateVmNicDriverAction action = UpdateVmNicDriverAction()
action.vmInstanceUuid = "ca775a57e8d73a3ca85f490b53647b80"
action.vmNicUuid = "1954794b830e32edbcf17f36344bbd14"
action.driverType = "e1000"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateVmNicDriverAction.Result res = action.call()