Class SchedulerResource
- java.lang.Object
-
- org.pentaho.platform.web.http.api.resources.AbstractJaxRSResource
-
- org.pentaho.platform.web.http.api.resources.SchedulerResource
-
public class SchedulerResource extends AbstractJaxRSResource
The SchedulerResource service provides the means to create, read, update, delete, and list schedules and blockout periods. Also provides the ability to control the status of schedules and the scheduler.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.commons.logging.Log
logger
protected SchedulerService
schedulerService
-
Fields inherited from class org.pentaho.platform.web.http.api.resources.AbstractJaxRSResource
acceptableMediaTypes, httpServletRequest, httpServletResponse, TEXT_HTML
-
-
Constructor Summary
Constructors Constructor Description SchedulerResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description javax.ws.rs.core.Response
addBlockout(JobScheduleRequest jobScheduleRequest)
Creates a new blockout for scheduled jobs.javax.ws.rs.core.Response
blockoutWillFire(JobScheduleRequest jobScheduleRequest)
Checks if the selected blockout schedule will be fired.protected javax.ws.rs.core.Response
buildOkResponse(Object entity)
protected javax.ws.rs.core.Response
buildPlainTextOkResponse(String msg)
protected javax.ws.rs.core.Response
buildPlainTextStatusResponse(javax.ws.rs.core.Response.Status status)
protected javax.ws.rs.core.Response
buildServerErrorResponse(Object entity)
protected javax.ws.rs.core.Response
buildStatusResponse(javax.ws.rs.core.Response.Status status)
protected org.pentaho.platform.api.scheduler2.IJobTrigger
convertScheduleRequestToJobTrigger(JobScheduleRequest request)
javax.ws.rs.core.Response
createJob(JobScheduleRequest scheduleRequest)
Creates a new scheduled job.javax.ws.rs.core.Response
deleteJob(JobRequest jobRequest)
Delete the specified scheduled job from the platform.String
doGetCanSchedule()
Checks whether the current user has authority to schedule any content in the platform.List<org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDto>
doGetGeneratedContentForSchedule(String lineageId)
Retrieve the list of execute content by lineage id.List<org.pentaho.platform.api.scheduler2.Job>
getAllJobs()
Retrieve the all the scheduled job(s) visible to the current users.List<org.pentaho.platform.api.scheduler2.Job>
getBlockoutJobs()
Get all the blockout jobs in the system.javax.ws.rs.core.Response
getBlockStatus(JobScheduleRequest jobScheduleRequest)
Check the status of the selected blockout schedule.org.pentaho.platform.api.scheduler2.Job
getContentCleanerJob()
Get the scheduled job created by the system for deleting generated files.javax.ws.rs.core.Response
getJob(String jobId, String asCronString)
Return the information for a specified job.JobScheduleRequest
getJobInfo()
Deprecated.protected JobRequest
getJobRequest()
List<org.pentaho.platform.api.scheduler2.Job>
getJobs()
Deprecated.Method is deprecated as the name getBlockoutJobs is preferred over getJobs Retrieves all blockout jobs in the systemList<org.pentaho.platform.api.scheduler2.Job>
getJobs(Boolean asCronString)
Deprecated.javax.ws.rs.core.Response
getJobState(JobRequest jobRequest)
Checks the state of the selected scheduled job.javax.ws.rs.core.Response
getState()
Returns the state of the scheduler with the value of RUNNING or PAUSED.javax.ws.rs.core.Response
hasBlockouts()
Checks if there are blockouts in the system.String
isScheduleAllowed(String id)
Checks whether the current user may schedule a repository file in the platform.javax.ws.rs.core.Response
pause()
Pause the scheduler from a running state.javax.ws.rs.core.Response
pauseJob(JobRequest jobRequest)
Pause the specified scheduled job.javax.ws.rs.core.Response
removeJob(JobRequest jobRequest)
Deprecated.javax.ws.rs.core.Response
resumeJob(JobRequest jobRequest)
Resume the specified scheduled job.javax.ws.rs.core.Response
shouldFireNow()
Checks if the selected blockout schedule should be fired now.javax.ws.rs.core.Response
shutdown()
Shuts down the scheduler.javax.ws.rs.core.Response
start()
Resume the scheduler from a paused state.javax.ws.rs.core.Response
triggerNow(JobRequest jobRequest)
Execute a previously scheduled job.javax.ws.rs.core.Response
updateBlockout(String jobId, JobScheduleRequest jobScheduleRequest)
Update an existing blockout.javax.ws.rs.core.Response
updateJob(JobScheduleRequest scheduleRequest)
Changes an existing job by creating an instance with new content (picked fromscheduleRequest
) and removing the current instance.-
Methods inherited from class org.pentaho.platform.web.http.api.resources.AbstractJaxRSResource
setHttpHeaders
-
-
-
-
Field Detail
-
schedulerService
protected SchedulerService schedulerService
-
logger
protected static final org.apache.commons.logging.Log logger
-
-
Method Detail
-
createJob
public javax.ws.rs.core.Response createJob(JobScheduleRequest scheduleRequest)
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/Steel Wheels/Top Customers (report).prpt</inputFile> <outputFile>/public/output</outputFile> <jobParameters> <name>ParameterName</name> <type>string</type> <stringValue>false</stringValue> </jobParameters> </jobScheduleRequest>
- Parameters:
scheduleRequest
- A JobScheduleRequest object to define the parameters of the job being created.- Returns:
- A jax-rs Response object with the created jobId.
Example Response:
admin JobName 1410786491777
-
updateJob
public javax.ws.rs.core.Response updateJob(JobScheduleRequest scheduleRequest)
Changes an existing job by creating an instance with new content (picked fromscheduleRequest
) and removing the current instance.Example Request:
POST pentaho/api/scheduler/job/edit
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/Steel Wheels/Top Customers (report).prpt</inputFile> <outputFile>/public/output</outputFile> <jobParameters> <name>ParameterName</name> <type>string</type> <stringValue>false</stringValue> </jobParameters> </jobScheduleRequest> </jobId>
- Parameters:
scheduleRequest
- A JobScheduleRequest object to define the parameters of the job being updated.- Returns:
- A jax-rs Response object with the created jobId.
Example Response:
admin JobName 1410786491777
-
triggerNow
public javax.ws.rs.core.Response triggerNow(JobRequest jobRequest)
Execute a previously scheduled job.Example Request:
POST pentaho/api/scheduler/triggerNow
POST data:<jobRequest> <jobId>admin JobName 1410786491777</jobId> </jobRequest>
- Parameters:
jobRequest
- A JobRequest object containing the jobId.- Returns:
- A Response object indicating the status of the scheduler.
Example Response:
NORMAL
-
getContentCleanerJob
public org.pentaho.platform.api.scheduler2.Job getContentCleanerJob()
Get the scheduled job created by the system for deleting generated files.Example Request:
GET pentaho/api/scheduler/getContentCleanerJob- Returns:
- A Job object containing the definition of the content cleaner job.
Example Response:
<job> <groupName>admin</groupName> <jobId>admin GeneratedContentCleaner 1408377444383</jobId> <jobName>GeneratedContentCleaner</jobName> <jobParams> <jobParams> <name>uiPassParam</name> <value>DAILY</value> </jobParams> <jobParams> <name>age</name> <value>15552000</value> </jobParams> <jobParams> <name>user_locale</name> <value>en_US</value> </jobParams> <jobParams> <name>ActionAdapterQuartzJob-ActionUser</name> <value>admin</value> </jobParams> <jobParams> <name>ActionAdapterQuartzJob-ActionClass</name> <value>org.pentaho.platform.admin.GeneratedContentCleaner</value> </jobParams> <jobParams> <name>lineage-id</name> <value>c3cfbad4-2e34-4dbd-8071-a2f3c7e8fab9</value> </jobParams> </jobParams> <jobTrigger xsi:type="simpleJobTrigger"> <duration>-1</duration> <startTime>2014-08-18T11:57:00-04:00</startTime> <uiPassParam>DAILY</uiPassParam> <repeatCount>-1</repeatCount> <repeatInterval>86400</repeatInterval> </jobTrigger> <lastRun>2014-08-18T11:57:00-04:00</lastRun> <nextRun>2014-08-19T11:57:00-04:00</nextRun> <state>NORMAL</state> <userName>admin</userName> </job>
-
getJobs
@Deprecated public List<org.pentaho.platform.api.scheduler2.Job> getJobs(Boolean asCronString)
Deprecated.Retrieve the all the job(s) visible to the current users.Example Request:
GET pentaho/api/scheduler/jobs- Parameters:
asCronString
- Cron string (Unused).- Returns:
- A list of jobs that are visible to the current users.
Example Response:
<jobs> <job> <groupName>admin</groupName> <jobId>admin PentahoSystemVersionCheck 1408369303507</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>1986cc90-cf87-43f6-8924-9d6e443e7d5d</value> </jobParams> <jobParams> <name>versionRequestFlags</name> <value>0</value> </jobParams> </jobParams> <jobTrigger xsi:type="simpleJobTrigger"> <duration>-1</duration> <startTime>2014-08-18T09:41:43.506-04:00</startTime> <repeatCount>-1</repeatCount> <repeatInterval>86400</repeatInterval> </jobTrigger> <lastRun>2014-08-18T11:37:31.412-04:00</lastRun> <nextRun>2014-08-19T09:41:43.506-04:00</nextRun> <state>NORMAL</state> <userName>admin</userName> </job> <job> <groupName>admin</groupName> <jobId>admin UpdateAuditData 1408373019115</jobId> <jobName>UpdateAuditData</jobName> <jobParams> <jobParams> <name>autoCreateUniqueFilename</name> <value>false</value> </jobParams> <jobParams> <name>uiPassParam</name> <value>MINUTES</value> </jobParams> <jobParams> <name>ActionAdapterQuartzJob-StreamProvider</name> <value>input file = /public/pentaho-operations-mart/update_audit_mart_data/UpdateAuditData.xaction:outputFile = /public/pentaho-operations-mart/generated_logs/UpdateAuditData.*</value> </jobParams> <jobParams> <name>user_locale</name> <value>en_US</value> </jobParams> <jobParams> <name>ActionAdapterQuartzJob-ActionUser</name> <value>admin</value> </jobParams> <jobParams> <name>ActionAdapterQuartzJob-ActionId</name> <value>xaction.backgroundExecution</value> </jobParams> <jobParams> <name>lineage-id</name> <value>1f2402c4-0a70-40e4-b428-0d328f504cb3</value> </jobParams> </jobParams> <jobTrigger xsi:type="simpleJobTrigger"> <duration>-1</duration> <startTime>2014-07-14T12:47:00-04:00</startTime> <uiPassParam>MINUTES</uiPassParam> <repeatCount>-1</repeatCount> <repeatInterval>1800</repeatInterval> </jobTrigger> <lastRun>2014-08-18T12:47:00-04:00</lastRun> <nextRun>2014-08-18T13:17:00-04:00</nextRun> <state>NORMAL</state> <userName>admin</userName> </job> </jobs>
-
getAllJobs
public List<org.pentaho.platform.api.scheduler2.Job> getAllJobs()
Retrieve the all the scheduled job(s) visible to the current users.Example Request:
GET pentaho/api/scheduler/getJobs- Returns:
- A list of jobs that are visible to the current users.
Example Response:
<jobs> <job> <groupName>admin</groupName> <jobId>admin PentahoSystemVersionCheck 1408369303507</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>1986cc90-cf87-43f6-8924-9d6e443e7d5d</value> </jobParams> <jobParams> <name>versionRequestFlags</name> <value>0</value> </jobParams> </jobParams> <jobTrigger xsi:type="simpleJobTrigger"> <duration>-1</duration> <startTime>2014-08-18T09:41:43.506-04:00</startTime> <repeatCount>-1</repeatCount> <repeatInterval>86400</repeatInterval> </jobTrigger> <lastRun>2014-08-18T11:37:31.412-04:00</lastRun> <nextRun>2014-08-19T09:41:43.506-04:00</nextRun> <state>NORMAL</state> <userName>admin</userName> </job> <job> <groupName>admin</groupName> <jobId>admin UpdateAuditData 1408373019115</jobId> <jobName>UpdateAuditData</jobName> <jobParams> <jobParams> <name>autoCreateUniqueFilename</name> <value>false</value> </jobParams> <jobParams> <name>uiPassParam</name> <value>MINUTES</value> </jobParams> <jobParams> <name>ActionAdapterQuartzJob-StreamProvider</name> <value>input file = /public/pentaho-operations-mart/update_audit_mart_data/UpdateAuditData.xaction:outputFile = /public/pentaho-operations-mart/generated_logs/UpdateAuditData.*</value> </jobParams> <jobParams> <name>user_locale</name> <value>en_US</value> </jobParams> <jobParams> <name>ActionAdapterQuartzJob-ActionUser</name> <value>admin</value> </jobParams> <jobParams> <name>ActionAdapterQuartzJob-ActionId</name> <value>xaction.backgroundExecution</value> </jobParams> <jobParams> <name>lineage-id</name> <value>1f2402c4-0a70-40e4-b428-0d328f504cb3</value> </jobParams> </jobParams> <jobTrigger xsi:type="simpleJobTrigger"> <duration>-1</duration> <startTime>2014-07-14T12:47:00-04:00</startTime> <uiPassParam>MINUTES</uiPassParam> <repeatCount>-1</repeatCount> <repeatInterval>1800</repeatInterval> </jobTrigger> <lastRun>2014-08-18T12:47:00-04:00</lastRun> <nextRun>2014-08-18T13:17:00-04:00</nextRun> <state>NORMAL</state> <userName>admin</userName> </job> </jobs>
-
isScheduleAllowed
public String isScheduleAllowed(String id)
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:
id
- The repository file ID of the content to checked.- Returns:
- true or false. true indicates scheduling is allowed and false indicates scheduling is not allowed for the file.
Example Response:
true
-
doGetCanSchedule
public String doGetCanSchedule()
Checks whether the current user has authority to schedule any content in the platform.Example Request:
GET pentaho/api/scheduler/canSchedule- Returns:
- true or false. true indicates scheduling is allowed and false indicates scheduling is not allowed for the user.
Example Response:
true
-
getState
public javax.ws.rs.core.Response getState()
Returns the state of the scheduler with the value of RUNNING or PAUSED.Example Request:
GET pentaho/api/scheduler/state- Returns:
- status of the scheduler as RUNNING or PAUSED.
Example Response:
RUNNING
-
start
public javax.ws.rs.core.Response start()
Resume the scheduler from a paused state.Example Request:
POST pentaho/api/scheduler/start
POST data:This POST body does not contain data.
- Returns:
- A jax-rs Response object containing the status of the scheduler.
Example Response:
RUNNING
-
pause
public javax.ws.rs.core.Response pause()
Pause the scheduler from a running state.Example Request:
POST pentaho/api/scheduler/pause
POST data:This POST body does not contain data.
- Returns:
- A jax-rs Response object containing the status of the scheduler.
Example Response:
PAUSED
-
shutdown
public javax.ws.rs.core.Response shutdown()
Shuts down the scheduler.Example Request:
POST pentaho/api/scheduler/shutdown
POST data:This POST body does not contain data.
- Returns:
- A jax-rs Response object containing the status of the scheduler.
Example Response:
PAUSED
-
getJobState
public javax.ws.rs.core.Response getJobState(JobRequest jobRequest)
Checks the state of the selected scheduled job.Example Request:
POST pentaho/api/scheduler/jobState
POST data:<jobRequest> <jobId>admin JobName 1410786491777</jobId> </jobRequest>
- Parameters:
jobRequest
- A JobRequest object containing the jobId.- Returns:
- A jax-rs Response object containing the status of the scheduled job.
Example Response:
NORMAL
-
pauseJob
public javax.ws.rs.core.Response pauseJob(JobRequest jobRequest)
Pause the specified scheduled job.Example Request:
POST pentaho/api/scheduler/pauseJob
POST data:<jobRequest> <jobId>admin JobName 1410786491777</jobId> </jobRequest>
- Parameters:
jobRequest
- A JobRequest object containing the jobId.- Returns:
- A jax-rs Response object containing the status of the scheduled job.
Example Response:
PAUSED
-
resumeJob
public javax.ws.rs.core.Response resumeJob(JobRequest jobRequest)
Resume the specified scheduled job.Example Request:
POST pentaho/api/scheduler/resumeJob
POST data:<jobRequest> <jobId>admin JobName 1410786491777</jobId> </jobRequest>
- Parameters:
jobRequest
- A JobRequest object containing the jobId.- Returns:
- A jax-rs Response object containing the status of the scheduled job.
Example Response:
NORMAL
-
removeJob
@Deprecated public javax.ws.rs.core.Response removeJob(JobRequest jobRequest)
Deprecated.Delete the specified scheduled job from the platform.Example Request:
DELETE pentaho/api/scheduler/removeJob
DELETE data:<jobRequest> <jobId>admin BlockoutAction 1410786491503</jobId> </jobRequest>
- Parameters:
jobRequest
- A JobRequest object containing the jobId.- Returns:
- A jax-rs Response object containing the status of the scheduled job.
Example Response:
REMOVED
-
deleteJob
public javax.ws.rs.core.Response deleteJob(JobRequest jobRequest)
Delete the specified scheduled job from the platform.Example Request:
PUT pentaho/api/scheduler/removeJob
PUT data:<jobRequest> <jobId>admin BlockoutAction 1410786491503</jobId> </jobRequest>
- Parameters:
jobRequest
- A JobRequest object containing the jobId.- Returns:
- A jax-rs Response object containing the status of the scheduled job.
Example Response:
REMOVED
-
getJob
public javax.ws.rs.core.Response getJob(String jobId, String asCronString)
Return the information for a specified job.Example Request:
GET pentaho/api/scheduler/jobinfo?jobId=admin%09JobName%091410786491777- Parameters:
jobId
- The jobId of the job for which we are requesting information.asCronString
- Cron string (Unused)- Returns:
- 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 1410786491777</jobId><jobName>JobName</jobName><jobParams><jobParams><name>uiPassParam</name><value>MINUTES</value></jobParams><jobParams><name>ActionAdapterQuartzJob-StreamProvider</name><value>input file = /public/Steel Wheels/Top Customers (report).prpt:outputFile = /home/admin/JobName.*</value></jobParams><jobParams><name>user_locale</name><value>en_US</value></jobParams><jobParams><name>ActionAdapterQuartzJob-ActionUser</name><value>admin</value></jobParams><jobParams><name>ActionAdapterQuartzJob-ActionId</name><value>prpt.backgroundExecution</value></jobParams><jobParams><name>ParameterName</name><value>false</value></jobParams><jobParams><name>lineage-id</name><value>5212a120-3294-49e8-9c5d-c755b9766c43</value></jobParams></jobParams><jobTrigger xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="simpleJobTrigger"><duration>-1</duration><startTime>2014-08-14T11:46:00-04:00</startTime><uiPassParam>MINUTES</uiPassParam><repeatCount>-1</repeatCount><repeatInterval>1800</repeatInterval></jobTrigger><nextRun>2014-08-14T11:46:00-04:00</nextRun><state>NORMAL</state><userName>admin</userName></job>
-
getJobInfo
@Deprecated public JobScheduleRequest getJobInfo()
Deprecated.
-
getJobs
@Deprecated public List<org.pentaho.platform.api.scheduler2.Job> getJobs()
Deprecated.Method is deprecated as the name getBlockoutJobs is preferred over getJobs Retrieves all blockout jobs in the system- Returns:
- list of Job
-
getBlockoutJobs
public List<org.pentaho.platform.api.scheduler2.Job> getBlockoutJobs()
Get all the blockout jobs in the system.Example Request:
GET pentaho/api/scheduler/blockout/blockoutjobs- Returns:
- A Response object that contains a list of blockout jobs.
Example Response:
<jobs> <job> <groupName>admin</groupName> <jobId>admin BlockoutAction 1408457558636</jobId> <jobName>BlockoutAction</jobName> <jobParams> <jobParams> <name>TIME_ZONE_PARAM</name> <value>America/New_York</value> </jobParams> <jobParams> <name>DURATION_PARAM</name> <value>10080000</value> </jobParams> <jobParams> <name>uiPassParam</name> <value>DAILY</value> </jobParams> <jobParams> <name>user_locale</name> <value>en_US</value> </jobParams> <jobParams> <name>ActionAdapterQuartzJob-ActionUser</name> <value>admin</value> </jobParams> <jobParams> <name>ActionAdapterQuartzJob-ActionClass</name> <value>org.pentaho.platform.scheduler2.blockout.BlockoutAction</value> </jobParams> <jobParams> <name>lineage-id</name> <value>0989726c-3247-4864-bc79-8e2a1dc60c58</value> </jobParams> </jobParams> <jobTrigger xsi:type="complexJobTrigger"> <cronString>0 12 10 ? * 2,3,4,5,6 *</cronString> <duration>10080000</duration> <startTime>2014-08-19T10:12:00-04:00</startTime> <uiPassParam>DAILY</uiPassParam> <dayOfMonthRecurrences /> <dayOfWeekRecurrences> <recurrenceList> <values>2</values> <values>3</values> <values>4</values> <values>5</values> <values>6</values> </recurrenceList> </dayOfWeekRecurrences> <hourlyRecurrences> <recurrenceList> <values>10</values> </recurrenceList> </hourlyRecurrences> <minuteRecurrences> <recurrenceList> <values>12</values> </recurrenceList> </minuteRecurrences> <monthlyRecurrences /> <secondRecurrences> <recurrenceList> <values>0</values> </recurrenceList> </secondRecurrences> <yearlyRecurrences /> </jobTrigger> <nextRun>2014-08-20T10:12:00-04:00</nextRun> <state>NORMAL</state> <userName>admin</userName> </job> </jobs>
-
hasBlockouts
public javax.ws.rs.core.Response hasBlockouts()
Checks if there are blockouts in the system.Example Request:
GET pentaho/api/scheduler/blockout/hasblockouts- Returns:
- true or false whether there are blackouts or not.
Example Response:
true
-
addBlockout
public javax.ws.rs.core.Response addBlockout(JobScheduleRequest jobScheduleRequest)
Creates a new blockout for scheduled jobs.Example Request:
POST pentaho/api/scheduler/blockout/add
POST data:<jobScheduleRequest> <jobName>DAILY-1820438815:admin:7740000</jobName> <complexJobTrigger> <uiPassParam>DAILY</uiPassParam> <daysOfWeek>1</daysOfWeek> <daysOfWeek>2</daysOfWeek> <daysOfWeek>3</daysOfWeek> <daysOfWeek>4</daysOfWeek> <daysOfWeek>5</daysOfWeek> <startTime>2014-08-19T10:51:00.000-04:00</startTime> <endTime /> </complexJobTrigger> <inputFile></inputFile> <outputFile></outputFile> <duration>7740000</duration> <timeZone>America/New_York</timeZone> </jobScheduleRequest>
- Parameters:
jobScheduleRequest
- A JobScheduleRequest object defining the blockout job.- Returns:
- A Response object which contains the ID of the blockout which was created.
Example Response:
admin BlockoutAction 1410786491209
-
updateBlockout
public javax.ws.rs.core.Response updateBlockout(String jobId, JobScheduleRequest jobScheduleRequest)
Update an existing blockout.Example Request:
POST pentaho/api/scheduler/blockout/update?jobid=admin%09BlockoutAction%091410786491209
POST data:<jobScheduleRequest> <jobName>DAILY-1820438815:admin:7740000</jobName> <complexJobTrigger> <uiPassParam>DAILY</uiPassParam> <daysOfWeek>1</daysOfWeek> <daysOfWeek>2</daysOfWeek> <daysOfWeek>3</daysOfWeek> <daysOfWeek>4</daysOfWeek> <daysOfWeek>5</daysOfWeek> <startTime>2012-01-12T10:51:00.000-04:00</startTime> <endTime /> </complexJobTrigger> <inputFile></inputFile> <outputFile></outputFile> <duration>7740000</duration> <timeZone>America/New_York</timeZone> </jobScheduleRequest>
- Parameters:
jobId
- The jobId of the blockout we are editing.jobScheduleRequest
- The payload containing the definition of the blockout.- Returns:
- A Response object which contains the ID of the blockout which was created.
Example Response:
admin BlockoutAction 1410786491503
-
blockoutWillFire
public javax.ws.rs.core.Response blockoutWillFire(JobScheduleRequest jobScheduleRequest)
Checks if the selected blockout schedule will be fired.Example Request:
POST pentaho/api/scheduler/blockout/willFire
POST data:<jobScheduleRequest> <jobName>DAILY-1820438815:admin:7740000</jobName> <complexJobTrigger> <uiPassParam>DAILY</uiPassParam> <daysOfWeek>1</daysOfWeek> <daysOfWeek>2</daysOfWeek> <daysOfWeek>3</daysOfWeek> <daysOfWeek>4</daysOfWeek> <daysOfWeek>5</daysOfWeek> <startTime>2014-08-19T10:51:00.000-04:00</startTime> <endTime /> </complexJobTrigger> <inputFile></inputFile> <outputFile></outputFile> <duration>7740000</duration> <timeZone>America/New_York</timeZone> </jobScheduleRequest>
- Parameters:
jobScheduleRequest
- The payload containing the definition of the blockout.- Returns:
- true or false indicating whether or not the blockout will fire.
Example Response:
false
-
shouldFireNow
public javax.ws.rs.core.Response shouldFireNow()
Checks if the selected blockout schedule should be fired now.Example Request:
GET pentaho/api/scheduler/blockout/shouldFireNow- Returns:
- true or false whether or not the blockout should fire now.
Example Response:
true
-
getBlockStatus
public javax.ws.rs.core.Response getBlockStatus(JobScheduleRequest jobScheduleRequest)
Check the status of the selected blockout schedule.Example Request:
POST pentaho/api/scheduler/blockout/blockstatus
POST data:<jobScheduleRequest> <jobName>DAILY-1820438815:admin:7740000</jobName> <complexJobTrigger> <uiPassParam>DAILY</uiPassParam> <daysOfWeek>1</daysOfWeek> <daysOfWeek>2</daysOfWeek> <daysOfWeek>3</daysOfWeek> <daysOfWeek>4</daysOfWeek> <daysOfWeek>5</daysOfWeek> <startTime>2014-08-19T10:51:00.000-04:00</startTime> <endTime /> </complexJobTrigger> <inputFile></inputFile> <outputFile></outputFile> <duration>7740000</duration> <timeZone>America/New_York</timeZone> </jobScheduleRequest>
- Parameters:
jobScheduleRequest
- The payload containing the definition of the blockout.- Returns:
- A Response object which contains a BlockStatusProxy which contains totallyBlocked and partiallyBlocked flags.
Example Response:
<blockStatusProxy> <partiallyBlocked>true</partiallyBlocked> <totallyBlocked>true</totallyBlocked> </blockStatusProxy>
-
doGetGeneratedContentForSchedule
public List<org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDto> doGetGeneratedContentForSchedule(String lineageId)
Retrieve the list of execute content by lineage id.Example Request:
GET pentaho/api/scheduler/generatedContentForSchedule?lineageId=:public:Steel%20Wheels:Inventory%20List%20(report).prpt- Parameters:
lineageId
- the path for the file.- Returns:
- A list of RepositoryFileDto objects.
Example Response:
<List> <repositoryFileDto> <createdDate>1402911997019</createdDate> <fileSize>3461</fileSize> <folder>false</folder> <hidden>false</hidden> <id>ff11ac89-7eda-4c03-aab1-e27f9048fd38</id> <lastModifiedDate>1406647160536</lastModifiedDate> <locale>en</locale> <localePropertiesMapEntries> <localeMapDto> <locale>default</locale> <properties> <stringKeyStringValueDto> <key>file.title</key> <value>myFile</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>jcr:primaryType</key> <value>nt:unstructured</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>title</key> <value>myFile</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>file.description</key> <value>myFile Description</value> </stringKeyStringValueDto> </properties> </localeMapDto> </localePropertiesMapEntries> <locked>false</locked> <name>myFile.prpt</name></name> <originalParentFolderPath>/public/admin</originalParentFolderPath> <ownerType>-1</ownerType> <path>/public/admin/ff11ac89-7eda-4c03-aab1-e27f9048fd38</path> <title>myFile</title> <versionId>1.9</versionId> <versioned>true</versioned> </repositoryFileAclDto> </List>
-
buildOkResponse
protected javax.ws.rs.core.Response buildOkResponse(Object entity)
-
buildPlainTextOkResponse
protected javax.ws.rs.core.Response buildPlainTextOkResponse(String msg)
-
buildServerErrorResponse
protected javax.ws.rs.core.Response buildServerErrorResponse(Object entity)
-
buildStatusResponse
protected javax.ws.rs.core.Response buildStatusResponse(javax.ws.rs.core.Response.Status status)
-
buildPlainTextStatusResponse
protected javax.ws.rs.core.Response buildPlainTextStatusResponse(javax.ws.rs.core.Response.Status status)
-
getJobRequest
protected JobRequest getJobRequest()
-
convertScheduleRequestToJobTrigger
protected org.pentaho.platform.api.scheduler2.IJobTrigger convertScheduleRequestToJobTrigger(JobScheduleRequest request) throws org.pentaho.platform.api.scheduler2.SchedulerException
- Throws:
org.pentaho.platform.api.scheduler2.SchedulerException
-
-