Create a Scheduler Job Group
Headers
Authorization: OAuth the-session-uuidBody
{
"params": {
"name": "job",
"description": "description",
"type": "startVm"
},
"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":"job","description":"description","type":"startVm"}}' http://localhost:8080/zstack/v1/scheduler/jobgroupsParameter List
Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
name | String | body (included in the params structure) | Resource name |
| 3.4.0 |
description (optional) | String | body (included in the params structure) | Detailed description of the resource |
| 3.4.0 |
type | String | body (included in the params structure) | Scheduler job type |
| 4.3.0 |
parameters (optional) | Map | body (included in the params structure) | Scheduler job parameters |
| 3.4.0 |
resourceUuid (optional) | String | body (included in the params structure) | Resource UUID |
| 3.4.0 |
tagUuids (optional) | List | body (included in the params structure) | Tag UUID list |
| 3.4.0 |
systemTags (optional) | List | body | System tag list |
| 3.4.0 |
userTags (optional) | List | body | User tag list |
| 3.4.0 |
API Response
Response Example
{
"inventory": {
"uuid": "0cd85a37bb88346c8c2d122913d812df",
"targetResourceUuid": "c458e0fb141932d0a87af999b0d0ab81",
"name": "SchedulerJob",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 3.4.0 |
| inventory | SchedulerJobInventory | For details, see inventory | 3.4.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number. The globally unique identifier of the error, for example, SYS.1000 or HOST.1001 | 3.4.0 |
| description | String | Brief description of the error | 3.4.0 |
| details | String | Detailed information about the error | 3.4.0 |
| elaboration | String | Reserved field. Default is null | 3.4.0 |
| opaque | LinkedHashMap | Reserved field. Default is null | 3.4.0 |
| cause | ErrorCode | Root error. The source error that caused the current error. This field is null if there is no source error | 3.4.0 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID. Uniquely identifies the resource | 3.4.0 |
| targetResourceUuid | String | 3.4.0 | |
| name | String | Resource name | 3.4.0 |
| description | String | Detailed description of the resource | 3.4.0 |
| state | String | 3.4.0 | |
| createDate | Timestamp | Creation time | 3.4.0 |
| lastOpDate | Timestamp | Last modification time | 3.4.0 |
| triggersUuid | List | 3.4.0 |
SDK Examples
Java SDK
CreateSchedulerJobGroupAction action = new CreateSchedulerJobGroupAction();
action.name = "job";
action.description = "description";
action.type = "startVm";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSchedulerJobGroupAction.Result res = action.call();Python SDK
CreateSchedulerJobGroupAction action = CreateSchedulerJobGroupAction()
action.name = "job"
action.description = "description"
action.type = "startVm"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSchedulerJobGroupAction.Result res = action.call()