def get_managed_repo(self, client): """ For the moment this assumes there's only one. """ from omero.grid import ManagedRepositoryPrx as MRepo shared = client.sf.sharedResources() repos = shared.repositories() repos = zip(repos.descriptions, repos.proxies) repos.sort(lambda a, b: cmp(a[0].id.val, b[0].id.val)) for idx, pair in enumerate(repos): if MRepo.checkedCast(pair[1]): return pair
def repos(self, args): """List all repositories. These repositories are where OMERO stores all binary data for your system. Most useful is likely the "ManagedRepository" where OMERO 5 imports to. Examples: bin/omero fs repos # Show all bin/omero fs repos --managed # Show only the managed repo # Or to print only the directory # under Unix: bin/omero fs repos --managed --style=plain | cut -d, -f5 """ from omero.grid import ManagedRepositoryPrx as MRepo client = self.ctx.conn(args) shared = client.sf.sharedResources() repos = shared.repositories() repos = zip(repos.descriptions, repos.proxies) repos.sort(lambda a, b: cmp(a[0].id.val, b[0].id.val)) tb = self._table(args) tb.cols(["Id", "UUID", "Type", "Path"]) for idx, pair in enumerate(repos): desc, prx = pair path = "".join([desc.path.val, desc.name.val]) type = "Public" is_mrepo = MRepo.checkedCast(prx) if is_mrepo: type = "Managed" if args.managed and not is_mrepo: continue if desc.hash.val == "ScriptRepo": type = "Script" tb.row(idx, *(desc.id.val, desc.hash.val, type, path)) self.ctx.out(str(tb.build()))