To list your current tasks and get a quick summary of the state of each task, you can send a request to https://api.qarnot.com/tasks/summaries.
Don't forget to replace YOUR_SECRET_TOKEN with your actual authentication token.Bash
curl -X GET \
-H "Authorization: <<<YOUR_SECRET_TOKEN>>>" \
https://api.qarnot.com/tasks/summaries
Powershell
$headers = @{
'Authorization'='<<<YOUR_SECRET_TOKEN>>>'
}
Invoke-RestMethod `
-Uri https://api.qarnot.com/tasks/summaries `
-Method 'Get' `
-Headers $headers
Here's a response example, showing only the first task of the list.
[
{
"uuid": "ff149809-9415-4132-aad1-faad5383ea11",
"name": "hello constant",
"shortname": "ff149809-9415-4132-aad1-faad5383ea11",
"profile": "docker-batch",
"poolUuid": null,
"jobUuid": null,
"progress": 100.0,
"runningInstanceCount": 0,
"runningCoreCount": 0,
"executionTime": "00:00:38",
"wallTime": "00:03:59",
"state": "Success",
"previousState": "UploadingResults",
"instanceCount": 1,
"maxRetriesPerInstance": 0,
"stateTransitionTime": "2022-12-23T17:03:17Z",
"previousStateTransitionTime": "2022-12-23T17:03:06Z",
"lastModified": "2022-12-23T17:03:18Z",
"creationDate": "2022-12-23T16:59:11Z",
"endDate": "2022-12-23T17:03:18Z",
"waitForPoolResourcesSynchronization": null
}
]
It is also possible to filter the tasks using tags by including them in the request URL.
Bash
curl -X GET \
-H "Authorization: <<<YOUR_SECRET_TOKEN>>>" \
"https://api.qarnot.com/tasks/summaries?tag=t1&tag=t2,t"
Powershell
$headers = @{
'Authorization'='<<<YOUR_SECRET_TOKEN>>>'
}
Invoke-RestMethod `
-Method 'Get' `
-Uri https://api.qarnot.com/tasks/summaries?t `
-Headers $headers
You can get a task's information by sending a GET request to https://api.qarnot.com/tasks/{uuid}, where {uuid} is the task unique identifier that is returned when you submit a task with the API. You can also get this uuid in Tasq.
Here is an example of the request:
Bash
curl -X GET \
-H "Authorization: <<<YOUR_SECRET_TOKEN>>>" \
https://api.qarnot.com/tasks/{uuid}
Powershell
$headers = @{
'Authorization'='<<<YOUR_SECRET_TOKEN>>>'
}
Invoke-RestMethod `
-Method 'Get' `
-Uri https://api.qarnot.com/tasks/{uuid} `
-Headers $headers
This request returns a JSON file, which is the same as the one available with the web interface. A complete definition of the fields is available in the API documentation.
It is also possible to query the information of all the tasks by sending the request to https://api.qarnot.com/tasks and to filter the task by tag again with https://api.qarnot.com/tasks?tag=t1&tag=t2,t3.
For more information on monitoring and debugging please consult the following articles