Gen3 Jobs Class

class gen3.jobs.Gen3Jobs(endpoint=None, auth_provider=None, service_location='job')[source]

Bases: object

A class for interacting with the Gen3’s Job Dispatching Service(s).

Examples

This generates the Gen3Jobs class pointed at the sandbox commons while using the credentials.json downloaded from the commons profile page.

>>> auth = Gen3Auth(refresh_file="credentials.json")
... jobs = Gen3Jobs(auth)
async async_run_job_and_wait(job_name, job_input, _ssl=None, **kwargs)[source]

Asynchronous function to create a job, wait for output, and return. Will sleep in a linear delay until the job is done, starting with 1 second.

Parameters:
  • _ssl (None, optional) – whether or not to use ssl

  • job_name (str) – name for the job, can use globals in this file

  • job_input (Dict) – dictionary of input for the job

Returns:

Response from the endpoint

Return type:

Dict

create_job(job_name, job_input)[source]

Create a job with given name and input

Parameters:
  • job_name (str) – name for the job, can use globals in this file

  • job_input (Dict) – dictionary of input for the job

Returns:

Response from the endpoint

Return type:

Dict

get_output(job_id)[source]

Get the output of a previously completed job

get_status(job_id)[source]

Get the status of a previously created job

get_version()[source]

Return the version

Returns:

the version

Return type:

str

is_healthy()[source]

Return if is healthy or not

Returns:

True if healthy

Return type:

bool

list_jobs()[source]

List all jobs