Change VM NIC Type
Headers
Authorization: OAuth the-session-uuidBody
{
"changeVmNicType": {
"vmNicType": "VNIC"
},
"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 '{"changeVmNicType":{"vmNicType":"VNIC"}}' \
http://localhost:8080/zstack/v1/vm-instances/nics/ba83aa15bafd33e792267c428465b1e5/actionsParameter List
Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
vmNicUuid | String | url | Virtual Machine NIC UUID |
| 3.9.0 |
vmNicType | String | body(contained in changeVmNicType structure) | Virtual Machine NIC type |
| 3.9.0 |
systemTags (Optional) | List | body | System tags |
| 3.9.0 |
userTags (Optional) | List | body | User tags |
| 3.9.0 |
API Response
Response Example
{
"inventory": {
"uuid": "bd44ea50e2573d5d9249c938dba0dad6",
"vmInstanceUuid": "1311eba1f7e53c3aa816a140fd783068",
"usedIpUuid": "464575b453d53e60941c7eeee08f3149",
"l3NetworkUuid": "b62214c53fde3f6eb825bf2ce59e3d2e",
"ip": "192.168.1.10",
"mac": "00:0c:29:bd:99:fc",
"hypervisorType": "KVM",
"netmask": "255.255.255.0",
"gateway": "192.168.1.1",
"deviceId": 0.0,
"type": "VF"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 0.6 | |
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. See error | 3.9.0 |
| inventory | VmNicInventory | See inventory | 3.9.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code, a globally unique identifier of the error, e.g. 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 source error that caused the current error, null if no original error | 3.9.0 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource, uniquely identifies the resource | 3.9.0 |
| vmInstanceUuid | String | Virtual Machine UUID | 3.9.0 |
| l3NetworkUuid | String | Distributed Port Group UUID | 3.9.0 |
| ip | String | IP address | 3.9.0 |
| mac | String | MAC address | 3.9.0 |
| hypervisorType | String | Hypervisor type | 3.9.0 |
| netmask | String | Netmask | 3.9.0 |
| gateway | String | Gateway | 3.9.0 |
| metaData | String | 3.9.0 | |
| ipVersion | Integer | IP address version | 3.9.0 |
| driverType | String | 3.17.13 | |
| internalName | String | 3.17.13 | |
| deviceId | Integer | Device ID | 3.9.0 |
| type | String | NIC type | 3.9.0 |
| state | String | NIC state | 3.17.13 |
| createDate | Timestamp | Create date | 3.9.0 |
| lastOpDate | Timestamp | Last update date | 3.9.0 |
| usedIps | List | See usedIps | 3.9.0 |
usedIps
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource, uniquely identifies the resource | 3.9.0 |
| ipRangeUuid | String | IP Range UUID | 3.9.0 |
| l3NetworkUuid | String | Distributed Port Group UUID | 3.9.0 |
| ipVersion | Integer | IP protocol number | 3.9.0 |
| ip | String | IP address | 3.9.0 |
| netmask | String | Netmask | 3.9.0 |
| gateway | String | Gateway address | 3.9.0 |
| usedFor | String | 3.9.0 | |
| ipInLong | long | 3.9.0 | |
| vmNicUuid | String | Virtual Machine NIC UUID | 3.9.0 |
| createDate | Timestamp | Create date | 3.9.0 |
| lastOpDate | Timestamp | Last update date | 3.9.0 |
SDK Examples
Java SDK
ChangeVmNicTypeAction action = new ChangeVmNicTypeAction();
action.vmNicUuid = "ba83aa15bafd33e792267c428465b1e5";
action.vmNicType = "VNIC";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeVmNicTypeAction.Result res = action.call();Python SDK
action = ChangeVmNicTypeAction()
action.vmNicUuid = "ba83aa15bafd33e792267c428465b1e5"
action.vmNicType = "VNIC"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()