Change VM NIC Type

PUT/zstack/v1/vm-instances/nics/{vmNicUuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

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

Parameter 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

  • VNIC

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"
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. See error3.9.0
inventoryVmNicInventorySee inventory3.9.0

error

NameTypeDescriptionStarting Version
codeStringError code, a globally unique identifier of the error, e.g. 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 source error that caused the current error, null if no original error3.9.0

inventory

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifies the resource3.9.0
vmInstanceUuidStringVirtual Machine UUID3.9.0
l3NetworkUuidStringDistributed Port Group UUID3.9.0
ipStringIP address3.9.0
macStringMAC address3.9.0
hypervisorTypeStringHypervisor type3.9.0
netmaskStringNetmask3.9.0
gatewayStringGateway3.9.0
metaDataString 3.9.0
ipVersionIntegerIP address version3.9.0
driverTypeString 3.17.13
internalNameString 3.17.13
deviceIdIntegerDevice ID3.9.0
typeStringNIC type3.9.0
stateStringNIC state3.17.13
createDateTimestampCreate date3.9.0
lastOpDateTimestampLast update date3.9.0
usedIpsListSee usedIps3.9.0

usedIps

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifies the resource3.9.0
ipRangeUuidStringIP Range UUID3.9.0
l3NetworkUuidStringDistributed Port Group UUID3.9.0
ipVersionIntegerIP protocol number3.9.0
ipStringIP address3.9.0
netmaskStringNetmask3.9.0
gatewayStringGateway address3.9.0
usedForString 3.9.0
ipInLonglong 3.9.0
vmNicUuidStringVirtual Machine NIC UUID3.9.0
createDateTimestampCreate date3.9.0
lastOpDateTimestampLast update date3.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()