Scheduler¶
/api/repositories/{repository}/scheduler
Parameter | Type | Purpose |
---|---|---|
repository | string | The name of the Repository to access |
Get/Post¶
-
GET
/api/repositories/
(string: repository)/scheduler
¶ Get a list of jobs. If you require a subset of this data (filtering, sorting, or columns), POST to this url with the standard request body.
GET /api/repositories/jupiter/scheduler HTTP/1.1
Accept: application/json
Response Code | Reason |
---|---|
200 | Success |
500 | Server error |
The response is a Standard Response
The columns arrays contains the columns in the scheduler view.
Humanised Name | Column Name | Description |
---|---|---|
Ref | job_id | The unique identifier for the activity |
Activity Name | job_name | The user-defined name for relating activities together |
Type | job_type | The type of activity |
Repository | job_metabase | The repository to which the activity relates |
Entity | job_entity_id | The entity or entities to which the activity relates |
Scheduled | job_scheduled_time | The time the activity is scheduled to start |
State | job_status | The current status of the activity |
Completed | job_progress | The percentage completed for the activity |
Progress | job_message_mc | The current progress for the activity |
Reason | job_reason | The failure message for the activity |
Started | job_start_time | The time the activity started |
Ended | job_end_time | The time the activity ended |
Duration | job_duration | The overall duration of the activity |
Created By | job_create_user | The user who created the activity |
Created | job_create_time | The time the activity was created |
The rows array contains the data for each Job; the metadata for each row contains the URL for the Job.
{
"rows": [
{
"dataRow": [
"5",
"Full Business Rule analysis",
"Business Rule Analysis",
"jupiter",
[
"1"
],
"Immediate",
"Completed",
"100",
"Processed business rules",
"",
"2014/10/31 15:39:21",
"2014/10/31 15:39:24",
"0 Days, 00:00:03",
"bob",
"2014/10/31 15:39:21"
],
"metadata": {
"url": "/api/repositories/jupiter/scheduler/5"
}
}
]
}
A job normally relates to a single entity, but may relate to two entities (for joins), or may not relate to any specific entity (join project). Therefore, Entity is returned as an array of zero, one or two items. An example showing two entities is given below.
{
"rows": [
{
"dataRow": [
"8",
"Execute Join (4 1 5 1 1)",
"Execute Join",
"jupiter",
[
"4",
"5"
],
"Immediate",
"Completed",
"100",
"Joins executed.",
"",
"2014/10/31 16:44:36",
"2014/10/31 16:44:41",
"0 Days, 00:00:05",
"bob",
"2014/10/31 16:44:36"
],
"metadata": {
"url": "/api/repositories/jupiter/scheduler/8"
}
}
]
}
.. _sch_export:
Export¶
Some or all of the rows may be exported as a scheduled task.
POST /api/repositories/jupiter/scheduler HTTP/1.1
Content-Type: application/json
{
"command": "export",
"data": {
"filename": "filename.csv",
"filetype": "csv",
"encoding": "utf-8"
},
"options": {
"columns": ["job_id", "job_type", "job_status"],
"where": "Ref = 24"
}
}
Response Code | Reason |
---|---|
200 | No error |
400 | Invalid data passed with request |
500 | Server error |
The request packet must contain the command
and data
elements. The options
element is not required, but may specify the columns to export, and/or the rows to filter.
The following table shows which fields are required in the data
element:
Field | Required |
---|---|
filename | Y |
filetype | N |
encoding | N |
If filetype
is not specified, it defaults to csv. If encoding
is not specified, it defaults to the server native encoding.
The response will contain the URL of the scheduled task and the link to download the exported file.
{
"job": "/api/repositories/jupiter/scheduler/1",
"file": "/api/repositories/jupiter/download/filename.csv"
}