VM Related Interfaces

Set VM Qga

PUT/zstack/v1/vm-instances/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "setVmQga": {
    "enable": false
  },
  "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 '{"setVmQga":{"enable":false}}' \
http://localhost:8080/zstack/v1/vm-instances/8f37ceee285c3418b28247388508601a/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlResource UUID, uniquely identifies the resource 0.6
enablebooleanbody (contained in params structure)  0.6
systemTags (Optional)Listbody  0.6
userTags (Optional)Listbody  0.6

API Response

On success, this API returns an empty JSON structure {}. On error, the returned JSON structure contains an error field. For example:

{
  "error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
  }
}

SDK Examples

Java SDK

SetVmQgaAction action = new SetVmQgaAction();
action.uuid = "771991c9b47f45a392bddeadba95ab2b";
action.enable = false;
action.sessionId = "6dc45ce48e8345f89c8487bb9a5180f8";
SetVmQgaAction.Result res = action.call();

Python SDK

SetVmQgaAction action = SetVmQgaAction()
action.uuid = "084bb6e8ecd9497fb261049cce04b116"
action.enable = false
action.sessionId = "5e78bf8076a84933928ee8d2ef04eca9"
SetVmQgaAction.Result res = action.call()