def resolve_name(self, name, return_none=False): ws = str(rest_crud.get_workspace()) __id = self.__map.get(ws, {}).get(name, None) if __id is None: self.__fill_map(ws, name) __id = self.__map.get(ws, {}).get(name, None) if not __id and not return_none: raise cli_exception.CliException(f"No id associated to the name '{name}'") return __id
def resolve_name_or_json(self, name): ws = str(rest_crud.get_workspace()) __id = self.__map.get(ws, {}).get(name, None) if __id is None: __json = self.__fill_map(ws, name) if __json: return __json else: raise cli_exception.CliException(f"No object associated to the name '{name}'") return __id
def get_map(self): ws = str(rest_crud.get_workspace()) if len(self.__map) == 0: self.__fill_map(ws) return self.__map[ws]