UpdateVmNicDriver
API Request
URLs
PUT zstack/v1/vm-instances/{vmInstanceUuid}/actionsHeaders
Authorization: OAuth the-session-uuidBody
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
{
"updateVmNicDriver": {
"vmNicUuid": "1954794b830e32edbcf17f36344bbd14",
"driverType": "e1000"
},
"systemTags": [],
"userTags": []
}
Note: 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/actionsParameter 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 |
|
3.9.0 |
| systemTags (Optional) | List | body | Optional. The system tags. | 3.9.0 | |
| userTags (Optional) | List | body | Optional. The user tags. | 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"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 0.6 |
| error | ErrorCode | Error code. If not null, the operation failed. When the operation succeeds, this field is null. For details, see error | 3.9.0 |
| inventory | VmNicInventory | For details, see inventory | 3.9.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, a globally unique identifier of the error, for example SYS.1000, HOST.1001 | 3.9.0 |
| description | String | Brief description of the error | 3.9.0 |
| details | String | Detailed error information | 3.9.0 |
| elaboration | String | Reserved field, defaults to null | 3.9.0 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 3.9.0 |
| cause | ErrorCode | Root cause. The error that triggered the current error. If there is no original error, this field is null | 3.9.0 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, uniquely identifies the resource | 3.9.0 |
| vmInstanceUuid | String | Virtual Machine UUID | 3.9.0 |
| l3NetworkUuid | String | L3 Network UUID | 3.9.0 |
| ip | String | The IP address. | 3.9.0 |
| mac | String | The MAC address. | 3.9.0 |
| hypervisorType | String | The hypervisor type. | 4.7.13 |
| netmask | String | The netmask. | 3.9.0 |
| gateway | String | The gateway IP address. | 3.9.0 |
| metaData | String | The metadata. | 3.9.0 |
| ipVersion | Integer | IP protocol version | 3.9.0 |
| driverType | String | The driver type. | 4.7.13 |
| internalName | String | The internal name. | 4.7.13 |
| deviceId | Integer | The device ID. | 3.9.0 |
| type | String | The resource type. | 4.7.13 |
| state | String | NIC status | 4.7.13 |
| createDate | Timestamp | Create time | 3.9.0 |
| lastOpDate | Timestamp | Last update time | 3.9.0 |
| usedIps | List | For details, see usedIps | 3.9.0 |
#usedIps
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, uniquely identifies the resource | 3.9.0 |
| ipRangeUuid | String | IP Range UUID | 3.9.0 |
| l3NetworkUuid | String | L3 Network UUID | 3.9.0 |
| ipVersion | Integer | IP protocol version | 3.9.0 |
| ip | String | IP address | 3.9.0 |
| netmask | String | Network mask | 3.9.0 |
| gateway | String | Gateway address | 3.9.0 |
| usedFor | String | The intended use. | 3.9.0 |
| ipInLong | long | The IP address represented as a long integer. | 3.9.0 |
| vmNicUuid | String | Virtual Machine NIC UUID | 3.9.0 |
| createDate | Timestamp | Create time | 3.9.0 |
| lastOpDate | Timestamp | Last update time | 3.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()