Scheduling APIs Scheduler Resource

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 scheduler.

Add blockout for scheduled jobs

post

Creates a new blockout for scheduled jobs.

Example Request:

POST pentaho/api/scheduler/blockout/add

cURL Example:

curl -X POST \
  "http://localhost:8080/pentaho/api/scheduler/blockout/add" \
  -H "Content-Type: application/xml" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
  -d '<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>'
Authorizations
Body

Request object for scheduling jobs and blockouts

jobNamestringOptional

Name of the job

Example: JobName
jobIdstringOptional

ID of the job (for updates)

Example: admin JobName 1410786491777
inputFilestringOptional

Input file path

Example: /public/Steel Wheels/Top Customers (report).prpt
outputFilestringOptional

Output file path

Example: /public/output
durationintegerOptional

Duration in milliseconds for blockouts

Example: 7740000
timeZonestringOptional

Time zone for the schedule

Example: America/New_York
Responses
200

Successfully created blockout schedule

text/plain
Responsestring

ID of the blockout which was created

post
/plugin/scheduler-plugin/api/scheduler/blockout/add
POST /plugin/scheduler-plugin/api/scheduler/blockout/add HTTP/1.1
Host: 
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 548

{
  "jobName": "JobName",
  "jobId": "admin  JobName 1410786491777",
  "simpleJobTrigger": {
    "uiPassParam": "MINUTES",
    "repeatInterval": 1800,
    "repeatCount": -1,
    "startTime": "2014-08-14T11:46:00.000-04:00",
    "endTime": ""
  },
  "complexJobTrigger": {
    "uiPassParam": "DAILY",
    "daysOfWeek": [
      1,
      2,
      3,
      4,
      5
    ],
    "startTime": "2014-08-19T10:51:00.000-04:00",
    "endTime": ""
  },
  "inputFile": "/public/Steel Wheels/Top Customers (report).prpt",
  "outputFile": "/public/output",
  "duration": 7740000,
  "timeZone": "America/New_York",
  "jobParameters": {
    "name": "ParameterName",
    "type": "string",
    "stringValue": "false"
  }
}
admin BlockoutAction 1410786491209

Get all blockout jobs

get

Get all the blockout jobs in the system.

Example Request:

GET pentaho/api/scheduler/blockout/blockoutjobs

cURL Example:

curl -X GET \
  "http://localhost:8080/pentaho/api/scheduler/blockout/blockoutjobs" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="

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>

Returns: A Response object that contains a list of blockout jobs.

Authorizations
Responses
200

Successfully retrieved blockout jobs

