Document navigation

UpdateGuestToolsState

API Request

URLs

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

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateGuestToolsState": {},
  "systemTags": [],
  "userTags": []
}

In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.

Curl Sample

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

Required Parameters

Name Type Location Description Valid Values Starting Version
vmInstanceUuid String url The VM instance UUID. 4.6.21
systemTags List body Optional. The system tags. 4.6.21
userTags List body Optional. The user UUIDs. 4.6.21

API Response

Response Sample

{
  "inventory": {
    "vmInstanceUuid": "321e85ca08b335e09f172041f7e710b5",
    "qgaState": "Running",
    "zwatchState": "Running",
    "version": "4.6.11",
    "platform": "Kylin",
    "osType": "Kylin"
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.6.21
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.6.21
inventory GuestToolsStateInventory See inventory. 4.6.21

#error

Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.6.21
description String The brief description of the error. 4.6.21
details String The details about the error. 4.6.21
elaboration String The reserved field. Default value: null. 4.6.21
opaque LinkedHashMap The reserved field. Default value: null. 4.6.21
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.6.21

#inventory

Name Type Description Starting Version
vmInstanceUuid String The VM instance UUID. 4.6.21
version String The VM GuestTools version. 4.6.21
platform String The VM OS platform type. 4.6.21
osType String The VM OS type. 4.6.21
createDate Timestamp The creation date. 4.6.21
lastOpDate Timestamp The last operation date. 4.6.21
qgaState GuestToolsQgaState See qgaState. 4.6.21
zwatchState GuestToolsZWatchState See zwatchState. 4.6.21

#qgaState

Name Type Description Starting Version
NotInstalled GuestToolsQgaState The QGA is not installed. 4.6.21
Running GuestToolsQgaState The QGA is running. 4.6.21
NotRunning GuestToolsQgaState The QGA is stopped. 4.6.21
NotUpgraded GuestToolsQgaState The QGA needs to be upgraded. 4.6.21

#zwatchState

Name Type Description Starting Version
NotInstalled GuestToolsZWatchState The zwatch is not installed. 4.6.21
Running GuestToolsZWatchState The zwtach is running. 4.6.21
NotRunning GuestToolsZWatchState The zwatch is not running. 4.6.21

SDK Sample

Java SDK

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

Python SDK

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