API schedule - RapturePlatform/Rapture GitHub Wiki
The methods in this API control the scheduler function in a Rapture implementation.
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
RaptureJob retVal = scheduleApi.createJob(jobURI, description, scriptURI, cronExpression, timeZone, jobParams, autoActivate);
retVal = baseAPI.doSchedule_CreateJob(jobURI, description, scriptURI, cronExpression, timeZone, jobParams, autoActivate);
Entitlement: /admin/schedule
Creates a new job. The executableURI should point to a RaptureScript. A job needs to be activated for it be available for execution. A job can be either auto-activate (i.e. it is activated, then de-activated while it runs, then activated on completion. OR it can be not-auto-activate, whereupon it needs to be activatedmanually, by either a predecessor job (a job that has this job as a dependency) or manually via the activate schedule API call.
Parameter | Type | Description |
---|---|---|
jobURI | String | |
description | String | |
scriptURI | String | |
cronExpression | String | |
timeZone | String | |
jobParams | Map<String,String> | |
autoActivate | boolean |
Type | Description |
---|---|
RaptureJob |
Contains info for a script-driven job in Rapture.
Field | Type |
---|---|
jobURI | JobURI |
description | String |
scriptURI | ScriptURI |
cronSpec | String |
timeZone | String |
params | Map<String, String> |
autoActivate | Boolean |
activated | Boolean |
jobType | JobType |
maxRuntimeMinutes | Integer |
appStatusNamePattern | String |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
RaptureJob retVal = scheduleApi.createWorkflowJob(jobURI, description, workflowURI, cronExpression, timeZone, jobParams, autoActivate, maxRuntimeMinutes, appStatusNamePattern);
retVal = baseAPI.doSchedule_CreateWorkflowJob(jobURI, description, workflowURI, cronExpression, timeZone, jobParams, autoActivate, maxRuntimeMinutes, appStatusNamePattern);
Entitlement: /admin/schedule
Creates a new Workflow-based job. The executableURI should point to a Workflow. A WorkOrder will be createdwhen the job is executed. The jobParams will be passed in to the Workflow as the contextMap.The maxRuntimeMinutes will be used to throw alerts when the job runs longer than expected.A job needs to be activated for it be available for execution. A job can be either auto-activate (i.e. it is activated, then de-activated while it runs, then activated on completion. OR it can be not-auto-activate, whereupon it needs to be activatedmanually, by either a predecessor job (a job that has this job as a dependency) or manually via the activate schedule API call.
Parameter | Type | Description |
---|---|---|
jobURI | String | |
description | String | |
workflowURI | String | |
cronExpression | String | |
timeZone | String | |
jobParams | Map<String,String> | |
autoActivate | boolean | |
maxRuntimeMinutes | int | |
appStatusNamePattern | String |
Type | Description |
---|---|
RaptureJob |
Contains info for a script-driven job in Rapture.
Field | Type |
---|---|
jobURI | JobURI |
description | String |
scriptURI | ScriptURI |
cronSpec | String |
timeZone | String |
params | Map<String, String> |
autoActivate | Boolean |
activated | Boolean |
jobType | JobType |
maxRuntimeMinutes | Integer |
appStatusNamePattern | String |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
void retVal = scheduleApi.activateJob(jobURI, extraParams);
retVal = baseAPI.doSchedule_ActivateJob(jobURI, extraParams);
Entitlement: /admin/schedule
Activate a job (usually that is not auto-activate). This means that the job will now be picked up by the scheduler and executed at whatever time it is configured to run.
Parameter | Type | Description |
---|---|---|
jobURI | String | |
extraParams | Map<String,String> |
Type | Description |
---|---|
void |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
void retVal = scheduleApi.deactivateJob(jobURI);
retVal = baseAPI.doSchedule_DeactivateJob(jobURI);
Entitlement: /admin/schedule
Turns off a job's schedule-based execution.
Parameter | Type | Description |
---|---|---|
jobURI | String |
Type | Description |
---|---|
void |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
RaptureJob retVal = scheduleApi.retrieveJob(jobURI);
retVal = baseAPI.doSchedule_RetrieveJob(jobURI);
Entitlement: /admin/schedule
Retrieve the definition of a job given its URI.
Parameter | Type | Description |
---|---|---|
jobURI | String |
Type | Description |
---|---|
RaptureJob |
Contains info for a script-driven job in Rapture.
Field | Type |
---|---|
jobURI | JobURI |
description | String |
scriptURI | ScriptURI |
cronSpec | String |
timeZone | String |
params | Map<String, String> |
autoActivate | Boolean |
activated | Boolean |
jobType | JobType |
maxRuntimeMinutes | Integer |
appStatusNamePattern | String |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
List<RaptureJob> retVal = scheduleApi.retrieveJobs(uriPrefix);
retVal = baseAPI.doSchedule_RetrieveJobs(uriPrefix);
Entitlement: /admin/schedule
Retrieve the definition of all jobs in the system whose uri starts with a certain prefix (e.g job://my/jobs/date1)
Parameter | Type | Description |
---|---|---|
uriPrefix | String |
Type | Description |
---|---|
List |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
void retVal = scheduleApi.runJobNow(jobURI, extraParams);
retVal = baseAPI.doSchedule_RunJobNow(jobURI, extraParams);
Entitlement: /admin/schedule
Try to schedule this job to run as soon as possible.
Parameter | Type | Description |
---|---|---|
jobURI | String | |
extraParams | Map<String,String> |
Type | Description |
---|---|
void |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
void retVal = scheduleApi.resetJob(jobURI);
retVal = baseAPI.doSchedule_ResetJob(jobURI);
Entitlement: /admin/schedule
Removes the upcoming scheduled execution of this job and schedules it to run according to the cron in the job configuration.
Parameter | Type | Description |
---|---|---|
jobURI | String |
Type | Description |
---|---|
void |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
RaptureJobExec retVal = scheduleApi.retrieveJobExec(jobURI, execTime);
retVal = baseAPI.doSchedule_RetrieveJobExec(jobURI, execTime);
Entitlement: /admin/schedule
Retrieves the execution of a job.
Parameter | Type | Description |
---|---|---|
jobURI | String | |
execTime | Long |
Type | Description |
---|---|
RaptureJobExec |
Contains info about an active or queued job.
Field | Type |
---|---|
jobURI | JobURI |
jobType | JobType |
status | JobExecStatus |
execTime | Long |
passedParams | Map<String, String> |
execDetails | String |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
void retVal = scheduleApi.deleteJob(jobURI);
retVal = baseAPI.doSchedule_DeleteJob(jobURI);
Entitlement: /admin/schedule
Removes a job from the system.
Parameter | Type | Description |
---|---|---|
jobURI | String |
Type | Description |
---|---|
void |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
List<String> retVal = scheduleApi.getJobs();
retVal = baseAPI.doSchedule_GetJobs();
Entitlement: /admin/schedule
Retrieves all of the JobURI addresses of the jobs in the system.
This function takes no parameters.
Type | Description |
---|---|
List |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
List<RaptureJobExec> retVal = scheduleApi.getUpcomingJobs();
retVal = baseAPI.doSchedule_GetUpcomingJobs();
Entitlement: /admin/schedule
Retrieves all of the upcoming jobs in the system.
This function takes no parameters.
Type | Description |
---|---|
List |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
WorkflowExecsStatus retVal = scheduleApi.getWorkflowExecsStatus();
retVal = baseAPI.doSchedule_GetWorkflowExecsStatus();
Entitlement: /admin/schedule
Retrieves the status of all current workflow-based job executions. This looks into the last execution as well as upcoming execution for all scheduled jobs. The return object contains a list of jobs that succeeded, failed, are overrun, or are ok (i.e. either scheduled to start in the future or currently running but not overrun). For failed or overrun jobs, information is also returned as to whether the failure/overrun has been acknowledged. See also ackJobError.
This function takes no parameters.
Type | Description |
---|---|
WorkflowExecsStatus |
The status for a workflow-based job that's already completed.
Field | Type |
---|---|
failed | List |
ok | List |
overrun | List |
success | List |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
JobErrorAck retVal = scheduleApi.ackJobError(jobURI, execTime, jobErrorType);
retVal = baseAPI.doSchedule_AckJobError(jobURI, execTime, jobErrorType);
Entitlement: /admin/schedule
Acknowledges a job failure, storing the acknowledgment in Rapture. This information is returned when retrieving job statuses. See also getWorkflowExecsStatus.
Parameter | Type | Description |
---|---|---|
jobURI | String | |
execTime | Long | |
jobErrorType | String |
Type | Description |
---|---|
JobErrorAck |
Acknowledgement of a job failure or delay.
Field | Type |
---|---|
jobURI | JobURI |
execTime | Long |
errorType | JobErrorType |
timestamp | Long |
user | String |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
RaptureJobExec retVal = scheduleApi.getNextExec(jobURI);
retVal = baseAPI.doSchedule_GetNextExec(jobURI);
Entitlement: /admin/schedule
Gets the next execution time for a given job.
Parameter | Type | Description |
---|---|---|
jobURI | String |
Type | Description |
---|---|
RaptureJobExec |
Contains info about an active or queued job.
Field | Type |
---|---|
jobURI | JobURI |
jobType | JobType |
status | JobExecStatus |
execTime | Long |
passedParams | Map<String, String> |
execDetails | String |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
List<RaptureJobExec> retVal = scheduleApi.getJobExecs(jobURI, start, count, reversed);
retVal = baseAPI.doSchedule_GetJobExecs(jobURI, start, count, reversed);
Entitlement: /admin/schedule
Retrieves a list of job executions in a given range.
Parameter | Type | Description |
---|---|---|
jobURI | String | |
start | int | |
count | int | |
reversed | boolean |
Type | Description |
---|---|
List |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
List<RaptureJobExec> retVal = scheduleApi.batchGetJobExecs(jobURI, start, count, reversed);
retVal = baseAPI.doSchedule_BatchGetJobExecs(jobURI, start, count, reversed);
Entitlement: /admin/schedule
Retrieve a list of job executions for a list of jobs. This will return the job executions starting at index start (inclusive), and going onfor count. If reverse is true, it starts from the end.
Parameter | Type | Description |
---|---|---|
jobURI | List | |
start | int | |
count | int | |
reversed | boolean |
Type | Description |
---|---|
List |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
boolean retVal = scheduleApi.isJobReadyToRun(toJobURI);
retVal = baseAPI.doSchedule_IsJobReadyToRun(toJobURI);
Entitlement: /admin/schedule
Return whether the given job is ready to run.
Parameter | Type | Description |
---|---|---|
toJobURI | String |
Type | Description |
---|---|
boolean |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
List<TimedEventRecord> retVal = scheduleApi.getCurrentWeekTimeRecords(weekOffsetfromNow);
retVal = baseAPI.doSchedule_GetCurrentWeekTimeRecords(weekOffsetfromNow);
Entitlement: /admin/schedule
For TimeServer, get a list of scheduled events for this week (starts on Sunday, use offset to look at next week)
Parameter | Type | Description |
---|---|---|
weekOffsetfromNow | int |
Type | Description |
---|---|
List |
HttpScheduleApi scheduleApi = new HttpScheduleApi(loginApi);
List<TimedEventRecord> retVal = scheduleApi.getCurrentDayJobs();
retVal = baseAPI.doSchedule_GetCurrentDayJobs();
Entitlement: /admin/schedule
For TimeServer, get a list of scheduled jobs for the current day
This function takes no parameters.
Type | Description |
---|---|
List |