get
/plugin/scheduler-plugin/api/scheduler/blockout/blockoutjobs
GET /plugin/scheduler-plugin/api/scheduler/blockout/blockoutjobs HTTP/1.1
Host: 
Authorization: Basic username:password
Accept: */*
{
  "job": [
    {
      "groupName": "admin",
      "jobId": "admin  JobName 1410786491777",
      "jobName": "JobName",
      "jobParams": [
        {
          "name": "user_locale",
          "value": "en_US"
        }
      ],
      "jobTrigger": {
        "duration": -1,
        "startTime": "2014-08-14T11:46:00-04:00",
        "uiPassParam": "MINUTES",
        "repeatCount": -1,
        "repeatInterval": 1800
      },
      "lastRun": "2014-08-14T11:46:00-04:00",
      "nextRun": "2014-08-14T11:46:00-04:00",
      "state": "NORMAL",
      "userName": "admin"
    }
  ]
}

Check blockout status

post

Check the status of the selected blockout schedule.

Example Request:

POST pentaho/api/scheduler/blockout/blockstatus

cURL Example:

curl -X POST \
  "http://localhost:8080/pentaho/api/scheduler/blockout/blockstatus" \
  -H "Content-Type: application/xml" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
  -d '<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>'

Example Response:

<blockStatusProxy>
  <partiallyBlocked>false</partiallyBlocked>
  <totallyBlocked>true</totallyBlocked>
</blockStatusProxy>

Returns: A Response object which contains a BlockStatusProxy which contains totallyBlocked and partiallyBlocked flags

Authorizations
Body

Request object for scheduling jobs and blockouts

jobNamestringOptional

Name of the job

Example: JobName
jobIdstringOptional

ID of the job (for updates)

Example: admin JobName 1410786491777
inputFilestringOptional

Input file path

Example: /public/Steel Wheels/Top Customers (report).prpt
outputFilestringOptional

Output file path

Example: /public/output
durationintegerOptional

Duration in milliseconds for blockouts

Example: 7740000
timeZonestringOptional

Time zone for the schedule

Example: America/New_York
Responses
200

Successfully got the blockout status

post
/plugin/scheduler-plugin/api/scheduler/blockout/blockstatus
POST /plugin/scheduler-plugin/api/scheduler/blockout/blockstatus HTTP/1.1
Host: 
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 548

{
  "jobName": "JobName",
  "jobId": "admin  JobName 1410786491777",
  "simpleJobTrigger": {
    "uiPassParam": "MINUTES",
    "repeatInterval": 1800,
    "repeatCount": -1,
    "startTime": "2014-08-14T11:46:00.000-04:00",
    "endTime": ""
  },
  "complexJobTrigger": {
    "uiPassParam": "DAILY",
    "daysOfWeek": [
      1,
      2,
      3,
      4,
      5
    ],
    "startTime": "2014-08-19T10:51:00.000-04:00",
    "endTime": ""
  },
  "inputFile": "/public/Steel Wheels/Top Customers (report).prpt",
  "outputFile": "/public/output",
  "duration": 7740000,
  "timeZone": "America/New_York",
  "jobParameters": {
    "name": "ParameterName",
    "type": "string",
    "stringValue": "false"
  }
}
{
  "partiallyBlocked": true,
  "totallyBlocked": true
}

Check if blockouts exist

get

Checks if there are blockouts in the system.

Example Request:

GET pentaho/api/scheduler/blockout/hasblockouts

cURL Example:

curl -X GET \
  "http://localhost:8080/pentaho/api/scheduler/blockout/hasblockouts" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="

Example Response:

true

Returns: true or false whether there are blackouts or not.

Authorizations
Responses
200

Successfully determined whether or not the system contains blockouts

text/plain
Responsestring

true or false whether there are blackouts or not

get
/plugin/scheduler-plugin/api/scheduler/blockout/hasblockouts
GET /plugin/scheduler-plugin/api/scheduler/blockout/hasblockouts HTTP/1.1
Host: 
Authorization: Basic username:password
Accept: */*
200

Successfully determined whether or not the system contains blockouts

true

Check if blockout should fire now

get

Checks if the selected blockout schedule should be fired now.

Example Request:

GET pentaho/api/scheduler/blockout/shouldFireNow

cURL Example:

curl -X GET \
  "http://localhost:8080/pentaho/api/scheduler/blockout/shouldFireNow" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="

Example Response:

true

Returns: true or false whether the blockout should fire now.

Authorizations
Responses
200

Successful operation

text/plain
Responsestring

true or false whether the blockout should fire now

