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.")
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, 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 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 upload(self, dataset_id, storagebox, dataset_path, file_path): """ Upload datafile. """ # pylint: disable=no-self-use DataFile.upload(dataset_id, storagebox, dataset_path, file_path)
def download(self, datafile_id): """ Download datafile. """ # pylint: disable=no-self-use DataFile.download(datafile_id)
def verify(self, datafile_id): """ Ask MyTardis to verify a datafile. """ # pylint: disable=no-self-use DataFile.verify(datafile_id)