Exemple #1
0
 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()
Exemple #2
0
    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)
Exemple #3
0
    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)
Exemple #4
0
    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)
Exemple #5
0
    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)
Exemple #6
0
    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)
Exemple #7
0
    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)
Exemple #8
0
 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()