Update VM Scheduling Policy

PUT/zstack/v1/vmSchedulingRule/{uuid}/update

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateVmSchedulingRule": {
    "name": "new name",
    "description": "desc",
    "mode": "SOFT"
  },
  "systemTags": [],
  "userTags": []
}

The systemTags and userTags fields in the above example are optional. 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 '{"updateVmSchedulingRule":{"name":"new name","description":"desc","mode":"SOFT"}}' http://localhost:8080/zstack/v1/vmSchedulingRule/5c23ac3de87f33ff955430556e9d1104/update

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlUUID of the resource. Uniquely identifies the resource 4.6.0
name (optional)Stringbody (contained in the updateVmSchedulingRule structure)Resource name 4.6.0
description (optional)Stringbody (contained in the updateVmSchedulingRule structure)Detailed description of the resource 4.6.0
mode (optional)Stringbody (contained in the updateVmSchedulingRule structure)  4.6.0
systemTags (optional)ListbodySystem tags 4.6.0
userTags (optional)ListbodyUser tags 4.6.0

API Response

Response Example

{
  "inventory": {
    "rule": "AFFINITY",
    "mode": "SOFT",
    "uuid": "36f4174c0fcf3aefa24927f33aa2eba8",
    "name": "group",
    "description": "group for test",
    "policy": "ANTISOFT",
    "type": "HOST"
  }
}
NameTypeDescriptionStarting Version
successboolean 4.6.0
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error4.6.0
inventoryAffinityGroupInventoryFor details, see inventory4.6.0

error

NameTypeDescriptionStarting Version
codeStringError code number. A globally unique identifier for the error, for example, SYS.1000, HOST.10014.6.0
descriptionStringBrief description of the error4.6.0
detailsStringDetailed information about the error4.6.0
elaborationStringReserved field. Default is null4.6.0
opaqueLinkedHashMapReserved field. Default is null4.6.0
causeErrorCodeRoot error. The source error that caused the current error. This field is null if no root error exists4.6.0

inventory

NameTypeDescriptionStarting Version
ruleStringRule4.6.0
modeStringExecution mode4.6.0
uuidStringUUID of the resource. Uniquely identifies the resource4.6.0
nameStringResource name4.6.0
descriptionStringDetailed description of the resource4.6.0
policyString 4.6.0
versionString 4.6.0
typeString 4.6.0
applianceString 4.6.0
zoneUuidStringData Center UUID4.6.0
stateString 4.6.0
createDateTimestampCreation time4.6.0
lastOpDateTimestampLast modification time4.6.0
usagesListFor details, see usages4.6.0

usages

NameTypeDescriptionStarting Version
uuidStringUUID of the VM scheduling group-to-resource binding relationship4.6.0
affinityGroupUuidStringAffinity group UUID4.6.0
resourceUuidStringResource UUID4.6.0
resourceTypeStringResource type4.6.0
createDateTimestampCreation time4.6.0
lastOpDateTimestampLast modification time4.6.0

SDK Examples

Java SDK

UpdateVmSchedulingRuleAction action = new UpdateVmSchedulingRuleAction();
action.uuid = "5c23ac3de87f33ff955430556e9d1104";
action.name = "new name";
action.description = "desc";
action.mode = "SOFT";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateVmSchedulingRuleAction.Result res = action.call();

Python SDK

UpdateVmSchedulingRuleAction action = UpdateVmSchedulingRuleAction()
action.uuid = "5c23ac3de87f33ff955430556e9d1104"
action.name = "new name"
action.description = "desc"
action.mode = "SOFT"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateVmSchedulingRuleAction.Result res = action.call()