Skip to main content
Pentaho Documentation

Scheduler Resource

Provides information on web service calls to create, run, and delete jobs.  Calls for getting images, statuses and for starting and stopping jobs are also included.

The SchedulerResource service provides the means to create, read, update, delete, and list schedules. Also provides the ability to control the status of schedules and scheduler.

The following resources are applicable:

  • /scheduler/canSchedule
  • /scheduler/getJobs
  • /scheduler/isScheduleAllowed
  • /scheduler/job
  • /scheduler/jobinfo
  • /scheduler/jobState
  • /scheduler/pause
  • /scheduler/pauseJob
  • /scheduler/removeJob
  • /scheduler/resumeJob
  • /scheduler/shutdown
  • /scheduler/start
  • /scheduler/state
  • /scheduler/triggerNow

/scheduler/canSchedule

GET

Checks whether the current user has authority to schedule any content in the platform.

Example Request:

GET /pentaho/api/scheduler/canSchedule

Response Body

element: (custom)
media types: text/plain

True or false. True indicates scheduling is allowed and false indicates scheduling is not allowed for the user.

Example Response:

true

Status Codes

code description
200 Successful retrieved the scheduling permission.
500 Unable to retrieve the scheduling permission.

/scheduler/getJobs

GET

Retrieve the all the scheduled job(s) visible to the current users.

Example Request:

GET /pentaho/api/scheduler/getJobs

Response Body

element: (custom)
media types: application/xml
application/json

A list of jobs that are visible to the current users.

Example Response:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jobs>
<job>
<groupName>admin</groupName>
<jobId>admin    PentahoSystemVersionCheck    1432541178746</jobId>
<jobName>PentahoSystemVersionCheck</jobName>
<jobParams>
<jobParams>
<name>ActionAdapterQuartzJob-ActionUser</name>
<value>admin</value>
</jobParams>
<jobParams>
<name>ActionAdapterQuartzJob-ActionClass</name>
<value>org.pentaho.platform.scheduler2.versionchecker.VersionCheckerAction</value>
</jobParams>
<jobParams>
<name>lineage-id</name>
<value>e4698e0a-5c54-43b3-bedd-cfda594d02e2</value>
</jobParams>
<jobParams>
<name>versionRequestFlags</name>
<value>0</value>
</jobParams>
</jobParams>
<jobTrigger xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="simpleJobTrigger">
<duration>-1</duration>
<startTime>2015-05-25T05:06:18.744-03:00</startTime>
<repeatCount>-1</repeatCount>
<repeatInterval>86400</repeatInterval>
</jobTrigger>
<lastRun>2015-05-28T05:06:18.744-03:00</lastRun>
<nextRun>2015-05-29T05:06:18.744-03:00</nextRun>
<state>NORMAL</state>
<userName>admin</userName>
</job>
</jobs>

Status Codes

code description
200 Jobs retrieved successfully.
500 Error while retrieving jobs.

/scheduler/isScheduleAllowed

GET

Checks whether the current user may schedule a repository file in the platform.

Example Request:

GET /pentaho/api/scheduler/isScheduleAllowed?id=b5f806b9-9f72-4814-b1e0-aa9e0ece7e1a

Parameters

name description type
id The repository file ID of the content to checked. query

Response Body

element: (custom)
media types: text/plain

True or false. True indicates scheduling is allowed and false indicates scheduling is not allowed for the file.

Example Response:

true

Status Codes

code description
200 Successfully retrieved scheduling ability of repository file.
500 Invalid repository file id.

/scheduler/job

POST

Creates a new scheduled job.

Example Request:

POST /pentaho/api/scheduler/job

POST data:

<jobScheduleRequest>
<jobName>JobName</jobName>
<simpleJobTrigger>
<uiPassParam>MINUTES</uiPassParam>
<repeatInterval>1800</repeatInterval>
<repeatCount>-1</repeatCount>
<startTime>2014-08-14T11:46:00.000-04:00</startTime>
<endTime />
</simpleJobTrigger>
<inputFile>/public/jmeter-test-dir/test.kjb</inputFile>
<outputFile>/public/jmeter-test-dir/output</outputFile>
<jobParameters>
<name>ParameterName</name>
<type>string</type>
<stringValue>false</stringValue>
</jobParameters>
</jobScheduleRequest>

Request Body

element: jobScheduleRequest
media types: application/xml
application/json

A JobScheduleRequest object to define the parameters of the job being created.

Response Body

element: (custom)
media types: text/plain

A jax-rs Response object with the created jobId.

Example Response:

admin	JobName	1410786491777

Status Codes

code description
200 Schedule created successfully.
401 User is not allowed to create schedules.
403 Cannot create schedules for the specified file.
500 An error occurred while creating a schedule.

/scheduler/jobinfo

GET

Return the information for a specified job.

Example Request:

GET /pentaho/api/scheduler/jobinfo?jobId=admin%09JobName%091432820285983

Parameters

name description type
jobId The jobId of the job for which we are requesting information. query
asCronString Cron string (Unused) query

Response Body

element: job
media types: application/xml
application/json

A Job object containing the info for the specified job.

