Job Scheduling
Overview
The schedulers and scheduled jobs are completely decoupled. You can create different scheduled jobs and schedulers with different rules as needed. You can also add a scheduled job to, or remove it from a scheduler. The operations on schedulers and scheduled jobs will be completely audited.
Inventory
Properties
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 2.1 | ||
| description | The detailed description of the resource. | Yes | 2.1 | |
| name | The resource name. | 2.1 | ||
| state | The state. |
|
2.1 | |
| targetResourceUuid | The UUID of the target resource. | 2.1 | ||
| createDate | The creation date. For more information, see Resource Property. | 2.1 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 2.1 |
Sample
{
"inventories": [],
"success": true
}
Operations
CreateSchedulerJob
Creates a scheduled job. For
example,
CreateSchedulerJob name=SchedulerJob1 targetResourceUuid=d672c98c9ea5416a83d15696f324368c \
type=startVmParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| name | The resource name. | 2.1 | ||
| description | The detailed description of the resource. | Yes | 2.1 | |
| targetResourceUuid | The UUID of the target resource. | 2.1 | ||
| type | The scheduled job type. |
|
4.3.0 | |
| parameters | Yes | 2.1 | ||
| resourceUuid | Yes | 2.1 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is SchedulerJobVO. | Yes | 2.1 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is SchedulerJobVO. | Yes | 2.1 | |
| timeout | Yes |
DeleteSchedulerJob
Deletes a scheduled job. For
example,
DeleteSchedulerJob uuid=94b1126b2cc44b5ea0e1d31026e24c9fParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 2.1 | ||
| deleteMode | The delete mode. For more information, see Delete Resources). | Yes |
|
2.1 |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is SchedulerJobVO. | Yes | 2.1 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is SchedulerJobVO. | Yes | 2.1 | |
| timeout | Yes |
QuerySchedulerJob
Queries a scheduled job. For
example,
QuerySchedulerJob uuid=04f512aa6cc3495bab23e677da4c9510QuerySchedulerJob trigger.uuid=d82d4ca2d4da407ebc5410e85d5dd256Primitive Fields of Query
See Scheduler Job Inventory.
Nested and Expanded Fields of Query
| Field | Inventory | Description | Starting Version |
|---|---|---|---|
| trigger | Trigger Inventory | 2.1 |
UpdateSchedulerJob
Updates a scheduled job. For
example,
UpdateSchedulerJob uuid=4ad3c66621924055a3db06917ed0d902Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 2.1 | ||
| name | The resource name. | Yes | 2.1 | |
| description | The detailed description of the resource. | Yes | 2.1 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is SchedulerJobVO. | Yes | 2.1 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is SchedulerJobVO. | Yes | 2.1 | |
| timeout | Yes |
CreateSchedulerTrigger
Creates a scheduler. For
example,
CreateSchedulerTrigger name=trigger schedulerType=simple startTime=1510329600 \
schedulerInterval=3600Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| name | The resource name. | 2.1 | ||
| description | The detailed description of the resource. | Yes | 2.1 | |
| schedulerInterval | Yes | 2.1 | ||
| repeatCount | Yes | 2.1 | ||
| startTime | The start time, which must be a Unix time. | Yes | 2.1 | |
| schedulerType |
|
2.1 | ||
| cron | Yes | 2.1 | ||
| resourceUuid | Yes | 2.1 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is SchedulerTriggerVO. | Yes | 2.1 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is SchedulerTriggerVO. | Yes | 2.1 | |
| timeout | Yes |
DeleleSchedulerTrigger
Deletes a scheduler. For
example,
DeleteSchedulerTrigger uuid=36cb56cbc7b946dbb4294dcf726db975Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 2.1 | ||
| deleteMode | The delete mode. For more information, see Delete Resources). | Yes |
|
2.1 |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is SchedulerTriggerVO. | Yes | 2.1 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is SchedulerTriggerVO. | Yes | 2.1 | |
| timeout | Yes |
QuerySchedulerTrigger
Queries a scheduler. For
example,
QuerySchedulerTrigger uuid=8a87a66ea1344ba2b918f49136505dbbQuerySchedulerTrigger job.uuid=fd347b4c3f144380bca9c0c5cdf7697dPrimitive Fields of Query
See Scheduler Trigger Inventory.
Nested and Expanded Fields of Query
| Field | Inventory | Description | Starting Version |
|---|---|---|---|
| job | Job Inventory | 2.1 |
UpdateSchedulerTrigger
Updates a scheduler. For
example,
UpdateSchedulerTrigger uuid=26a64811252b446ab97bd1559c27a630Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 2.1 | ||
| name | The resource name. | Yes | 2.1 | |
| description | The detailed description of the resource. | Yes | 2.1 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is SchedulerTriggerVO. | Yes | 2.1 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is SchedulerTriggerVO. | Yes | 2.1 | |
| timeout | Yes |
AddSchedulerJobToSchedulerTrigger
Adds a scheduled job to a scheduler. For
example,
AddSchedulerJobToSchedulerTrigger schedulerJobUuid=de40b48a63c04ec283f75dfed817b628 \
schedulerTriggerUuid=3a5de588a82f4f7d96658e87baa3ef6fParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| schedulerJobUuid | 2.1 | |||
| schedulerTriggerUuid | 2.1 | |||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.1 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.1 | |
| timeout | Yes |
RemoveSchedulerJobFromSchedulerTrigger
Removes a scheduled job from a scheduler. For
example,
RemoveSchedulerJobFromSchedulerTrigger schedulerJobUuid=de40b48a63c04ec283f75dfed817b628 \
schedulerTriggerUuid=3a5de588a82f4f7d96658e87baa3ef6fParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| schedulerJobUuid | 2.1 | |||
| schedulerTriggerUuid | 2.1 | |||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.1 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.1 | |
| timeout | Yes |
ChangeSchedulerState
Changes the state of a scheduled job. For
example,
ChangeSchedulerState uuid=d8601cf2081c4715a33e2d994e2f16d8 stateEvent=disableParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | 2.1 | |||
| stateEvent |
|
2.1 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is SchedulerTriggerVO. | Yes | 2.1 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is SchedulerTriggerVO. | Yes | 2.1 | |
| timeout | Yes |
GetNoTriggerSchedulerJobs
Obtains the scheduled jobs that are not added to a scheduler. For
example,
ChangeSchedulerState uuid=d8601cf2081c4715a33e2d994e2f16d8 stateEvent=disableParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| name | 2.3.2 | |||
| description | Yes | 2.3.2 | ||
| accessPointUuid | Yes | 2.3.2 | ||
| dataCenterUuid | 2.3.2 | |||
| vRouterUuid | 2.3.2 | |||
| resourceUuid | Yes | 2.3.2 | ||
| routerType |
|
2.3.2 | ||
| spec | Yes | 2.3.2 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is SchedulerTriggerVO. | Yes | 2.1 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is SchedulerTriggerVO. | Yes | 2.1 | |
| timeout | Yes |
Tags
You can create a user tag on a scheduler by using CreateUserTag
resourceType=SchedulerJobVO. For
example,
CreateUserTag resourceType=SchedulerJobVO tag=Test1 \
resourceUuid=3214e0dcd01d4e2aa8407968e1ccreatee51d58