REST API - Datasets

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

Setup method for Dataset REST API.

Parameters:

handler_cfg (dict) – args to pass to the route

Returns:

routes, database, indexes

Return type:

dict

class iceprod.rest.handlers.datasets.MultiDatasetHandler(*args, **kwargs)[source]

Handle multi-dataset requests.

async get()[source]

Get a dict of datasets.

Params (optional):

status: | separated list of status filters groups: | separated list of groups to filter on users: | separated list of users to filter on keys: | separated list of keys to return for each dataset

Returns:

{<dataset_id>: metadata}

Return type:

dict

async post()[source]

Add a dataset.

Body should contain all necessary fields for a dataset.

class iceprod.rest.handlers.datasets.DatasetHandler(*args, **kwargs)[source]

Handle dataset requests.

async get(dataset_id)[source]

Get a dataset.

Parameters:

dataset_id (str) – the dataset

Returns:

dataset metadata

Return type:

dict

class iceprod.rest.handlers.datasets.DatasetDescriptionHandler(*args, **kwargs)[source]

Handle dataset description updates.

async put(dataset_id)[source]

Set a dataset description.

Parameters:

dataset_id (str) – the dataset

Returns:

empty dict

Return type:

dict

class iceprod.rest.handlers.datasets.DatasetStatusHandler(*args, **kwargs)[source]

Handle dataset status updates.

async put(dataset_id)[source]

Set a dataset status, following possible state transitions.

Parameters:

dataset_id (str) – the dataset

Returns:

empty dict

Return type:

dict

class iceprod.rest.handlers.datasets.DatasetPriorityHandler(*args, **kwargs)[source]

Handle dataset priority updates.

async put(dataset_id)[source]

Set a dataset priority.

Parameters:

dataset_id (str) – the dataset

Returns:

empty dict

Return type:

dict

class iceprod.rest.handlers.datasets.DatasetJobsSubmittedHandler(*args, **kwargs)[source]

Handle dataset jobs_submitted updates.

async put(dataset_id)[source]

Set a dataset’s jobs_submitted.

Only allows increases, if the jobs_immutable flag is not set.

Parameters:

dataset_id (str) – the dataset

Json body:

jobs_submitted (int): the number of jobs submitted

Returns:

empty dict

Return type:

dict

class iceprod.rest.handlers.datasets.DatasetHardResetHandler(*args, **kwargs)[source]

Do a hard reset on a dataset.

async post(dataset_id)[source]

Do a hard reset on a dataset.

Returns:

empty dict

Return type:

dict

class iceprod.rest.handlers.datasets.DatasetTruncateHandler(*args, **kwargs)[source]

Truncate a dataset.

async post(dataset_id)[source]

Truncate a dataset.

Returns:

empty dict

Return type:

dict

class iceprod.rest.handlers.datasets.DatasetSummariesStatusHandler(*args, **kwargs)[source]

Handle dataset summary grouping by status.

async get()[source]

Get the dataset summary for all datasets, group by status.

Returns:

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

Return type:

dict