Job tasks#

A job task is always part of a job. A job task represents the progress and outcome of a single analysis step of a sample; typically an analysis worker. It contains information such as when the worker started and completed, whether it failed or not, and a reference to the analysis result (if it completed successfully).

Adding job tasks#

The role SAMPLEDB-ANALYZER is required to be able to add an analysis job task.

To add a task to a job, the job task endpoint can be used with a POST operation along with the job ID. The request and response body is JSON formatted and contains information about the task. The example request below adds a task to a job with an initial state and the name of the analysis worker.

curl -X POST -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" https://api.mnemonic.no/sampledb/v2/job/<job id>/task -d '{
	"worker": "analysis-worker-name",
	"state": "enqueued"
}'

For more detailed information on what the response model looks like, you can check out the Swagger API documentation.

Updating job tasks#

The role SAMPLEDB-ANALYZER is required to be able to update job tasks.

As the task progresses, the state and result should be updated. This can be done using the job task endpoint using the PUT operation. The response body will be in JSON format, and contain the updated job task.

curl -X PUT -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" https://api.mnemonic.no/sampledb/v2/job/<job id>/task/<task id> -d '{
	"state": "success",
	"analysisID": "7512c89c-2308-4d4c-86af-94462b6ac3ad"
}'

For more detailed information on what the response model looks like, you can check out the Swagger API documentation.

Fetching job tasks#

The role SAMPLEDB-VIEWER or higher is required to be able to fetch or list job tasks.

List#

To list job tasks, the job task endpoint can be used with a GET operation. The response body will be in JSON format, and contain a list of objects containing information about the tasks.

curl -H "Argus-API-Key: my/api/key" https://api.mnemonic.no/sampledb/v2/job/<job id>/tasks

Fetch#

To fetch a single instance of an analysis job task, the fetch job task endpoint can be used with a GET operation along with the Job ID and Job Task ID. The response body will be in JSON format, and contain all information about the job task.

curl -H "Argus-API-Key: my/api/key" https://api.mnemonic.no/sampledb/v2/job/<job id>/task/<task id>

For more detailed information on what the response model looks like, you can check out the Swagger API documentation.