VM Related Interfaces

Update VM NIC Driver

PUT/zstack/v1/vm-instances/{vmInstanceUuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateVmNicDriver": {
    "vmNicUuid": "1954794b830e32edbcf17f36344bbd14",
    "driverType": "e1000"
  },
  "systemTags": [],
  "userTags": []
}

In the example above, systemTags and userTags fields can be omitted. 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 '{"updateVmNicDriver":{"vmNicUuid":"1954794b830e32edbcf17f36344bbd14","driverType":"e1000"}}' http://localhost:8080/zstack/v1/vm-instances/ca775a57e8d73a3ca85f490b53647b80/actions

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

vmInstanceUuid

String

url

Virtual Machine UUID

 

3.9.0

vmNicUuid

String

url

Virtual Machine NIC UUID

 

3.9.0

driverType

String

body (contained in params structure)

Virtual Machine NIC driver type

  • virtio
  • e1000
  • rtl8139

3.9.0

systemTags (Optional)

List

body

 

 

3.9.0

userTags (Optional)

List

body

 

 

3.9.0

API Response

Response Example

{
  "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,
    "state": "enable"
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. When the operation succeeds, this field is null. For details, see error3.9.0
inventoryVmNicInventoryFor details, see inventory3.9.0

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier of the error, for example SYS.1000, HOST.10013.9.0
descriptionStringBrief description of the error3.9.0
detailsStringDetailed error information3.9.0
elaborationStringReserved field, defaults to null3.9.0
opaqueLinkedHashMapReserved field, defaults to null3.9.0
causeErrorCodeRoot cause. The error that triggered the current error. If there is no original error, this field is null3.9.0

inventory

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource3.9.0
vmInstanceUuidStringVirtual Machine UUID3.9.0
l3NetworkUuidStringL3 Network UUID3.9.0
ipString 3.9.0
macString 3.9.0
hypervisorTypeString 4.7.13
netmaskString 3.9.0
gatewayString 3.9.0
metaDataString 3.9.0
ipVersionIntegerIP protocol version3.9.0
driverTypeString 4.7.13
internalNameString 4.7.13
deviceIdInteger 3.9.0
typeString 4.7.13
stateStringNIC status4.7.13
createDateTimestampCreate time3.9.0
lastOpDateTimestampLast update time3.9.0
usedIpsListFor details, see usedIps3.9.0

usedIps

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource3.9.0
ipRangeUuidStringIP Range UUID3.9.0
l3NetworkUuidStringL3 Network UUID3.9.0
ipVersionIntegerIP protocol version3.9.0
ipStringIP address3.9.0
netmaskStringNetwork mask3.9.0
gatewayStringGateway address3.9.0
usedForString 3.9.0
ipInLonglong 3.9.0
vmNicUuidStringVirtual Machine NIC UUID3.9.0
createDateTimestampCreate time3.9.0
lastOpDateTimestampLast update time3.9.0

SDK Examples

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

action = UpdateVmNicDriverAction()
action.vmInstanceUuid = "ca775a57e8d73a3ca85f490b53647b80"
action.vmNicUuid = "1954794b830e32edbcf17f36344bbd14"
action.driverType = "e1000"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()