SetVmMonitorNumber
API Request
URLs
PUT zstack/v1/vm-instances/{uuid}/actionsHeaders
Authorization: OAuth the-session-uuidBody
{
"setVmMonitorNumber": {
"monitorNumber": 2.0
},
"systemTags": [],
"userTags": []
}
Note: 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 '{"setVmMonitorNumber":{"monitorNumber":2.0}}' \
http://localhost:8080/zstack/v1/vm-instances/7cc2eec452593010bd2691f88385de7a/actionsRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 2.2 | |
| monitorNumber | Integer | body (contained in the setVmMonitorNumber structure) | The number of monitors. | 2.2 | |
| systemTags | List | body | Optional. The system tags. | 2.2 | |
| userTags | List | body | Optional. The user tags. | 2.2 |
API Response
When the API succeeded, an empty JSON structure {} is returned. When the API
failed, the returned JSON structure includes 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 Sample
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()