Querying the Job Execution Status
You can send a request to return the details of a submitted job.
The details include the original request configuration, the current execution status and URLs to retrieve the results/log.
Send a GET request to the following endpoint:
https://<INSIGHTURL>/insightservices/rest/v1/compute/[computeJobId]Example response
{ "id": "myId", "objectType": "COMPUTE_JOB", "computeJobType": "SOLVER", "url": "/path/to/job", "project": { "objectType": "PROJECT", "id": "23f5ac9c-24b9-4cf2-9a47-880c195ea854", "url": "/path/to/app" }, "parent": { "objectType": "SCENARIO", "id": "99612136-8dd0-4869-93ff-6a91e0be5796", "url": "/path/to/scenario" }, "shareStatus": null, "ownerId": "5ab6f1b7-a167-4bf5-992b-2963a2ef4745", "path": null, "dependency": "my attachment.zip", "runlogMessages": true, "execution": { "executionService":"SECONDARY", "threads": 2, }, "solver": { "action": "optimize", "problemType": "mip", "flags": [], "controls": { "control1": 1234 }, "includeInResults": ["solution", "attributes"], "callbacks": [] }, "status": "COMPLETED", "prettyStatus": "Completed", "modelStatus": "OK", "payloadUrl": "/path/to/payload/attachment", "resultUrl": "/path/to/results/attachment", "runLogUrl": "/path/to/runlog", "metricsUrl": "/path/to/metrics" }
The response JSON contains the original job request properties, information about the job's scenario and project (compute interface app) ancestors, the status of the job and URLs to retrieve files relevant to the job including job submission payload, result files and the run log file.
Job Status
The
status property of the GET response can take one of the following values:
- QUEUED: Job is waiting in the queue for an available worker.
- CONNECTING: Job is waiting for a connection to the assigned worker.
- EXECUTING: Job is executing on a worker.
- COMPLETING: Job has finished executing and results are being processed by the server.
- CANCELLING: Job is in the process of being cancelled.
- COMPLETED: Job has completed with no errors.
- CANCELLED: Job was cancelled.
- FAILED: Job has completed with errors.
A client that is using polling rather than progress notifications to determine when the job has finished would typically begin polling for status once the job has been successfully submitted and stop polling on one of the following finish states:
- COMPLETED
- CANCELLED
- FAILED