API Endpoints

Endpoints and example responses

  • /health: status endpoint. Returns some ignorable text. Important part here is the status code.
  • /resources/global: returns a list of resources currently loaded (such as judgement lists and the like) on a ( limited to single nodes) global level, e.g without taking into account further assignments such as the job they are used for. Example response:
{
  "data": [
    {
      "resourceType": "JUDGEMENT_PROVIDER",
      "identifier": "ident1"
    }
  ],
  "errorMessage": ""
}
  • /jobs/open: Returns list of currently non-completed jobs. Example response:
{
  "data": [
    {
      "batchCountPerState": {
        "INPROGRESS_abc1": 5
      },
      "jobId": "taskSequenceTestJob2_1688830485073",
      "jobLevelDirectives": [
        {
          "type": "PROCESS"
        }
      ],
      "timePlacedInMillis": 1688830485073
    }
  ],
  "errorMessage": ""
}
  • /jobs/batches: Returns list of batches currently in process.
{
  "data": [
    {
      "processingInfo": {
        "lastUpdate": "2023-07-09 00:56:22",
        "numItemsProcessed": 129,
        "numItemsTotal": 1000,
        "processingNode": "abc1",
        "processingStatus": "IN_PROGRESS"
      },
      "stateId": {
        "batchNr": 0,
        "jobId": "taskSequenceTestJob2_1688864117702"
      }
    },
    {
      "processingInfo": {
        "lastUpdate": "2023-07-09 00:56:22",
        "numItemsProcessed": 129,
        "numItemsTotal": 1000,
        "processingNode": "abc1",
        "processingStatus": "IN_PROGRESS"
      },
      "stateId": {
        "batchNr": 4,
        "jobId": "taskSequenceTestJob2_1688864117702"
      }
    },
    {
      "processingInfo": {
        "lastUpdate": "2023-07-09 00:56:22",
        "numItemsProcessed": 129,
        "numItemsTotal": 1000,
        "processingNode": "abc1",
        "processingStatus": "IN_PROGRESS"
      },
      "stateId": {
        "batchNr": 3,
        "jobId": "taskSequenceTestJob2_1688864117702"
      }
    },
    {
      "processingInfo": {
        "lastUpdate": "2023-07-09 00:56:22",
        "numItemsProcessed": 131,
        "numItemsTotal": 1000,
        "processingNode": "abc1",
        "processingStatus": "IN_PROGRESS"
      },
      "stateId": {
        "batchNr": 1,
        "jobId": "taskSequenceTestJob2_1688864117702"
      }
    },
    {
      "processingInfo": {
        "lastUpdate": "2023-07-09 00:56:22",
        "numItemsProcessed": 128,
        "numItemsTotal": 1000,
        "processingNode": "abc1",
        "processingStatus": "IN_PROGRESS"
      },
      "stateId": {
        "batchNr": 2,
        "jobId": "taskSequenceTestJob2_1688864117702"
      }
    }
  ],
  "errorMessage": ""
}
  • Deleting all job level directives for a given job (here: job_1688902767685):
curl -XDELETE localhost:8001/jobs/job_1688902767685/directives/all
  • Deleting a set of job level directives for a given job:
curl -XDELETE --header "Content-Type: application/json" --data '[{"type": "PROCESS" }]' localhost:8001/jobs/job_1688902767685/directives
  • Adding list of job level directives for a given job to the persisted state:
curl -XPOST --header "Content-Type: application/json" --data '[{"type": "PROCESS" }]' localhost:8001/jobs/job_1688902767685/directives

In all the job level directive endpoints the response will be a 200 response code with simple true boolean value as data or an error code with respective error message. Example for successful call:

{"data":true,"errorMessage":""}

Job Result Retrieval Endpoints

  • results/folders: returns a mapping of date to job identifiers for which results are available
{
  "data": {
    "2023-08-07": [
      "taskSequenceTestJob2"
    ],
    "2023-08-09": [
      "testJaccard",
      "testJob1"
    ],
    "2023-07-14": [
      "test1",
      "taskSequenceTestJob2",
      "taskSequenceTestJob"
    ],
    "2023-07-13": [
      "taskSequenceTestJob2"
    ],
    "2023-08-10": [
      "testJob2",
      "test1",
      "taskSequenceTestJob2"
    ],
    "2023-08-08": [
      "testJob1"
    ],
    "2023-07-16": [
      "test1"
    ],
    "2023-07-27": [
      "test1",
      "taskSequenceTestJob2"
    ]
  },
  "errorMessage": ""
}
  • results/[date-in-yyyy-mm-dd format]/[jobId]: returns a list of result files available for the specific date and jobId
{
  "data": [
    "(dummy=1)-abc1-peufg.json"
  ],
  "errorMessage": ""
}
  • results/[date-in-yyyy-mm-dd format]/[jobId]/content?file=[result-file-name]: returns the content of the result file
{
  "data": {
    "data": [
      {
        "datasets": [
          {
            "data": [
              0.26666666666666666,
              0.2222222222222222,
              0.1875,
              0.2727272727272727,
              0.1875
            ],
            "failReasons": [
              {},
              {},
              {},
              {},
              {}
            ],
            "failSamples": [
              0,
              0,
              0,
              0,
              0
            ],
            "name": "jaccard",
            "successSamples": [
              1,
              1,
              1,
              1,
              1
            ],
            "weightedFailSamples": [
              0.0,
              0.0,
              0.0,
              0.0,
              0.0
            ],
            "weightedSuccessSamples": [
              1.0,
              1.0,
              1.0,
              1.0,
              1.0
            ]
          }
        ],
        "entryType": "DOUBLE_AVG",
        "failCount": 0,
        "labels": [
          {
            "k1": [
              "v1",
              "v2"
            ],
            "q": [
              "q2"
            ]
          },
          {
            "k1": [
              "v1",
              "v2"
            ],
            "q": [
              "q4"
            ]
          },
          {
            "k1": [
              "v1",
              "v2"
            ],
            "q": [
              "q5"
            ]
          },
          {
            "k1": [
              "v1",
              "v2"
            ],
            "q": [
              "q3"
            ]
          },
          {
            "k1": [
              "v1",
              "v2"
            ],
            "q": [
              "q1"
            ]
          }
        ],
        "successCount": 1
      }
    ],
    "name": "(dummy=1)",
    "timestamp": "2023-08-10 08:02:30.506"
  },
  "errorMessage": ""
}

Above is a subset of the evailable endpoints. Complete list on the way!