VM Related Interfaces

Set VM Monitor Number

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

Set the number of monitors supported by the Virtual Machine

Headers

Authorization: OAuth the-session-uuid

Body

{
  "setVmMonitorNumber": {
    "monitorNumber": 2.0
  },
  "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 '{"setVmMonitorNumber":{"monitorNumber":2.0}}' \
http://localhost:8080/zstack/v1/vm-instances/7cc2eec452593010bd2691f88385de7a/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlResource UUID, uniquely identifies the resource 2.2
monitorNumberIntegerbody (contained in setVmMonitorNumber structure)Number of monitors 2.2
systemTags (Optional)Listbody  2.2
userTags (Optional)Listbody  2.2

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

SetVmMonitorNumberAction action = new SetVmMonitorNumberAction();
action.uuid = "eb57f91af28a48dcbb6c56220a9b6d24";
action.monitorNumber = 2.0;
action.sessionId = "d8b870a03f97490fa6c39085cec24da7";
SetVmMonitorNumberAction.Result res = action.call();

Python SDK

SetVmMonitorNumberAction action = SetVmMonitorNumberAction()
action.uuid = "9a07d71b055e4da7a2f172e4cf7f337f"
action.monitorNumber = 2.0
action.sessionId = "56766234a9a54fe3b70c0e28b22fea5c"
SetVmMonitorNumberAction.Result res = action.call()