Ejemplo n.º 1
0
 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))
Ejemplo n.º 2
0
 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))
Ejemplo n.º 3
0
 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))
Ejemplo n.º 4
0
 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))
Ejemplo n.º 5
0
 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))
Ejemplo n.º 6
0
 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))
Ejemplo n.º 7
0
 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))
Ejemplo n.º 8
0
 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))
Ejemplo n.º 9
0
 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))
Ejemplo n.º 10
0
 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))
Ejemplo n.º 11
0
 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.")
Ejemplo n.º 12
0
 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))
Ejemplo n.º 13
0
 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))
Ejemplo n.º 14
0
 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.")
Ejemplo n.º 15
0
 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.")
Ejemplo n.º 16
0
 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.")
Ejemplo n.º 17
0
 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.")
Ejemplo n.º 18
0
 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))
Ejemplo n.º 19
0
 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.")
Ejemplo n.º 20
0
 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))
Ejemplo n.º 21
0
 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.")
Ejemplo n.º 22
0
 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.")