Create Host Scheduling Group

POST/zstack/v1/hostSchedulingRuleGroup

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "name": "test",
    "description": "test desc",
    "zoneUuid": "4e083eaa197835778fa94d9bfcf012d6",
    "clusterUuid": "e7127ff00fbb3ed3a9755c37447b7bf8"
  },
  "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 POST -d '{"params":{"name":"test","description":"test desc","zoneUuid":"4e083eaa197835778fa94d9bfcf012d6","clusterUuid":"e7127ff00fbb3ed3a9755c37447b7bf8"}}' http://localhost:8080/zstack/v1/hostSchedulingRuleGroup

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
nameStringbody (contained in the params structure)Resource name 4.6.0
description (optional)Stringbody (contained in the params structure)Detailed description of the resource 4.6.0
zoneUuidStringbody (contained in the params structure)Data Center UUID 4.6.0
clusterUuidStringbody (contained in the params structure)Cluster UUID 4.6.0
resourceUuid (optional)Stringbody (contained in the params structure)Resource UUID 4.6.0
tagUuids (optional)Listbody (contained in the params structure)Tag UUID list 4.6.0
systemTags (optional)ListbodySystem tags 4.6.0
userTags (optional)ListbodyUser tags 4.6.0

API Response

Response Example

{
  "inventory": {
    "name": "test",
    "description": "test desc",
    "zoneUuid": "1eca7fc3081a3750b55930b194d82991",
    "clusterUuid": "e73c4aa3e6a03ee3bb4f325ab3b395b1"
  }
}
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
uuidStringUUID of the resource. Uniquely identifies the resource4.6.0
nameStringResource name4.6.0
descriptionStringDetailed description of the resource4.6.0
zoneUuidStringData Center UUID4.6.0
clusterUuidStringCluster UUID4.6.0
createDateTimestampCreation time4.6.0
lastOpDateTimestampLast modification time4.6.0

SDK Examples

Java SDK

CreateHostSchedulingRuleGroupAction action = new CreateHostSchedulingRuleGroupAction();
action.name = "test";
action.description = "test desc";
action.zoneUuid = "4e083eaa197835778fa94d9bfcf012d6";
action.clusterUuid = "e7127ff00fbb3ed3a9755c37447b7bf8";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateHostSchedulingRuleGroupAction.Result res = action.call();

Python SDK

CreateHostSchedulingRuleGroupAction action = CreateHostSchedulingRuleGroupAction()
action.name = "test"
action.description = "test desc"
action.zoneUuid = "4e083eaa197835778fa94d9bfcf012d6"
action.clusterUuid = "e7127ff00fbb3ed3a9755c37447b7bf8"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateHostSchedulingRuleGroupAction.Result res = action.call()