def refresh(self): """Reloads task data""" task_id = self.json["id"] response = base.get(path="/foreman_tasks/api/tasks/{0}".format( task_id) ) self.json = response.json()
def list(cls, **kwargs): """"Query method, args are forwarded to underlying requests.get call """ path = cls.parse_path_arg(kwargs) return base.get(path=path, **kwargs)
def show(cls, uid, **kwargs): """Read method, args are forwarded to underlying requests.get call, id is required """ path = cls.parse_path_arg(kwargs) path = "{0}/{1}".format(path, uid) return base.get(path=path, **kwargs)
def list(cls, **kwargs): """"Query method, args are forwarded to underlying requests.get call """ path = cls.parse_path_arg(cls.api_path, kwargs) if hasattr(cls, 'api_path_get'): path = cls.parse_path_arg(cls.api_path_get, kwargs) return base.get(path=path, **kwargs)
def show(cls, uid, **kwargs): """Read method, args are forwarded to underlying requests.get call, id is required """ path = cls.parse_path_arg(cls.api_path, kwargs) if hasattr(cls, 'api_path_get'): path = cls.parse_path_arg(cls.api_path_get, kwargs) path = "{0}/{1}".format(path, uid) return base.get(path=path, **kwargs)
def show(cls, uid, **kwargs): """Read method, args are forwarded to underlying requests.get call, id is required """ path = cls.parse_path_arg(cls.get_api_path(), kwargs) if hasattr(cls, 'api_path_get'): path = cls.parse_path_arg( cls.api_path_get, kwargs) # pylint: disable=E1101 path = "{0}/{1}".format(path, uid) return base.get(path=path, **kwargs)
def refresh(self): """Reloads task data""" id = self.json["id"] r = base.get(path="/foreman_tasks/api/tasks/{0}".format(id)) self.json = r.json()