get
/plugin/scheduler-plugin/api/scheduler/blockout/shouldFireNow
GET /plugin/scheduler-plugin/api/scheduler/blockout/shouldFireNow HTTP/1.1
Host: 
Authorization: Basic username:password
Accept: */*
200

Successful operation

true

Update existing blockout

post

Update an existing blockout.

Example Request:

POST pentaho/api/scheduler/blockout/update?jobid=admin%09BlockoutAction%091410786491209

cURL Example:

curl -X POST \
  "http://localhost:8080/pentaho/api/scheduler/blockout/update?jobid=admin%09BlockoutAction%091410786491209" \
  -H "Content-Type: application/xml" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
  -d '<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>'

Returns: A Response object which contains the ID of the blockout which was created.

Authorizations
Query parameters
jobidstringRequired

The jobId of the blockout we are editing

Example: admin%09BlockoutAction%091410786491209
Body

Request object for scheduling jobs and blockouts

jobNamestringOptional

Name of the job

Example: JobName
jobIdstringOptional

ID of the job (for updates)

Example: admin JobName 1410786491777
inputFilestringOptional

Input file path

Example: /public/Steel Wheels/Top Customers (report).prpt
outputFilestringOptional

Output file path

Example: /public/output
durationintegerOptional

Duration in milliseconds for blockouts

Example: 7740000
timeZonestringOptional

Time zone for the schedule

Example: America/New_York
Responses
200

Successful operation

text/plain
Responsestring

ID of the blockout which was updated

post
/plugin/scheduler-plugin/api/scheduler/blockout/update
POST /plugin/scheduler-plugin/api/scheduler/blockout/update?jobid=admin%09BlockoutAction%091410786491209 HTTP/1.1
Host: 
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 548

{
  "jobName": "JobName",
  "jobId": "admin  JobName 1410786491777",
  "simpleJobTrigger": {
    "uiPassParam": "MINUTES",
    "repeatInterval": 1800,
    "repeatCount": -1,
    "startTime": "2014-08-14T11:46:00.000-04:00",
    "endTime": ""
  },
  "complexJobTrigger": {
    "uiPassParam": "DAILY",
    "daysOfWeek": [
      1,
      2,
      3,
      4,
      5
    ],
    "startTime": "2014-08-19T10:51:00.000-04:00",
    "endTime": ""
  },
  "inputFile": "/public/Steel Wheels/Top Customers (report).prpt",
  "outputFile": "/public/output",
  "duration": 7740000,
  "timeZone": "America/New_York",
  "jobParameters": {
    "name": "ParameterName",
    "type": "string",
    "stringValue": "false"
  }
}
admin BlockoutAction 1410786491503

Check if blockout will fire

post

Checks if the selected blockout schedule will be fired.

Example Request:

POST pentaho/api/scheduler/blockout/willFire

cURL Example:

curl -X POST \
  "http://localhost:8080/pentaho/api/scheduler/blockout/willFire" \
  -H "Content-Type: application/xml" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
  -d '<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>'

Example Response:

false

Returns: true or false indicating whether the blockout will fire.

Authorizations
Body

Request object for scheduling jobs and blockouts

jobNamestringOptional

Name of the job

Example: JobName
jobIdstringOptional

ID of the job (for updates)

Example: admin JobName 1410786491777
inputFilestringOptional

Input file path

Example: /public/Steel Wheels/Top Customers (report).prpt
outputFilestringOptional

Output file path

Example: /public/output
durationintegerOptional

Duration in milliseconds for blockouts

Example: 7740000
timeZonestringOptional

Time zone for the schedule

Example: America/New_York
Responses
200

Successful operation

text/plain
Responsestring

true or false indicating whether the blockout will fire

post
/plugin/scheduler-plugin/api/scheduler/blockout/willFire
POST /plugin/scheduler-plugin/api/scheduler/blockout/willFire HTTP/1.1
Host: 
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 548

{
  "jobName": "JobName",
  "jobId": "admin  JobName 1410786491777",
  "simpleJobTrigger": {
    "uiPassParam": "MINUTES",
    "repeatInterval": 1800,
    "repeatCount": -1,
    "startTime": "2014-08-14T11:46:00.000-04:00",
    "endTime": ""
  },
  "complexJobTrigger": {
    "uiPassParam": "DAILY",
    "daysOfWeek": [
      1,
      2,
      3,
      4,
      5
    ],
    "startTime": "2014-08-19T10:51:00.000-04:00",
    "endTime": ""
  },
  "inputFile": "/public/Steel Wheels/Top Customers (report).prpt",
  "outputFile": "/public/output",
  "duration": 7740000,
  "timeZone": "America/New_York",
  "jobParameters": {
    "name": "ParameterName",
    "type": "string",
    "stringValue": "false"
  }
}
false

Check user scheduling authority

get

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

Example Request:

GET pentaho/api/scheduler/canSchedule

cURL Example:

curl -X GET \
  "http://localhost:8080/pentaho/api/scheduler/canSchedule" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="

Example Response:

true

Returns: true or false. true indicates scheduling is allowed and false indicates scheduling is not allowed for the user.

Authorizations
Responses
200

Successfully retrieved the scheduling permission

application/json
Responsestring

true or false indicating scheduling is allowed for the user

get
/plugin/scheduler-plugin/api/scheduler/canSchedule
GET /plugin/scheduler-plugin/api/scheduler/canSchedule HTTP/1.1
Host: 
Authorization: Basic username:password
Accept: */*
true

Get generated content for schedule

get

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

cURL Example:

