VM Related Interfaces
Update VM Priority
Headers
Authorization: OAuth the-session-uuidBody
{
"updateVmPriority": {
"priority": "High"
},
"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 '{"updateVmPriority":{"priority":"High"}}' http://localhost:8080/zstack/v1/vm-instances/f308c452113832df898fb62ea87b2afc/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | Resource UUID, uniquely identifies the resource | 3.7.0 | |
| priority | String | body (contained in updateVmPriority structure) | 3.7.0 | ||
| systemTags (Optional) | List | body | 3.7.0 | ||
| userTags (Optional) | List | body | 3.7.0 |
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
UpdateVmPriorityAction action = new UpdateVmPriorityAction();
action.uuid = "f308c452113832df898fb62ea87b2afc";
action.priority = "High";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateVmPriorityAction.Result res = action.call();Python SDK
UpdateVmPriorityAction action = UpdateVmPriorityAction()
action.uuid = "f308c452113832df898fb62ea87b2afc"
action.priority = "High"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateVmPriorityAction.Result res = action.call()