VM Related Interfaces

Update Guest Tools State

PUT/zstack/v1/vm-instances/{vmInstanceUuid}/guesttools-state

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateGuestToolsState": {},
  "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 '{"updateGuestToolsState":{}}' \
http://localhost:8080/zstack/v1/vm-instances/5222bedcc3333b848b4cfb67e14bcc2d/guesttools-state

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
vmInstanceUuidStringurlVirtual Machine UUID 4.6.21
systemTags (Optional)ListbodySystem Tags 4.6.21
userTags (Optional)ListbodyUser Tags 4.6.21

API Response

Response Example

{
  "inventory": {
    "vmInstanceUuid": "321e85ca08b335e09f172041f7e710b5",
    "qgaState": "Running",
    "zwatchState": "Running",
    "version": "4.6.11",
    "platform": "Kylin",
    "osType": "Kylin"
  }
}
NameTypeDescriptionStarting Version
successboolean 4.6.21
errorErrorCodeError code. If not null, the operation failed. When the operation succeeds, this field is null. For details, see error4.6.21
inventoryGuestToolsStateInventoryFor details, see inventory4.6.21

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier of the error, for example SYS.1000, HOST.10014.6.21
descriptionStringBrief description of the error4.6.21
detailsStringDetailed error information4.6.21
elaborationStringReserved field, defaults to null4.6.21
opaqueLinkedHashMapReserved field, defaults to null4.6.21
causeErrorCodeRoot cause. The error that triggered the current error. If there is no original error, this field is null4.6.21

inventory

NameTypeDescriptionStarting Version
vmInstanceUuidStringVirtual Machine UUID4.6.21
versionStringVirtual Machine VMTools version4.6.21
platformStringVirtual Machine OS platform type4.6.21
osTypeStringVirtual Machine OS type4.6.21
createDateTimestampCreation time4.6.21
lastOpDateTimestampLast modification time4.6.21
qgaStateGuestToolsQgaStateFor details, see qgaState4.6.21
zwatchStateGuestToolsZWatchStateFor details, see zwatchState4.6.21

qgaState

NameTypeDescriptionStarting Version
NotInstalledGuestToolsQgaStateNot installed4.6.21
RunningGuestToolsQgaStateRunning4.6.21
NotRunningGuestToolsQgaStateStopped4.6.21
NotUpgradedGuestToolsQgaStatePending upgrade4.6.21

zwatchState

NameTypeDescriptionStarting Version
NotInstalledGuestToolsZWatchStateNot installed4.6.21
RunningGuestToolsZWatchStateRunning4.6.21
NotRunningGuestToolsZWatchStateNot running4.6.21

SDK Examples

Java SDK

UpdateGuestToolsStateAction action = new UpdateGuestToolsStateAction();
action.vmInstanceUuid = "5222bedcc3333b848b4cfb67e14bcc2d";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateGuestToolsStateAction.Result res = action.call();

Python SDK

UpdateGuestToolsStateAction action = UpdateGuestToolsStateAction()
action.vmInstanceUuid = "5222bedcc3333b848b4cfb67e14bcc2d"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateGuestToolsStateAction.Result res = action.call()