REST API - Jobs

iceprod.rest.handlers.jobs.setup(handler_cfg)[source]

Setup method for Jobs REST API.

Parameters:

handler_cfg (dict) – args to pass to the route

Returns:

routes, database, indexes

Return type:

dict

class iceprod.rest.handlers.jobs.MultiJobsHandler(*args, **kwargs)[source]

Handle multi jobs requests.

async post()[source]

Create a job entry.

Body should contain the job data.

Returns:

{‘result’: <job_id>}

Return type:

dict

class iceprod.rest.handlers.jobs.JobsHandler(*args, **kwargs)[source]

Handle single job requests.

async get(job_id)[source]

Get a job entry.

Parameters:

job_id (str) – the job id

Returns:

job entry

Return type:

dict

async patch(job_id)[source]

Update a job entry.

Body should contain the job data to update. Note that this will perform a merge (not replace).

Parameters:

job_id (str) – the job id

Returns:

updated job entry

Return type:

dict

class iceprod.rest.handlers.jobs.DatasetMultiJobsHandler(*args, **kwargs)[source]

Handle multi jobs requests.

async get(dataset_id)[source]

Get all jobs for a dataset.

Params (optional):

job_index: job_index to filter by status: | separated list of job status to filter by keys: | separated list of keys to return for each task

Parameters:

dataset_id (str) – dataset id

Returns:

{‘job_id’:{job_data}}

Return type:

dict

class iceprod.rest.handlers.jobs.DatasetJobsHandler(*args, **kwargs)[source]

Handle single job requests.

async get(dataset_id, job_id)[source]

Get a job entry.

Parameters:
  • dataset_id (str) – dataset id

  • job_id (str) – the job id

Returns:

job entry

Return type:

dict

class iceprod.rest.handlers.jobs.DatasetJobsStatusHandler(*args, **kwargs)[source]

Handle single job requests.

async put(dataset_id, job_id)[source]

Set a job status, following possible state transitions.

Body should have {‘status’: <new_status>}

Parameters:
  • dataset_id (str) – dataset id

  • job_id (str) – the job id

Returns:

empty dict

Return type:

dict

class iceprod.rest.handlers.jobs.DatasetJobBulkStatusHandler(*args, **kwargs)[source]

Update the status of multiple jobs at once.

async post(dataset_id, status)[source]

Set multiple jobs’ status, following possible state transitions.

Body should have {‘jobs’: [<job_id>, <job_id>, …]}

Parameters:
  • dataset_id (str) – dataset id

  • status (str) – the status

Returns:

empty dict

Return type:

dict

class iceprod.rest.handlers.jobs.DatasetJobBulkSuspendHandler(*args, **kwargs)[source]

Suspend jobs in a dataset.

async post(dataset_id)[source]

Do a suspend on jobs.

Body may have {‘jobs’: [<job_id>, <job_id>, …]} If it does not, all jobs in a dataset are suspended.

Parameters:

dataset_id (str) – dataset id

Returns:

empty dict

Return type:

dict

class iceprod.rest.handlers.jobs.DatasetJobBulkResetHandler(*args, **kwargs)[source]

Reset jobs in a dataset.

async post(dataset_id)[source]

Do a reset on jobs.

Body may have {‘jobs’: [<job_id>, <job_id>, …]} If it does not, all jobs in a dataset are reset.

Parameters:

dataset_id (str) – dataset id

Returns:

empty dict

Return type:

dict

class iceprod.rest.handlers.jobs.DatasetJobBulkHardResetHandler(*args, **kwargs)[source]

Hard reset jobs in a dataset.

async post(dataset_id)[source]

Do a hard reset on jobs.

Body may have {‘jobs’: [<job_id>, <job_id>, …]} If it does not, all jobs in a dataset are hard reset.

Parameters:

dataset_id (str) – dataset id

Returns:

empty dict

Return type:

dict

class iceprod.rest.handlers.jobs.DatasetJobSummariesStatusHandler(*args, **kwargs)[source]

Handle job summary grouping by status.

async get(dataset_id)[source]

Get the job summary for all jobs in a dataset, group by status.

Parameters:

dataset_id (str) – dataset id

Returns:

{<status>: [<job_id>,]}

Return type:

dict

class iceprod.rest.handlers.jobs.DatasetJobCountsStatusHandler(*args, **kwargs)[source]

Handle job counts by status.

async get(dataset_id)[source]

Get the job counts for all jobs in a dataset, group by status.

Parameters:

dataset_id (str) – dataset id

Returns:

{<status>: [<job_id>,]}

Return type:

dict