Change VF NIC HA State

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

Headers

Authorization: OAuth the-session-uuid

Body

{
  "changeVfNicHaState": {
    "haState": "Enabled"
  },
  "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 '{"changeVfNicHaState":{"haState":"Enabled"}}' \
http://localhost:8080/zstack/v1/vm-instances/nics/8536b111015d3fd289907c5f53c80153/actions

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

vfNicUuid

String

url

VF NIC UUID

 

4.10.0

haState

String

body(contained in changeVfNicHaState structure)

HA state

  • Enabled
  • Disabled

4.10.0

systemTags (Optional)

List

body

System tags

 

4.10.0

userTags (Optional)

List

body

User tags

 

4.10.0

API Response

Response Example

{
  "inventory": {
    "pciDeviceUuid": "4935759d5e543ff7bb9901262d67e805",
    "haState": "Enabled",
    "uuid": "5a39466d15e9303d8cd091be8f8b98a0",
    "vmInstanceUuid": "0c9912e742793004bd585150a4e243d0",
    "usedIpUuid": "6c1404d271ce3da4a5a845563b65ab55",
    "l3NetworkUuid": "0d42b1c567da3721b04d1bc316b2e0cb",
    "ip": "192.168.1.2",
    "mac": "00:0c:29:bd:99:fc",
    "hypervisorType": "KVM",
    "netmask": "255.255.255.0",
    "gateway": "192.168.1.1",
    "deviceId": 0,
    "type": "VF",
    "state": "enable"
  }
}
NameTypeDescriptionStarting Version
successboolean 4.10.0
inventoryVmVfNicInventorySee inventory4.10.0
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. See error4.10.0

inventory

NameTypeDescriptionStarting Version
pciDeviceUuidStringNIC PCI address4.10.0
haStateStringHA state4.10.0
uuidStringUUID of the resource, uniquely identifies the resource4.10.0
vmInstanceUuidStringVirtual Machine UUID4.10.0
l3NetworkUuidStringDistributed Port Group UUID4.10.0
ipString 4.10.0
macString 4.10.0
hypervisorTypeString 4.10.0
netmaskString 4.10.0
gatewayString 4.10.0
metaDataString 4.10.0
ipVersionInteger 4.10.0
driverTypeString 4.10.0
internalNameString 4.10.0
deviceIdInteger 4.10.0
typeString 4.10.0
stateString 4.10.0
createDateTimestampCreate date4.10.0
lastOpDateTimestampLast update date4.10.0
usedIpsListSee usedIps4.10.0

usedIps

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifies the resource4.10.0
ipRangeUuidStringIP Range UUID4.10.0
l3NetworkUuidStringDistributed Port Group UUID4.10.0
ipVersionInteger 4.10.0
ipString 4.10.0
netmaskString 4.10.0
gatewayString 4.10.0
usedForString 4.10.0
ipInLonglong 4.10.0
vmNicUuidStringVirtual Machine NIC UUID4.10.0
createDateTimestampCreate date4.10.0
lastOpDateTimestampLast update date4.10.0

error

NameTypeDescriptionStarting Version
codeStringError code, a globally unique identifier of the error, e.g. SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, defaults to null0.6
opaqueLinkedHashMapReserved field, defaults to null0.6
causeErrorCodeRoot cause, the source error that caused the current error, null if no original error0.6

SDK Examples

Java SDK

ChangeVfNicHaStateAction action = new ChangeVfNicHaStateAction();
action.vfNicUuid = "8536b111015d3fd289907c5f53c80153";
action.haState = "Enabled";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeVfNicHaStateAction.Result res = action.call();

Python SDK

action = ChangeVfNicHaStateAction()
action.vfNicUuid = "8536b111015d3fd289907c5f53c80153"
action.haState = "Enabled"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()