diff --git a/api-docs/apiLive.htm b/api-docs/apiLive.htm index abc6cbd70..25787d567 100644 --- a/api-docs/apiLive.htm +++ b/api-docs/apiLive.htm @@ -1148,6 +1148,62 @@ + + Scheduler jobs + jobs + + List Scheduler jobs + + + + + + jobs/{jobId} + + Retrieve a job + Update a job + + + + + jobs/{jobId}?command=executeJob + Run a job + + + + + + + jobs/{jobid}/runhistory?offset=0&limit=200 + + Retrieve job history + + + + + + scheduler + + Retrieve scheduler status + + + + + + scheduler?command=start + Activate a scheduler service + + + + + + + scheduler?command=stop + Suspend a scheduler service + + + + @@ -9520,8 +9576,322 @@ Content-Type: application/json { "auditId": 1 } + + +   +
+
+

MIFOSX-BATCH JOBS

+

Batch jobs (also known as cron jobs on Unix-based systems) are a series of back-end jobs executed on a computer at a particular time defined in job's cron expression. +

+ +

At any point, you can view the list of batch jobs scheduled to run along with other details specific to each job. Manually you can execute the jobs at any point of time. +

+

The scheduler status can be either "Active" or "Standby". If the scheduler status is Active, it indicates that all batch jobs are running/ will run as per the specified schedule.If the scheduler status is Standby, it will ensure all scheduled batch runs are suspended. +

+
+
+ +   +
+
+

Retrieve Scheduler Jobs

+

Returns the list of jobs.

+

Example Requests:

+
jobs
+
+
+ +GET https://DomainName/api/v1/jobs + + +[ + { + "jobId": 1, + "displayName": "Update loan Summary", + "cronExpression": "0 0 22 1/1 * ? *", + "active": false, + "currentlyRunning": false, + "lastRunHistory": { + "version": 17, + "jobRunStartTime": "Jul 26, 2013 1:38:26 PM", + "jobRunEndTime": "Jul 26, 2013 1:38:26 PM", + "status": "success", + "triggerType": "application" + } + }, + { + "jobId": 2, + "displayName": "Update Loan Arrears Ageing", + "nextRunTime": "Jul 27, 2013 12:01:00 AM", + "cronExpression": "0 1 0 1/1 * ? *", + "active": true, + "currentlyRunning": false, + "lastRunHistory": { + "version": 18, + "jobRunStartTime": "Jul 26, 2013 4:05:32 PM", + "jobRunEndTime": "Jul 26, 2013 4:05:32 PM", + "status": "success", + "triggerType": "application" + } + }, + { + "jobId": 3, + "displayName": "Update Loan Paid In Advance", + "nextRunTime": "Jul 27, 2013 12:05:00 AM", + "cronExpression": "0 5 0 1/1 * ? *", + "active": true, + "currentlyRunning": false, + "lastRunHistory": { + "version": 16, + "jobRunStartTime": "Jul 26, 2013 4:15:47 PM", + "jobRunEndTime": "Jul 26, 2013 4:15:47 PM", + "status": "success", + "triggerType": "application" + } + }, + { + "jobId": 4, + "displayName": "Apply Annual Fee For Savings", + "nextRunTime": "Jul 26, 2013 10:20:00 PM", + "cronExpression": "0 20 22 1/1 * ? *", + "active": true, + "currentlyRunning": false, + "lastRunHistory": { + "version": 11, + "jobRunStartTime": "Jul 26, 2013 12:00:37 PM", + "jobRunEndTime": "Jul 26, 2013 12:00:38 PM", + "status": "success + "triggerType": "application" + } + }, + { + "jobId": 5, + "displayName": "Apply Holidays To Loans", + "nextRunTime": "Jul 27, 2013 12:00:00 PM", + "cronExpression": "0 0 12 * * ?", + "active": true, + "currentlyRunning": false, + "lastRunHistory": { + "version": 16, + "jobRunStartTime": "Jul 26, 2013 4:31:54 PM", + "jobRunEndTime": "Jul 26, 2013 4:31:55 PM", + "status": "success", + "triggerType": "application" + } + } +] - + +
+
+ +   +
+
+

Retrieve a Job

+

Returns the details of a Job.

+

Example Requests:

+
jobs/5
+
+
+ +GET https://DomainName/api/v1/jobs/{jobId} + + +https://localhost:8443/mifosng-provider/api/v1/jobs/5 +{ + "jobId": 5, + "displayName": "Apply Holidays To Loans", + "nextRunTime": "Jul 27, 2013 12:00:00 PM", + "cronExpression": "0 0 12 * * ?", + "active": true, + "currentlyRunning": false, + "lastRunHistory": { + "version": 16, + "jobRunStartTime": "Jul 26, 2013 4:31:54 PM", + "jobRunEndTime": "Jul 26, 2013 4:31:55 PM", + "status": "success", + "triggerType": "application" + } +} + +
+
+ +   +
+
+

Update a Job

+

Updates the details of a job.

+
+
+ +PUT https://DomainName/api/v1/jobs/{jobId} + + +PUT jobs/1 +Content-Type: application/json +{ + "displayName":"Update loan Summary", + "cronExpression":"0 0 22 1/1 * ? *", + "active":"true" +} +
+
+ +   +
+
+

Run a Job

+

Manually Execute Specific Job.

+
+
+ +POST https://DomainName/api/v1/jobs/{jobId}?command=executeJob + + +POST jobs/1?command=executeJob + +
+
+ +   +
+
+

Retrieve Job Run History

+

Example Requests:

+
jobs/5/runhistory?offset=0&limit=200
+
+
+ +GET https://DomainName/api/v1/jobs/{jobid}/runhistory?offset=0&limit=200 + + +{ + "totalFilteredRecords": 8, + "pageItems": [ + { + "version": 1, + "jobRunStartTime": "Jul 16, 2013 12:00:00 PM", + "jobRunEndTime": "Jul 16, 2013 12:00:00 PM", + "status": "success", + "triggerType": "cron" + }, + { + "version": 2, + "jobRunStartTime": "Jul 17, 2013 12:00:00 PM", + "jobRunEndTime": "Jul 17, 2013 12:00:00 PM", + "status": "success", + "triggerType": "cron" + }, + { + "version": 3, + "jobRunStartTime": "Jul 18, 2013 12:00:00 PM", + "jobRunEndTime": "Jul 18, 2013 12:00:01 PM", + "status": "success", + "triggerType": "cron" + }, + { + "version": 4, + "jobRunStartTime": "Jul 19, 2013 12:00:00 PM", + "jobRunEndTime": "Jul 19, 2013 12:00:00 PM", + "status": "success", + "triggerType": "cron" + }, + { + "version": 5, + "jobRunStartTime": "Jul 20, 2013 11:16:07 AM", + "jobRunEndTime": "Jul 20, 2013 11:16:07 AM", + "status": "success", + "triggerType": "application" + }, + { + "version": 6, + "jobRunStartTime": "Jul 20, 2013 11:35:05 AM", + "jobRunEndTime": "Jul 20, 2013 11:35:05 AM", + "status": "success", + "triggerType": "application" + }, + { + "version": 7, + "jobRunStartTime": "Jul 20, 2013 12:00:00 PM", + "jobRunEndTime": "Jul 20, 2013 12:00:00 PM", + "status": "success", + "triggerType": "cron" + }, + { + "version": 8, + "jobRunStartTime": "Jul 22, 2013 12:00:00 PM", + "jobRunEndTime": "Jul 22, 2013 12:00:00 PM", + "status": "success", + "triggerType": "cron" + } + ] +} + +
+
+ +   +
+
+

Retrieve Scheduler Status

+

Returns the scheduler status.

+

Example Requests:

+
scheduler
+
+
+ +GET https://DomainName/api/v1/scheduler + + +https://localhost:8443/mifosng-provider/api/v1/scheduler +{ + "active": true +} + +
+
+ +   +
+
+

Activate Scheduler Jobs

+

Activates the scheduler job service.

+
+
+ +POST https://DomainName/api/v1/scheduler?command=start + + +POST scheduler?command=start + +
+
+ +   +
+
+

Suspend Scheduler Jobs

+

Suspends the scheduler job service.

+
+
+ +POST https://DomainName/api/v1/scheduler?command=stop + + +POST scheduler?command=stop + +
+
  @@ -17415,7 +17785,63 @@ GET https://DomainName/api/v1/search?query=000000111 - + + + Scheduler jobs + jobs + + List Scheduler jobs + + + + + + jobs/{jobId} + + Retrieve a job + Update a job + + + + + jobs/{jobId}?command=executeJob + Run a job + + + + + + + jobs/{jobid}/runhistory?offset=0&limit=200 + + Retrieve job history + + + + + + scheduler + + Retrieve scheduler status + + + + + + scheduler?command=start + Activate a scheduler service + + + + + + + scheduler?command=stop + Suspend a scheduler service + + + +