REST end point for all scheduler operations.
| media type | data type |
|---|---|
| text/plain | (custom) |
GET /scheduler
Accept: text/plain
HTTP/1.1 200 OK
Content-Type: text/plain
...
Submits a job to be scheduled at later point of time or submit and schedule simultaneously.
| name | type | description |
|---|---|---|
| action | query | Action could be submit for storing the job or it could be "submit-and-schedule" to schedule it just after submitting the job. |
| sessionid | query | Session ID, the logged-in user will be set as the owner of this job |
| media type | data type | description |
|---|---|---|
| application/json | XJob (JSON) | XJob definition of the job to be submitted |
| application/json | XJob (JSON) | |
| application/xml | x_job (XML) |
| media type | data type | description |
|---|---|---|
| application/json | LensAPIResult (JSON) | A newly generated job handle for the job. Job handle is the unique ID of a job. |
| application/json | LensAPIResult (JSON) | |
| application/xml | lensAPIResult (XML) |
POST /scheduler/jobs
Content-Type: application/json
Accept: application/json
{
"name" : "...",
"execution" : {
"session" : {
"db" : "...",
"conf" : [ [ { }, { } ], [ { }, { } ] ],
"resourcePath" : [ [ { }, { } ], [ { }, { } ] ]
},
"query" : {
"query" : "...",
"conf" : [ [ { }, { } ], [ { }, { } ] ]
}
},
"trigger" : {
"frequency" : {
"enum" : "WEEKLY",
"cronExpression" : "...",
"timezone" : "..."
}
},
"jobConf" : [ [ {
"key" : "...",
"value" : "..."
}, {
"key" : "...",
"value" : "..."
} ], [ {
"key" : "...",
"value" : "..."
}, {
"key" : "...",
"value" : "..."
} ] ],
"startTime" : 12345,
"endTime" : 12345
}
HTTP/1.1 201 Created
Content-Type: application/json
{
"httpStatusCode" : { },
"successResult" : true,
"errorResult" : true,
"errorCode" : 12345,
"errorMessage" : "...",
"id" : "...",
"data" : { },
"lensErrorTO" : {
"payload" : { },
"childErrors" : [ [ { }, { } ], [ { }, { } ] ],
"message" : "...",
"code" : 12345
}
}
Get all job handles matching user, state and end_time >job_submission_time >=start time. If any of the values are null, it will not be considered while filtering. For example: user is "test" and state is null then it will return job handles irrespective of state of the job.
| name | type | description | constraints |
|---|---|---|---|
| end | query | Submission time should be strictly less than the end time. | long |
| sessionid | query | Session ID | |
| start | query | Submission time should be grater than or equal to start time | long |
| state | query | State of job: for example: SUCCEED or EXPIRED | "DELETED" or "EXPIRED" or "NEW" or "SCHEDULED" or "SUSPENDED" |
| user | query | User of the job |
| media type | data type | description |
|---|---|---|
| application/json | array of array of SchedulerJobHandle (JSON) | A list of all jobs matching the filtering criteria. |
| application/json | array of array of SchedulerJobHandle (JSON) | |
| application/xml | list of schedulerJobHandle (XML) |
GET /scheduler/jobs
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"handleIdString" : "...",
"handleId" : "..."
}
Get all job stats
| name | type | description | default | constraints |
|---|---|---|---|---|
| end | query | end time | -1 | long |
| name | query | Name of the job | ||
| sessionid | query | Session ID | ||
| start | query | start time | -1 | long |
| status | query | Job status | running | |
| user | query | User of the job | user |
| media type | data type | description |
|---|---|---|
| application/json | array of array of SchedulerJobStats (JSON) | A list of SchedulerJobStats |
| application/json | array of array of SchedulerJobStats (JSON) | |
| application/xml | list of schedulerJobStats (XML) |
GET /scheduler/jobs/stats
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{ }
Get XJob definition for a given job handle.
| name | type | description |
|---|---|---|
| jobHandle | path | Job handle |
| sessionid | query | SessionID |
| media type | data type | description |
|---|---|---|
| application/json | LensAPIResult (JSON) | XJob definition |
| application/json | LensAPIResult (JSON) | |
| application/xml | lensAPIResult (XML) |
GET /scheduler/jobs/{jobHandle}
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"httpStatusCode" : { },
"successResult" : true,
"errorResult" : true,
"errorCode" : 12345,
"errorMessage" : "...",
"id" : "...",
"data" : { },
"lensErrorTO" : {
"payload" : { },
"childErrors" : [ [ { }, { } ], [ { }, { } ] ],
"message" : "...",
"code" : 12345
}
}
Marks the job for deletion. Jobs are not deleted immediately, rather they are marked for deletion. A deleted job is a dormant job which can't be elicited by any action.
| name | type | description |
|---|---|---|
| jobHandle | path | Job handle |
| sessionid | query | Session id |
| media type | data type | description |
|---|---|---|
| application/json | LensAPIResult (JSON) | API result |
| application/json | LensAPIResult (JSON) | |
| application/xml | lensAPIResult (XML) |
DELETE /scheduler/jobs/{jobHandle}
Accept: application/json
HTTP/1.1 204 No Content
Content-Type: application/json
{
"httpStatusCode" : { },
"successResult" : true,
"errorResult" : true,
"errorCode" : 12345,
"errorMessage" : "...",
"id" : "...",
"data" : { },
"lensErrorTO" : {
"payload" : { },
"childErrors" : [ [ { }, { } ], [ { }, { } ] ],
"message" : "...",
"code" : 12345
}
}
Updates job definition of an existing job. New definition can have new query and configurations.
| name | type | description |
|---|---|---|
| jobHandle | path | Job handle |
| sessionid | query | Session Id |
| media type | data type | description |
|---|---|---|
| application/json | XJob (JSON) | New job definition. |
| application/json | XJob (JSON) | |
| application/xml | x_job (XML) |
| media type | data type | description |
|---|---|---|
| application/json | LensAPIResult (JSON) | LensAPIResult |
| application/json | LensAPIResult (JSON) | |
| application/xml | lensAPIResult (XML) |
PUT /scheduler/jobs/{jobHandle}
Content-Type: application/json
Accept: application/json
{
"name" : "...",
"execution" : {
"session" : {
"db" : "...",
"conf" : [ [ { }, { } ], [ { }, { } ] ],
"resourcePath" : [ [ { }, { } ], [ { }, { } ] ]
},
"query" : {
"query" : "...",
"conf" : [ [ { }, { } ], [ { }, { } ] ]
}
},
"trigger" : {
"frequency" : {
"enum" : "WEEKLY",
"cronExpression" : "...",
"timezone" : "..."
}
},
"jobConf" : [ [ {
"key" : "...",
"value" : "..."
}, {
"key" : "...",
"value" : "..."
} ], [ {
"key" : "...",
"value" : "..."
}, {
"key" : "...",
"value" : "..."
} ] ],
"startTime" : 12345,
"endTime" : 12345
}
HTTP/1.1 204 No Content
Content-Type: application/json
{
"httpStatusCode" : { },
"successResult" : true,
"errorResult" : true,
"errorCode" : 12345,
"errorMessage" : "...",
"id" : "...",
"data" : { },
"lensErrorTO" : {
"payload" : { },
"childErrors" : [ [ { }, { } ], [ { }, { } ] ],
"message" : "...",
"code" : 12345
}
}
Changes the job state
| name | type | description | default |
|---|---|---|---|
| jobHandle | path | Job handle | |
| action | query | An action can be SCHEDULE, EXPIRE, SUSPEND or RESUME | schedule |
| sessionid | query | Session Id |
| media type | data type | description |
|---|---|---|
| application/json | LensAPIResult (JSON) | LensAPIResult |
| application/json | LensAPIResult (JSON) | |
| application/xml | lensAPIResult (XML) |
POST /scheduler/jobs/{jobHandle}
Accept: application/json
HTTP/1.1 201 Created
Content-Type: application/json
{
"httpStatusCode" : { },
"successResult" : true,
"errorResult" : true,
"errorCode" : 12345,
"errorMessage" : "...",
"id" : "...",
"data" : { },
"lensErrorTO" : {
"payload" : { },
"childErrors" : [ [ { }, { } ], [ { }, { } ] ],
"message" : "...",
"code" : 12345
}
}
Returns the SchedulerJobInfo of a given job handle.
| name | type | description |
|---|---|---|
| jobHandle | path | Job handle |
| sessionid | query | Session ID |
| media type | data type | description |
|---|---|---|
| application/json | LensAPIResult (JSON) | SchedulerJobinfo |
| application/json | LensAPIResult (JSON) | |
| application/xml | lensAPIResult (XML) |
GET /scheduler/jobs/{jobHandle}/info
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"httpStatusCode" : { },
"successResult" : true,
"errorResult" : true,
"errorCode" : 12345,
"errorMessage" : "...",
"id" : "...",
"data" : { },
"lensErrorTO" : {
"payload" : { },
"childErrors" : [ [ { }, { } ], [ { }, { } ] ],
"message" : "...",
"code" : 12345
}
}
Returns all the instances of a job.
| name | type | description | constraints |
|---|---|---|---|
| jobHandle | path | Job handle | |
| numResults | query | Number of results to be returned | long |
| sessionid | query | Session id |
| media type | data type | description |
|---|---|---|
| application/json | array of array of SchedulerJobInstanceInfo (JSON) | A list of SchedulerInstanceInfo for a given job handle |
| application/json | array of array of SchedulerJobInstanceInfo (JSON) | |
| application/xml | list of schedulerJobInstanceInfo (XML) |
GET /scheduler/jobs/{jobHandle}/instances
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"id" : {
"handleIdString" : "...",
"handleId" : "..."
},
"jobId" : {
"handleIdString" : "...",
"handleId" : "..."
},
"scheduleTime" : 12345,
"instanceRunList" : [ [ {
"handle" : {
"handleIdString" : "...",
"handleId" : "..."
},
"runId" : 12345,
"sessionHandle" : {
"publicId" : "...",
"secretId" : "..."
},
"startTime" : 12345,
"endTime" : 12345,
"resultPath" : "...",
"queryHandle" : {
"handleIdString" : "...",
"handleId" : "...",
"fieldsToAppend" : [ [ { }, { } ], [ { }, { } ] ]
},
"instanceState" : "RUNNING"
}, {
"handle" : {
"handleIdString" : "...",
"handleId" : "..."
},
"runId" : 12345,
"sessionHandle" : {
"publicId" : "...",
"secretId" : "..."
},
"startTime" : 12345,
"endTime" : 12345,
"resultPath" : "...",
"queryHandle" : {
"handleIdString" : "...",
"handleId" : "...",
"fieldsToAppend" : [ [ { }, { } ], [ { }, { } ] ]
},
"instanceState" : "TIMED_OUT"
} ], [ {
"handle" : {
"handleIdString" : "...",
"handleId" : "..."
},
"runId" : 12345,
"sessionHandle" : {
"publicId" : "...",
"secretId" : "..."
},
"startTime" : 12345,
"endTime" : 12345,
"resultPath" : "...",
"queryHandle" : {
"handleIdString" : "...",
"handleId" : "...",
"fieldsToAppend" : [ [ { }, { } ], [ { }, { } ] ]
},
"instanceState" : "WAITING"
}, {
"handle" : {
"handleIdString" : "...",
"handleId" : "..."
},
"runId" : 12345,
"sessionHandle" : {
"publicId" : "...",
"secretId" : "..."
},
"startTime" : 12345,
"endTime" : 12345,
"resultPath" : "...",
"queryHandle" : {
"handleIdString" : "...",
"handleId" : "...",
"fieldsToAppend" : [ [ { }, { } ], [ { }, { } ] ]
},
"instanceState" : "TIMED_OUT"
} ] ]
}
Returns a SchedulerInstanceInfo for a given instance handle.
| name | type | description |
|---|---|---|
| instanceHandle | path | instance handle |
| sessionid | query | Session ID |
| media type | data type | description |
|---|---|---|
| application/json | LensAPIResult (JSON) | SchedulerInstanceInfo |
| application/json | LensAPIResult (JSON) | |
| application/xml | lensAPIResult (XML) |
GET /scheduler/instances/{instanceHandle}
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"httpStatusCode" : { },
"successResult" : true,
"errorResult" : true,
"errorCode" : 12345,
"errorMessage" : "...",
"id" : "...",
"data" : { },
"lensErrorTO" : {
"payload" : { },
"childErrors" : [ [ { }, { } ], [ { }, { } ] ],
"message" : "...",
"code" : 12345
}
}
Updates an instance
| name | type | description |
|---|---|---|
| instanceHandle | path | Instance handle |
| action | query | the value of action could be KILL or RERUN. |
| sessionid | query | Session ID |
| media type | data type | description |
|---|---|---|
| application/json | LensAPIResult (JSON) | LensAPIResult |
| application/json | LensAPIResult (JSON) | |
| application/xml | lensAPIResult (XML) |
POST /scheduler/instances/{instanceHandle}
Accept: application/json
HTTP/1.1 201 Created
Content-Type: application/json
{
"httpStatusCode" : { },
"successResult" : true,
"errorResult" : true,
"errorCode" : 12345,
"errorMessage" : "...",
"id" : "...",
"data" : { },
"lensErrorTO" : {
"payload" : { },
"childErrors" : [ [ { }, { } ], [ { }, { } ] ],
"message" : "...",
"code" : 12345
}
}