Skip to main content
get_job(job_id=None, options=)[source]

Get the status and result of asynchronously running job. See the GPUdb.create_job() for starting an asynchronous job. Some fields of the response are filled only after the submitted job has finished execution.

Parameters

job_id (long) –

A unique identifier for the job whose status and result is to be fetched.

options (dict of str to str) –

Optional parameters. Allowed keys are:

  • job_tag – Job tag returned in call to create the job.

The default value is an empty dict ( ).

Returns

A dict with the following entries–

endpoint (str) –

The endpoint which is being executed asynchronously. E.g. ‘/alter/table’.

job_status (str) –

Status of the submitted job. Allowed values are:

  • RUNNING – The job is currently executing.

  • DONE – The job execution has successfully completed and the response is included in the output parameter job_response or output parameter job_response_str field.

  • ERROR – The job was attempted, but an error was encountered. The output parameter status_map contains the details of the error in error_message.

  • CANCELLED – Job cancellation was requested while the execution was in progress.

running (bool) –

True if the end point is still executing.

progress (int) –

Approximate percentage of the job completed.

successful (bool) –

True if the job execution completed and no errors were encountered.

response_encoding (str) –

The encoding of the job result (contained in output parameter job_response or output parameter job_response_str. Allowed values are:

  • binary – The job result is binary-encoded. It is contained in output parameter job_response.

  • json – The job result is JSON-encoded. It is contained in output parameter job_response_str.

job_response (bytes) –

The binary-encoded response of the job. This field is populated only when the job has completed and output parameter response_encoding is binary.

job_response_str (str) –

The json-encoded response of the job. This field is populated only when the job has completed and output parameter response_encoding is json.

status_map (dict of str to str) –

Map of various status strings for the executed job. Allowed keys are:

  • error_message – Explains what error occurred while running the job asynchronously. This entry only exists when the job status is ERROR.

info (dict of str to str) –

Additional information.