curl -X GET \
  "http://localhost:8080/pentaho/api/scheduler/generatedContentForSchedule?lineageId=:public:Steel%20Wheels:Inventory%20List%20(report).prpt" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="

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>
    <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>
  </repositoryFileDto>
</List>
Authorizations
Query parameters
lineageIdstringRequired

The path for the file

Example: :public:Steel%20Wheels:Inventory%20List%20(report).prpt
Responses
200

Successfully got the generated content for schedule

get
/plugin/scheduler-plugin/api/scheduler/generatedContentForSchedule
GET /plugin/scheduler-plugin/api/scheduler/generatedContentForSchedule?lineageId=%3Apublic%3ASteel%20Wheels%3AInventory%20List%20(report).prpt HTTP/1.1
Host: 
Authorization: Basic username:password
Accept: */*
200

Successfully got the generated content for schedule

[
  {
    "id": "12345-abcde",
    "name": "report.prpt",
    "path": "/home/admin/report.prpt",
    "folder": false,
    "hidden": false,
    "versioned": true,
    "locked": false,
    "fileSize": 1024,
    "createdDate": "2023-01-01T12:00:00Z",
    "lastModifiedDate": "2023-01-02T12:00:00Z",
    "ownerType": 0,
    "title": "Sales Report",
    "description": "Monthly sales report",
    "deletedDate": "2023-01-03T12:00:00Z",
    "locale": "en",
    "originalParentFolderPath": "/original/path/to/file",
    "versionId": "1.3",
    "localePropertiesMapEntries": [
      {
        "locale": "default",
        "properties": [
          {
            "key": "file.title",
            "value": "File Title"
          }
        ]
      }
    ]
  }
]

Get content cleaner job

get

Get the scheduled job created by the system for deleting generated files.

Example Request:

GET pentaho/api/scheduler/getContentCleanerJob

cURL Example:

curl -X GET \
  "http://localhost:8080/pentaho/api/scheduler/getContentCleanerJob" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="

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>
Authorizations
Responses
200

Content cleaner job successfully retrieved

get
/plugin/scheduler-plugin/api/scheduler/getContentCleanerJob
GET /plugin/scheduler-plugin/api/scheduler/getContentCleanerJob HTTP/1.1
Host: 
Authorization: Basic username:password
Accept: */*
{
  "groupName": "admin",
  "jobId": "admin  JobName 1410786491777",
  "jobName": "JobName",
  "jobParams": [
    {
      "name": "user_locale",
      "value": "en_US"
    }
  ],
  "jobTrigger": {
    "duration": -1,
    "startTime": "2014-08-14T11:46:00-04:00",
    "uiPassParam": "MINUTES",
    "repeatCount": -1,
    "repeatInterval": 1800
  },
  "lastRun": "2014-08-14T11:46:00-04:00",
  "nextRun": "2014-08-14T11:46:00-04:00",
  "state": "NORMAL",
  "userName": "admin"
}

Get all jobs

get

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

Example Request:

GET pentaho/api/scheduler/getJobs

cURL Example:

curl -X GET \
  "http://localhost:8080/pentaho/api/scheduler/getJobs" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="

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>
Authorizations
Responses
200

Jobs retrieved successfully

get
/plugin/scheduler-plugin/api/scheduler/getJobs
GET /plugin/scheduler-plugin/api/scheduler/getJobs HTTP/1.1
Host: 
Authorization: Basic username:password
Accept: */*
{
  "job": [
    {
      "groupName": "admin",
      "jobId": "admin  JobName 1410786491777",
      "jobName": "JobName",
      "jobParams": [
        {
          "name": "user_locale",
          "value": "en_US"
        }
      ],
      "jobTrigger": {
        "duration": -1,
        "startTime": "2014-08-14T11:46:00-04:00",
        "uiPassParam": "MINUTES",
        "repeatCount": -1,
        "repeatInterval": 1800
      },
      "lastRun": "2014-08-14T11:46:00-04:00",
      "nextRun": "2014-08-14T11:46:00-04:00",
      "state": "NORMAL",
      "userName": "admin"
    }
  ]
}

Check if scheduling is allowed for file

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

cURL Example:

curl -X GET \
  "http://localhost:8080/pentaho/api/scheduler/isScheduleAllowed?id=b5f806b9-9f72-4814-b1e0-aa9e0ece7e1a" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="

Returns: true or false. true indicates scheduling is allowed and false indicates scheduling is not allowed for the file.

Example Response:

true
Authorizations
Query parameters
idstringRequired

The repository file ID of the content to checked

Example: b5f806b9-9f72-4814-b1e0-aa9e0ece7e1a
Responses
200

Successfully retrieved scheduling ability of repository file

text/plain
Responsestring

true or false indicating scheduling is allowed for the file

get
/plugin/scheduler-plugin/api/scheduler/isScheduleAllowed
GET /plugin/scheduler-plugin/api/scheduler/isScheduleAllowed?id=b5f806b9-9f72-4814-b1e0-aa9e0ece7e1a HTTP/1.1
Host: 
Authorization: Basic username:password
Accept: */*
true

