Table of Contents

Back to JESS API

Get JESS Jobs List


Use GET /jobs to retrieve the list of jobs the user has run on JESS, with optional filters.


Synopsis

Filter Object

A filter object can be sent along with the GET /jobs transaction to limit the number of jobs returned in the list. An example filter is shown below:

{
    "since" : "2020-12-01",
    "till" : "2020-12-20",
    "status" : "FINISHED"
}

The since and till fields contain the dates from and to which, inclusive, the jobs were submitted. The dates must be specified in the form of YYYY-mm-dd. The status field specifies only the jobs having a certain status should be returned. The options include FINISHED, QUEUED, CANCELED, REJECTED, ACCEPTED, UNPACKED. Multiple statuses can be specified using a comma-separated list, e.g. UNPACKED,ACCEPTED,QUEUED.

If no filter is specified, the list of all jobs the user has ever run on JESS will be returned, which can be quite long.

Return object

A successful GET /jobs transaction returns an object containing the list of jobs the user has submitted to JESS.

{
    "ok": true,
    "status": "TestUser jobs available",
    "data": [
        {
            "message": "Job finished. Results collected into tables.",
            "id": 1,
            "job_SN": 12238,
            "job_Subset": "ALL",
            "job_Args": "",
            "received": 1607123422525,
            "resultSize": 0,
            "njobs": 12,
            "storageSize": 64541606,
            "job_Name": "Test job",
            "progress": "12, 0, 0, 0, 0, 0, 12",
            "status": "FINISHED",
            "job_Type": "EP_IDF_SPLIT",
            "username": "TestUser",
            "submissionSize": 0,
            "cputime": 37
        },
        {
            "message": "Job finished. Results collected into tables.",
            "id": 1,
            "job_SN": 12240,
            "job_Subset": "ALL",
            "job_Args": "",
            "received": 1607124019369,
            "resultSize": 0,
            "njobs": 12,
            "storageSize": 64758448,
            "job_Name": "Test job",
            "progress": "12, 0, 0, 0, 0, 0, 12",
            "status": "FINISHED",
            "job_Type": "EP_IDF_SPLIT",
            "username": "TestUser",
            "submissionSize": 0,
            "cputime": 60
        },
        {
            "message": "Job finished. Results collected into tables.",
            "id": 1,
            "job_SN": 12244,
            "job_Subset": "ALL",
            "job_Args": "",
            "received": 1607127162329,
            "resultSize": 0,
            "njobs": 1,
            "storageSize": 15726617,
            "job_Name": "null",
            "progress": "1, 0, 0, 0, 0, 0, 1",
            "status": "FINISHED",
            "job_Type": "EP_IDF",
            "username": "TestUser",
            "submissionSize": 0,
            "cputime": 9
        },
        {
            "message": "Job finished. Results collected into tables.",
            "id": 1,
            "job_SN": 12245,
            "job_Subset": "ALL",
            "job_Args": "",
            "received": 1607127209099,
            "resultSize": 0,
            "njobs": 1,
            "storageSize": 15726617,
            "job_Name": "null",
            "progress": "1, 0, 0, 0, 0, 0, 1",
            "status": "FINISHED",
            "job_Type": "EP_IDF",
            "username": "TestUser",
            "submissionSize": 0,
            "cputime": 9
        }
    ]
}

Example using curl://

Send the GET /jobs command using curl on Linux:

curl -b cookies -H 'Content-Type: application/json' -d '{"since": "2020-12-01", "till": "2020-12-20", "status":"FINISHED"}' https://api.ensims.com/jess_web/api/jobs

on Windows:

curl -b cookies -H "Content-Type: application/json" -d "{\"since\": \"2020-12-01\", \"till\": \"2020-12-20\", \"status\":\"FINISHED\"}" https://api.ensims.com/jess_web/api/jobs

On success, the user's jobs on JESS will be returned in a JSON object. If the existing JWT is invalid, an HTTP 401 Unauthorized code will be returned.

Example using Python Requests

Make sure Requests is correctly installed in your Python environment, and run the following lines:

import requests

headers = {'Content-Type': 'application/json'}
body = {"since": "2020-12-01", "till": "2020-12-20", "status":"FINISHED"}

# Existing cookies are expected to be stored in the variable 'cookies'
r = requests.get('https://api.ensims.com/jess_web/api/jobs', headers=headers, json=body, cookies=cookies)

# Show returned object  
r.json()