Example Response:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<job>
<jobId>admin    JobName    1432820285983</jobId>
<jobName>JobName</jobName>
<jobParams>
<jobParams>
<name>uiPassParam</name>
<value>MINUTES</value>
</jobParams>
<jobParams>
<name>ActionAdapterQuartzJob-StreamProvider</name>
<value>input file = /public/jmeter-test-dir/test.kjb:outputFile = /home/admin/JobName.*</value>
</jobParams>
<jobParams>
<name>directory</name>
<value>public/jmeter-test-dir</value>
</jobParams>
<jobParams>
<name>user_locale</name>
<value>en_US</value>
</jobParams>
<jobParams>
<name>job</name>
<value>test</value>
</jobParams>
<jobParams>
<name>ActionAdapterQuartzJob-ActionUser</name>
<value>admin</value>
</jobParams>
<jobParams>
<name>parameters</name>
<value>{ParameterName=false}</value>
</jobParams>
<jobParams>
<name>ActionAdapterQuartzJob-ActionId</name>
<value>kjb.backgroundExecution</value>
</jobParams>
<jobParams>
<name>lineage-id</name>
<value>6d3b98bb-50f9-458f-ac5b-ff78fcc132b3</value>
</jobParams>
</jobParams>
<jobTrigger xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="simpleJobTrigger">
<duration>-1</duration>
<startTime>2014-08-14T18:46:00+03:00</startTime>
<uiPassParam>MINUTES</uiPassParam>
<repeatCount>-1</repeatCount>
<repeatInterval>1800</repeatInterval>
</jobTrigger>
<nextRun>2014-08-14T18:46:00+03:00</nextRun>
<state>NORMAL</state>
<userName>admin</userName>
</job>   
      

Status Codes

code description
200 Successfully retrieved the information for the requested job.
500 Invalid jobId.

/scheduler/jobState

POST

Checks the state of the selected scheduled job.

Example Request:

POST /pentaho/api/scheduler/jobState

POST data:

<jobRequest>
<jobId>admin	JobName	1410786491777</jobId>
</jobRequest>

Request Body

element: jobRequest
media types: application/xml
application/json

A JobRequest object containing the jobId.

Response Body

element: (custom)
media types: text/plain

A jax-rs Response object containing the status of the scheduled job.

Example Response:

NORMAL

Status Codes

code description
200 Successfully retrieved the state of the requested job.
500 Invalid jobId.

/scheduler/pause

POST

Pause the scheduler from a running state.

Example Request:

POST /pentaho/api/scheduler/pause

POST data:

This POST body does not contain data.

Response Body

element: (custom)
media types: text/plain

A jax-rs Response object containing the status of the scheduler.

Example Response:

PAUSED

Status Codes

code description
200 Successfully paused the server.
500 An error occurred when pausing the scheduler.

/scheduler/pauseJob

POST

Pause the specified scheduled job.

Example Request:

POST /pentaho/api/scheduler/pauseJob

POST data:

<jobRequest>
<jobId>admin	JobName	1410786491777</jobId>
</jobRequest>

Request Body

element:  
media types: application/xml
application/json

A JobRequest object containing the jobId.

Response Body

element: (custom)
media types: text/plain

A jax-rs Response object containing the status of the scheduled job.

Example Response:

PAUSED

Status Codes

code description
200 Successfully paused the job.
500 Invalid jobId.

/scheduler/removeJob

DELETE

Delete the specified scheduled job from the platform.

Example Request:

DELETE /pentaho/api/scheduler/removeJob

DELETE data:

<jobRequest>
<jobId>admin	BlockoutAction	1410786491503</jobId>
</jobRequest>

Request Body

element:  
media types: application/xml
application/json

A JobRequest object containing the jobId.

Response Body

element: (custom)
media types: text/plain

A jax-rs Response object containing the status of the scheduled job.

Example Response:

REMOVED

Status Codes

code description
200 Successfully removed the job.
500 Invalid jobId.

/scheduler/resumeJob

POST

Resume the specified scheduled job.

Example Request:

POST /pentaho/api/scheduler/resumeJob

POST data:

<jobRequest>
<jobId>admin	JobName	1410786491777</jobId>
</jobRequest>

Request Body

element: jobRequest
media types: application/xml
application/json

A JobRequest object containing the jobId.

Response Body

element: (custom)
media types: text/plain

A jax-rs Response object containing the status of the scheduled job.

Example Response:

NORMAL

Status Codes

code description
200 Successfully resumed the job.
500 Invalid jobId.

/scheduler/shutdown

POST

Shuts down the scheduler.

Example Request:

POST /pentaho/api/scheduler/shutdown

POST data:

This POST body does not contain data.

Response Body

element: (custom)
media types: text/plain

A jax-rs Response object containing the status of the scheduler.

Example Response:

PAUSED

Status Codes

code description
200 Successfully shut down the server.
500 An error occurred when shutting down the scheduler.

/scheduler/start

POST

Resume the scheduler from a paused state.

Example Request:

POST /pentaho/api/scheduler/start

POST data:

This POST body does not contain data.

Response Body

element: (custom)
media types: text/plain

A jax-rs Response object containing the status of the scheduler.

Example Response:

RUNNING

Status Codes

code description
200 Successfully started the server.
500 An error occurred when resuming the scheduler.

/scheduler/state

GET

Returns the state of the scheduler with the value of RUNNING or PAUSED.

Example Request:

GET /pentaho/api/scheduler/state

Response Body

element: (custom)
media types: text/plain

Status of the scheduler as RUNNING or PAUSED.

Example Response:

RUNNING

Status Codes

code description
200 Successfully retrieved the state of the scheduler.
500 An error occurred when getting the state of the scheduler.

/scheduler/triggerNow

POST

Execute a previously scheduled job.

Example Request:

POST /pentaho/api/scheduler/triggerNow

POST data:

<jobRequest>
<jobId>admin	JobName	1410786491777</jobId>
</jobRequest>

Request Body

element: jobRequest
media types: application/xml
application/json

A JobRequest object containing the jobId.

Response Body

element: (custom)
media types: text/plain

A Response object indicating the status of the scheduler.

Example Response:

NORMAL

Status Codes

code description
200 Job triggered successfully.
400 Invalid input.
500 Invalid jobId.

Copyright © Pentaho.com