Create new scheduled 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/Steel Wheels/Top Customers (report).prpt</inputFile>
  <outputFile>/public/output</outputFile>
  <jobParameters>
    <name>ParameterName</name>
    <type>string</type>
    <stringValue>false</stringValue>
  </jobParameters>
</jobScheduleRequest>

cURL Example:

curl -X POST \
  "http://localhost:8080/pentaho/api/scheduler/job" \
  -H "Content-Type: application/xml" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
  -d '<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>'

Example Response:

admin  JobName  1410786491777

Returns: A jax-rs Response object with the created jobId.

Authorizations
Body

Request object for scheduling jobs and blockouts

jobNamestringOptional

Name of the job

Example: JobName
jobIdstringOptional

ID of the job (for updates)

Example: admin JobName 1410786491777
inputFilestringOptional

Input file path

Example: /public/Steel Wheels/Top Customers (report).prpt
outputFilestringOptional

Output file path

Example: /public/output
durationintegerOptional

Duration in milliseconds for blockouts

Example: 7740000
timeZonestringOptional

Time zone for the schedule

Example: America/New_York
Responses
200

Schedule created successfully

text/plain
Responsestring

Created jobId

post
/plugin/scheduler-plugin/api/scheduler/job
POST /plugin/scheduler-plugin/api/scheduler/job HTTP/1.1
Host: 
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 548

{
  "jobName": "JobName",
  "jobId": "admin  JobName 1410786491777",
  "simpleJobTrigger": {
    "uiPassParam": "MINUTES",
    "repeatInterval": 1800,
    "repeatCount": -1,
    "startTime": "2014-08-14T11:46:00.000-04:00",
    "endTime": ""
  },
  "complexJobTrigger": {
    "uiPassParam": "DAILY",
    "daysOfWeek": [
      1,
      2,
      3,
      4,
      5
    ],
    "startTime": "2014-08-19T10:51:00.000-04:00",
    "endTime": ""
  },
  "inputFile": "/public/Steel Wheels/Top Customers (report).prpt",
  "outputFile": "/public/output",
  "duration": 7740000,
  "timeZone": "America/New_York",
  "jobParameters": {
    "name": "ParameterName",
    "type": "string",
    "stringValue": "false"
  }
}
admin  JobName  1410786491777

Get job information

get

Retrieves information about a specified job.

Example Request:

GET pentaho/api/scheduler/jobinfo?jobId=admin%20JobName%201410786491777

cURL Example:

curl -X GET \
  "http://localhost:8080/pentaho/api/scheduler/jobinfo?jobId=admin%20JobName%201410786491777" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="

Example Response:

<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 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>

Returns: A Job object containing the info for the specified job.

Authorizations
Query parameters
jobIdstringRequired

The jobId of the job for which we are requesting information

asCronStringstringOptional

Cron string (Unused)

Default: false
Responses
200

Successfully retrieved the information for the requested job

