ScheduleResource Resource

REST end point for all scheduler operations.

GET /scheduler

Response Body
media type data type
text/plain (custom)

Example

Request
GET /scheduler
Accept: text/plain

              
Response
HTTP/1.1 200 OK
Content-Type: text/plain

                
...
                
              

POST /scheduler/jobs

Submits a job to be scheduled at later point of time or submit and schedule simultaneously.

Request Parameters
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
Request Body
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)
Response Body
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)

Example

Request
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
}
                
              
Response
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 /scheduler/jobs

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.

Request Parameters
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  
Response Body
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)

Example

Request
GET /scheduler/jobs
Accept: application/json

              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "handleIdString" : "...",
  "handleId" : "..."
}
                
              

GET /scheduler/jobs/stats

Get all job stats

Request Parameters
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  
Response Body
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)

Example

Request
GET /scheduler/jobs/stats
Accept: application/json

              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{ }
                
              

GET /scheduler/jobs/{jobHandle}

Get XJob definition for a given job handle.

Request Parameters
name type description
jobHandle path Job handle
sessionid query SessionID
Response Body
media type data type description
application/json LensAPIResult (JSON) XJob definition
application/json LensAPIResult (JSON)
application/xml lensAPIResult (XML)

Example

Request
GET /scheduler/jobs/{jobHandle}
Accept: application/json

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

DELETE /scheduler/jobs/{jobHandle}

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.

Request Parameters
name type description
jobHandle path Job handle
sessionid query Session id
Response Body
media type data type description
application/json LensAPIResult (JSON) API result
application/json LensAPIResult (JSON)
application/xml lensAPIResult (XML)

Example

Request
DELETE /scheduler/jobs/{jobHandle}
Accept: application/json

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

PUT /scheduler/jobs/{jobHandle}

Updates job definition of an existing job. New definition can have new query and configurations.

Request Parameters
name type description
jobHandle path Job handle
sessionid query Session Id
Request Body
media type data type description
application/json XJob (JSON) New job definition.
application/json XJob (JSON)
application/xml x_job (XML)
Response Body
media type data type description
application/json LensAPIResult (JSON) LensAPIResult
application/json LensAPIResult (JSON)
application/xml lensAPIResult (XML)

Example

Request
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
}
                
              
Response
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
  }
}
                
              

POST /scheduler/jobs/{jobHandle}

Changes the job state

Request Parameters
name type description default
jobHandle path Job handle  
action query An action can be SCHEDULE, EXPIRE, SUSPEND or RESUME schedule
sessionid query Session Id  
Response Body
media type data type description
application/json LensAPIResult (JSON) LensAPIResult
application/json LensAPIResult (JSON)
application/xml lensAPIResult (XML)

Example

Request
POST /scheduler/jobs/{jobHandle}
Accept: application/json

              
Response
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 /scheduler/jobs/{jobHandle}/info

Returns the SchedulerJobInfo of a given job handle.

Request Parameters
name type description
jobHandle path Job handle
sessionid query Session ID
Response Body
media type data type description
application/json LensAPIResult (JSON) SchedulerJobinfo
application/json LensAPIResult (JSON)
application/xml lensAPIResult (XML)

Example

Request
GET /scheduler/jobs/{jobHandle}/info
Accept: application/json

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

GET /scheduler/jobs/{jobHandle}/instances

Returns all the instances of a job.

Request Parameters
name type description constraints
jobHandle path Job handle  
numResults query Number of results to be returned long
sessionid query Session id  
Response Body
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)

Example

Request
GET /scheduler/jobs/{jobHandle}/instances
Accept: application/json

              
Response
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"
  } ] ]
}
                
              

GET /scheduler/instances/{instanceHandle}

Returns a SchedulerInstanceInfo for a given instance handle.

Request Parameters
name type description
instanceHandle path instance handle
sessionid query Session ID
Response Body
media type data type description
application/json LensAPIResult (JSON) SchedulerInstanceInfo
application/json LensAPIResult (JSON)
application/xml lensAPIResult (XML)

Example

Request
GET /scheduler/instances/{instanceHandle}
Accept: application/json

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

POST /scheduler/instances/{instanceHandle}

Updates an instance

Request Parameters
name type description
instanceHandle path Instance handle
action query the value of action could be KILL or RERUN.
sessionid query Session ID
Response Body
media type data type description
application/json LensAPIResult (JSON) LensAPIResult
application/json LensAPIResult (JSON)
application/xml lensAPIResult (XML)

Example

Request
POST /scheduler/instances/{instanceHandle}
Accept: application/json

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