示例#1
0
 def get_pivots(self, summary_size=10):
     """get a number of pivots for this project"""
     params = filter_locals(locals())
     query_params = dict_to_query_params(params)
     return [
         Pivot(x, project=self, client=self._client)
         for x in self._client.get("projects/{}/pivots{}".format(
             self.id, query_params))
     ]
示例#2
0
    def get_collaborators(self, per_page=30, q=None, exclude_project=None):
        """get collaborators for this organization"""
        params = filter_locals(locals())
        query_params = dict_to_query_params(params)

        path = "organizations/{}/collaborators{}".format(self.id, query_params)
        return [
            Collaborator(x, organization=self, client=self._client)
            for x in self._client.get(path)
        ]
示例#3
0
    def get_projects(
        self,
        sort=Project.Sort.CREATED_AT,
        direction=Project.Sort.Direction.DESCENDING,
        per_page=30,
    ):
        """gets the projects based on the params"""
        params = filter_locals(locals())
        query_params = dict_to_query_params(params)

        path = "organizations/{}/projects{}".format(self.id, query_params)
        return [
            Project(x, organization=self, client=self._client)
            for x in self._client.get(path)
        ]
示例#4
0
    def get_releases(
        self,
        release_stage=None,
        base=None,
        sort=Release.Sort.TIMESTAMP,
        offset=0,
        per_page=5,
    ):
        """get a list of releases for this project"""
        params = filter_locals(locals())

        if "base" in params:
            params["base"] = datetime_to_iso8601(params["base"])

        query_params = dict_to_query_params(params)
        path = "projects/{}/releases{}".format(self.id, query_params)
        return [
            Release(x, project=self, client=self._client)
            for x in self._client.get(path)
        ]
示例#5
0
    def get_errors(
            self,
            base=None,
            sort=Error.Sort.LAST_SEEN,
            direction=Error.Sort.Direction.DESCENDING,
            per_page=30,
            filters=None,  # TODO
            **kwargs):
        """get errors for this project"""
        params = filter_locals(locals())

        if "base" not in params:
            params["base"] = datetime.now()

        query_params = dict_to_query_params(params)
        path = "projects/{}/errors{}".format(self.id, query_params)
        return [
            Error(x, project=self, client=self._client)
            for x in self._client.get(path)
        ]
示例#6
0
    def get_events(
            self,
            base=None,
            sort=Event.Sort.TIMESTAMP,
            direction=Event.Sort.Direction.DESCENDING,
            per_page=30,
            filters=None,  # TODO
            full_reports=False,
            **kwargs):
        """get events for this project"""
        params = filter_locals(locals())

        if "base" not in params:
            params["base"] = datetime.now()

        query_params = dict_to_query_params(params)
        path = "projects/{}/events{}".format(self.id, query_params)
        return [
            Event(x, project=self, client=self._client)
            for x in self._client.get(path)
        ]