Create VM Scheduling Group
Headers
Authorization: OAuth the-session-uuidBody
{
"params": {
"zoneUuid": "eae13168e86b3698807837ca88c3b2ae",
"name": "test",
"description": "test desc"
},
"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":{"zoneUuid":"eae13168e86b3698807837ca88c3b2ae","name":"test","description":"test desc"}}' http://localhost:8080/zstack/v1/vmSchedulingRuleGroupParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| zoneUuid | String | body (contained in the params structure) | Data Center UUID | 4.6.0 | |
| name | String | body (contained in the params structure) | Resource name | 4.6.0 | |
| description (optional) | String | body (contained in the params structure) | Detailed description of the resource | 4.6.0 | |
| resourceUuid (optional) | String | body (contained in the params structure) | Resource UUID | 4.6.0 | |
| tagUuids (optional) | List | body (contained in the params structure) | Tag UUID list | 4.6.0 | |
| systemTags (optional) | List | body | System tags | 4.6.0 | |
| userTags (optional) | List | body | User tags | 4.6.0 |
API Response
Response Example
{
"inventory": {
"uuid": "e79dc7a0170c31d18429c7478772c5d7",
"name": "test",
"description": "test desc",
"appliance": "CUSTOMER",
"zoneUuid": "e6a7cd7917473bedbfd420797d93ed50"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 4.6.0 | |
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 4.6.0 |
| inventory | AffinityGroupInventory | For details, see inventory | 4.6.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001 | 4.6.0 |
| description | String | Brief description of the error | 4.6.0 |
| details | String | Detailed information about the error | 4.6.0 |
| elaboration | String | Reserved field. Default is null | 4.6.0 |
| opaque | LinkedHashMap | Reserved field. Default is null | 4.6.0 |
| cause | ErrorCode | Root error. The source error that caused the current error. This field is null if no root error exists | 4.6.0 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource. Uniquely identifies the resource | 4.6.0 |
| name | String | Resource name | 4.6.0 |
| description | String | Detailed description of the resource | 4.6.0 |
| appliance | String | 4.6.0 | |
| zoneUuid | String | Data Center UUID | 4.6.0 |
| createDate | Timestamp | Creation time | 4.6.0 |
| lastOpDate | Timestamp | Last modification time | 4.6.0 |
SDK Examples
Java SDK
CreateVmSchedulingRuleGroupAction action = new CreateVmSchedulingRuleGroupAction();
action.zoneUuid = "eae13168e86b3698807837ca88c3b2ae";
action.name = "test";
action.description = "test desc";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateVmSchedulingRuleGroupAction.Result res = action.call();Python SDK
CreateVmSchedulingRuleGroupAction action = CreateVmSchedulingRuleGroupAction()
action.zoneUuid = "eae13168e86b3698807837ca88c3b2ae"
action.name = "test"
action.description = "test desc"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateVmSchedulingRuleGroupAction.Result res = action.call()