def get(self, dataset_id, render_format): """ Display dataset record. """ # pylint: disable=no-self-use dataset = Dataset.get(dataset_id) print(render(dataset, render_format)) if render_format == 'table': datafiles = DataFile.list(dataset_id) print(render(datafiles, render_format))
def get(self, experiment_id, render_format): """ Display experiment record. """ # pylint: disable=no-self-use experiment = Experiment.get(experiment_id) print(render(experiment, render_format)) if render_format == 'table': datasets = Dataset.list(experiment_id=experiment_id) print(render(datasets, render_format, display_heading=False))
def get(self, facility_id, render_format): """ Display facility record. """ # pylint: disable=no-self-use facility = Facility.get(facility_id) print(render(facility, render_format)) if render_format == 'table': instruments = Instrument.list(facility_id) print(render(instruments, render_format))
def get(self, storage_box_id, render_format): """ Display storage box record. """ # pylint: disable=no-self-use storage_box = StorageBox.get(storage_box_id) print(render(storage_box, render_format))
def get(self, instrument_id, render_format): """ Display instrument record. """ # pylint: disable=no-self-use instrument = Instrument.get(instrument_id) print(render(instrument, render_format))
def list(self, render_format): """ Display list of API endpoints. """ # pylint: disable=no-self-use api_endpoints = ApiEndpoint.list() print(render(api_endpoints, render_format))
def get(self, datafile_id, render_format): """ Display datafile record. """ # pylint: disable=no-self-use datafile = DataFile.get(datafile_id) print(render(datafile, render_format))
def list(self, limit, offset, order_by, render_format): """ Display list of facility records. """ # pylint: disable=no-self-use facilities = Facility.list(limit, offset, order_by) print(render(facilities, render_format))
def list(self, limit, offset, order_by, render_format): """ Display list of storage boxes. """ # pylint: disable=no-self-use storage_boxes = StorageBox.list(limit, offset, order_by) print(render(storage_boxes, render_format))
def get(self, model, render_format): """ Display schema for a model's API endpoint. """ # pylint: disable=no-self-use api_schema = ApiSchema.get(model) print(render(api_schema, render_format))
def update(self, dataset_id, description, render_format): """ Update dataset record. """ # pylint: disable=no-self-use dataset = Dataset.update(dataset_id, description) print(render(dataset, render_format)) print("Dataset updated successfully.")
def list(self, filters, limit, offset, order_by, render_format): """ Display list of experiment records. """ # pylint: disable=no-self-use # pylint: disable=too-many-arguments experiments = Experiment.list(filters, limit, offset, order_by) print(render(experiments, render_format))
def list(self, dataset_id, directory, filename, filters, limit, offset, order_by, render_format): """ Display list of datafile records. """ # pylint: disable=too-many-arguments # pylint: disable=no-self-use datafiles = DataFile.list(dataset_id, directory, filename, filters, limit, offset, order_by) print(render(datafiles, render_format))
def update(self, datafile_id, md5sum, render_format): """ Update datafile record. """ # pylint: disable=no-self-use datafile = DataFile.update(datafile_id, md5sum) print(render(datafile, render_format)) print("DataFile updated successfully.")
def update(self, instrument_id, name, render_format): """ Update instrument record. """ # pylint: disable=no-self-use instrument = Instrument.update(instrument_id, name) print(render(instrument, render_format)) print("Instrument updated successfully.")
def create(self, facility_id, name, render_format): """ Create instrument record. """ # pylint: disable=no-self-use instrument = Instrument.create(facility_id, name) print(render(instrument, render_format)) print("Instrument created successfully.")
def update(self, experiment_id, title, description, render_format): """ Update experiment record. """ # pylint: disable=no-self-use experiment = \ Experiment.update(experiment_id, title, description) print(render(experiment, render_format)) print("Experiment updated successfully.")
def list(self, facility_id, limit, offset, order_by, render_format): """ Display list of instrument records. """ # pylint: disable=too-many-arguments # pylint: disable=no-self-use instruments = Instrument.list(facility_id, limit, offset, order_by) print(render(instruments, render_format))
def create(self, title, description, institution, params, render_format): """ Create experiment record. """ # pylint: disable=no-self-use # pylint: disable=too-many-arguments experiment = Experiment.create(title, description, institution, params) print(render(experiment, render_format)) print("Experiment created successfully.")
def list(self, experiment_id, filters, limit, offset, order_by, render_format): """ Display list of dataset records. """ # pylint: disable=too-many-arguments # pylint: disable=no-self-use datasets = Dataset.list(experiment_id, filters, limit, offset, order_by) print(render(datasets, render_format))
def create(self, experiment_id, description, instrument_id, params, render_format): """ Create dataset record. """ # pylint: disable=too-many-arguments # pylint: disable=no-self-use dataset = Dataset.create(experiment_id, description, instrument_id, params) print(render(dataset, render_format)) print("Dataset created successfully.")
def create(self, dataset_id, storagebox, dataset_path, path, render_format): """ Create datafile record(s) for an existing file or for all files within a directory. """ # pylint: disable=too-many-arguments # pylint: disable=no-self-use if os.path.isdir(path): num_created = DataFile.create_datafiles(dataset_id, storagebox, dataset_path, path) print("%s datafiles created." % num_created) else: datafile = DataFile.create_datafile(dataset_id, storagebox, dataset_path, path) print(render(datafile, render_format)) print("DataFile created successfully.")