get
/plugin/scheduler-plugin/api/scheduler/jobinfo
GET /plugin/scheduler-plugin/api/scheduler/jobinfo?jobId=text HTTP/1.1
Host: 
Authorization: Basic username:password
Accept: */*
{
  "groupName": "admin",
  "jobId": "admin  JobName 1410786491777",
  "jobName": "JobName",
  "jobParams": [
    {
      "name": "user_locale",
      "value": "en_US"
    }
  ],
  "jobTrigger": {
    "duration": -1,
    "startTime": "2014-08-14T11:46:00-04:00",
    "uiPassParam": "MINUTES",
    "repeatCount": -1,
    "repeatInterval": 1800
  },
  "lastRun": "2014-08-14T11:46:00-04:00",
  "nextRun": "2014-08-14T11:46:00-04:00",
  "state": "NORMAL",
  "userName": "admin"
}

Get job state

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>

cURL Example:

curl -X POST \
  "http://localhost:8080/pentaho/api/scheduler/jobState" \
  -H "Content-Type: application/xml" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
  -d '<jobRequest>
    <jobId>admin  JobName 1410786491777</jobId>
  </jobRequest>'

Example Response:

NORMAL

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

Authorizations
Body

Request object for job operations

jobIdstringOptional

ID of the job

Example: admin JobName 1410786491777
Responses
200

Successfully retrieved the state of the requested job

text/plain
Responsestring

State of the scheduled job

post
/plugin/scheduler-plugin/api/scheduler/jobState
POST /plugin/scheduler-plugin/api/scheduler/jobState HTTP/1.1
Host: 
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 40

{
  "jobId": "admin  JobName 1410786491777"
}
NORMAL

Pause scheduler

post

Pause the scheduler from a running state.

POST data:

This POST body does not contain data.

Example Request:

POST pentaho/api/scheduler/pause

cURL Example:

curl -X POST \
  "http://localhost:8080/pentaho/api/scheduler/pause" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="

Example Response:

PAUSED

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

Authorizations
Responses
200

Successfully paused the server

text/plain
Responsestring

Status of the scheduler

post
/plugin/scheduler-plugin/api/scheduler/pause
POST /plugin/scheduler-plugin/api/scheduler/pause HTTP/1.1
Host: 
Authorization: Basic username:password
Accept: */*
PAUSED

Pause scheduled job

post

Pause the specified scheduled job.

Example Request:

POST pentaho/api/scheduler/pauseJob

POST data:

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

cURL Example:

curl -X POST \
  "http://localhost:8080/pentaho/api/scheduler/pauseJob" \
  -H "Content-Type: application/xml" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
  -d '<jobRequest>
    <jobId>admin  JobName 1410786491777</jobId>
  </jobRequest>'

Example Response:

PAUSED

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

Authorizations
Body

Request object for job operations

jobIdstringOptional

ID of the job

Example: admin JobName 1410786491777
Responses
200

Successfully paused the job

text/plain
Responsestring

Status of the scheduled job

post
/plugin/scheduler-plugin/api/scheduler/pauseJob
POST /plugin/scheduler-plugin/api/scheduler/pauseJob HTTP/1.1
Host: 
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 40

{
  "jobId": "admin  JobName 1410786491777"
}
PAUSED

Remove scheduled job

put

Delete the specified scheduled job from the platform.

Example Request:

PUT pentaho/api/scheduler/removeJob

PUT data:

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

cURL Example:

curl -X PUT \
  "http://localhost:8080/pentaho/api/scheduler/removeJob" \
  -H "Content-Type: application/xml" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
  -d '<jobRequest>
    <jobId>admin  BlockoutAction 1410786491503</jobId>
  </jobRequest>'

Example Response:

REMOVED

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

Authorizations
Body

Request object for job operations

jobIdstringOptional

ID of the job

Example: admin JobName 1410786491777
Responses
200

Successfully removed the job

text/plain
Responsestring

Status of the scheduled job

put
/plugin/scheduler-plugin/api/scheduler/removeJob
PUT /plugin/scheduler-plugin/api/scheduler/removeJob HTTP/1.1
Host: 
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 40

{
  "jobId": "admin  JobName 1410786491777"
}
REMOVED

Remove scheduled job (deprecated)

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>

cURL Example:

curl -X DELETE \
  "http://localhost:8080/pentaho/api/scheduler/removeJob" \
  -H "Content-Type: application/xml" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
  -d '<jobRequest>
    <jobId>admin  BlockoutAction 1410786491503</jobId>
  </jobRequest>'

Example Response:

REMOVED

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

Note: This method is deprecated. Use "PUT pentaho/api/scheduler/removeJob" instead.

Authorizations
Body

Request object for job operations

jobIdstringOptional

ID of the job

Example: admin JobName 1410786491777
Responses
200

