Search…
Jobs

Get the Task API's endpoint

1
cortex get <task_api_name>
Copied!

Submit a Job

1
POST <task_api_endpoint>:
2
{
3
"timeout": <int>, # duration in seconds since the submission of a job before it is terminated (optional)
4
"config": { # arbitrary input for this specific job (optional)
5
"string": <any>
6
}
7
}
8
9
RESPONSE:
10
{
11
"job_id": <string>,
12
"api_name": <string>,
13
"kind": "TaskAPI",
14
"workers": 1,
15
"config": {<string>: <any>},
16
"api_id": <string>,
17
"timeout": <int>,
18
"created_time": <string>
19
}
Copied!
The entire job specification is written to /cortex/spec/job.json in the API containers.

Get a job's status

1
cortex get <task_api_name> <job_id>
Copied!
Or make a GET request to <task_api_endpoint>?jobID=<jobID>:
1
GET <task_api_endpoint>?jobID=<jobID>:
2
3
RESPONSE:
4
{
5
"job_status": {
6
"job_id": <string>,
7
"api_name": <string>,
8
"kind": "TaskAPI",
9
"workers": 1,
10
"config": {<string>: <any>},
11
"api_id": <string>,
12
"status": <string>,
13
"created_time": <string>
14
"start_time": <string>
15
"end_time": <string> (optional)
16
},
17
"endpoint": <string>
18
"api_spec": {
19
...
20
}
21
}
Copied!

Stop a job

1
cortex delete <task_api_name> <job_id>
Copied!
Or make a DELETE request to <task_api_endpoint>?jobID=<jobID>:
1
DELETE <task_api_endpoint>?jobID=<jobID>:
2
3
RESPONSE:
4
{"message":"stopped job <job_id>"}
Copied!
Last modified 2mo ago