Skip to main content
create_job(endpoint=None, request_encoding=‘binary’, data=None, data_str=None, options=)[source]

Create a job which will run asynchronously. The response returns a job ID, which can be used to query the status and result of the job. The status and the result of the job upon completion can be requested by GPUdb.get_job().

Parameters

endpoint (str) –

Indicates which endpoint to execute, e.g. ‘/alter/table’.

request_encoding (str) –

The encoding of the request payload for the job. Allowed values are:

  • binary

  • json

  • snappy

The default value is ‘binary’.

data (bytes) –

Binary-encoded payload for the job to be run asynchronously. The payload must contain the relevant input parameters for the endpoint indicated in input parameter endpoint. Please see the documentation for the appropriate endpoint to see what values must (or can) be specified. If this parameter is used, then input parameter request_encoding must be binary or snappy.

data_str (str) –

JSON-encoded payload for the job to be run asynchronously. The payload must contain the relevant input parameters for the endpoint indicated in input parameter endpoint. Please see the documentation for the appropriate endpoint to see what values must (or can) be specified. If this parameter is used, then input parameter request_encoding must be json.

options (dict of str to str) –

Optional parameters. Allowed keys are:

  • job_tag – Tag to use for submitted job. The same tag could be used on backup cluster to retrieve response for the job. Tags can use letter, numbers, ‘_’ and ‘-‘.

The default value is an empty dict ( ).

Returns

A dict with the following entries–

job_id (long) –

An identifier for the job created by this call.

info (dict of str to str) –

Additional information. Allowed keys are:

  • job_tag – The job tag specified by the user or if unspecified by user, a unique identifier generated internally.

  • query_id – A unique identifier for this job generated for use in tracing telemetry data.

The default value is an empty dict ( ).