Successfully removed the job

text/plain
Responsestring

Status of the scheduled job

delete
/plugin/scheduler-plugin/api/scheduler/removeJob
DELETE /plugin/scheduler-plugin/api/scheduler/removeJob HTTP/1.1
Host: 
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 40

{
  "jobId": "admin  JobName 1410786491777"
}
REMOVED

Resume scheduled job

post

Resume the specified scheduled job.

Example Request:

POST pentaho/api/scheduler/resumeJob

POST data:

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

cURL Example:

curl -X POST \
  "http://localhost:8080/pentaho/api/scheduler/resumeJob" \
  -H "Content-Type: application/xml" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
  -d '<jobRequest>
    <jobId>admin  JobName 1410786491777</jobId>
  </jobRequest>'

Example Response:

NORMAL

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

Authorizations
Body

Request object for job operations

jobIdstringOptional

ID of the job

Example: admin JobName 1410786491777
Responses
200

Successfully resumed the job

text/plain
Responsestring

Status of the scheduled job

post
/plugin/scheduler-plugin/api/scheduler/resumeJob
POST /plugin/scheduler-plugin/api/scheduler/resumeJob HTTP/1.1
Host: 
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 40

{
  "jobId": "admin  JobName 1410786491777"
}
NORMAL

Shutdown scheduler

post

Shuts down the scheduler.

Example Request:

POST pentaho/api/scheduler/shutdown

POST data:

This POST body does not contain data.

cURL Example:

curl -X POST \
  "http://localhost:8080/pentaho/api/scheduler/shutdown" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="

Example Response:

PAUSED

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

Authorizations
Responses
200

Successfully shut down the server

text/plain
Responsestring

Status of the scheduler

post
/plugin/scheduler-plugin/api/scheduler/shutdown
POST /plugin/scheduler-plugin/api/scheduler/shutdown HTTP/1.1
Host: 
Authorization: Basic username:password
Accept: */*
PAUSED

Start/resume scheduler

post

Resume the scheduler from a paused state.

Example Request:

POST pentaho/api/scheduler/start

POST data:

This POST body does not contain data.

cURL Example:

curl -X POST \
  "http://localhost:8080/pentaho/api/scheduler/start" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="

Example Response:

RUNNING

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

Authorizations
Responses
200

Successfully started the server

text/plain
Responsestring

Status of the scheduler

post
/plugin/scheduler-plugin/api/scheduler/start
POST /plugin/scheduler-plugin/api/scheduler/start HTTP/1.1
Host: 
Authorization: Basic username:password
Accept: */*
RUNNING

Get scheduler state

get

Returns the current state of the scheduler.

Example Request:

GET pentaho/api/scheduler/state

cURL Example:

curl -X GET \
  "http://localhost:8080/pentaho/api/scheduler/state" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="

Example Response:

RUNNING

Returns: status of the scheduler as RUNNING or PAUSED.

Authorizations
Responses
200

Successfully retrieved the state of the scheduler

text/plain
Responsestring

Status of the scheduler as RUNNING or PAUSED

get
/plugin/scheduler-plugin/api/scheduler/state
GET /plugin/scheduler-plugin/api/scheduler/state HTTP/1.1
Host: 
Authorization: Basic username:password
Accept: */*
RUNNING

Execute job immediately

post

Execute a previously scheduled job.

Example Request:

POST pentaho/api/scheduler/triggerNow

POST data:

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

cURL Example:

curl -X POST \
  "http://localhost:8080/pentaho/api/scheduler/triggerNow" \
  -H "Content-Type: application/xml" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
  -d '<jobRequest>
    <jobId>admin  JobName 1410786491777</jobId>
  </jobRequest>'

Example Response:

NORMAL

Returns: A Response object indicating the status of the scheduler.

Authorizations
Body

Request object for job operations

jobIdstringOptional

ID of the job

Example: admin JobName 1410786491777
Responses
200

Job triggered successfully

text/plain
Responsestring

Status of the scheduler

post
/plugin/scheduler-plugin/api/scheduler/triggerNow
POST /plugin/scheduler-plugin/api/scheduler/triggerNow HTTP/1.1
Host: 
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 40

{
  "jobId": "admin  JobName 1410786491777"
}
NORMAL

Was this helpful?