Create a Scheduler Job Group

POST/zstack/v1/scheduler/jobgroups

Headers

Authorization: OAuth the-session-uuid

Body

{
  "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/jobgroups

Parameter 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

  • startVm
  • stopVm
  • rebootVm
  • volumeSnapshot
  • volumeBackup
  • vmBackup
  • databaseBackup
  • runAutoScalingGroup
  • addIAM2ProjectLoginExpired
  • cancleIAM2ProjectLoginExpired

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"
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error3.4.0
inventorySchedulerJobInventoryFor details, see inventory3.4.0

error

NameTypeDescriptionStarting Version
codeStringError code number. The globally unique identifier of the error, for example, SYS.1000 or HOST.10013.4.0
descriptionStringBrief description of the error3.4.0
detailsStringDetailed information about the error3.4.0
elaborationStringReserved field. Default is null3.4.0
opaqueLinkedHashMapReserved field. Default is null3.4.0
causeErrorCodeRoot error. The source error that caused the current error. This field is null if there is no source error3.4.0

inventory

NameTypeDescriptionStarting Version
uuidStringResource UUID. Uniquely identifies the resource3.4.0
targetResourceUuidString 3.4.0
nameStringResource name3.4.0
descriptionStringDetailed description of the resource3.4.0
stateString 3.4.0
createDateTimestampCreation time3.4.0
lastOpDateTimestampLast modification time3.4.0
triggersUuidList 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()