Ejemplo n.º 1
0
 def __init__(self, http_client):
     ListableObjectsClient.__init__(self, http_client, Subaccount,
                                    "/subaccounts")
     self.active = Lister(
         PageFetcher(Subaccount, self.http_client, "/subaccounts/active"))
     self.inactive = Lister(
         PageFetcher(Subaccount, self.http_client, "/subaccounts/inactive"))
Ejemplo n.º 2
0
 def __init__(self, http_client):
     ListableObjectsClient.__init__(self, http_client, Workspace,
                                    "/workspaces")
     self.active = Lister(
         PageFetcher(Workspace, self.http_client, "/workspaces/active"))
     self.inactive = Lister(
         PageFetcher(Workspace, self.http_client, "/workspaces/inactive"))
Ejemplo n.º 3
0
    def list(self, filter=None):
        page_fetcher = PageFetcher(Workspace, self.http_client, "/workspaces")

        if filter is not None:
            page_fetcher.set_query_param("filter", filter)

        return Lister(page_fetcher).list()
Ejemplo n.º 4
0
    def list(self, filter=None):
        page_fetcher = PageFetcher(Subaccount, self.http_client,
                                   "/subaccounts")

        if filter is not None:
            page_fetcher.set_query_param("filter", filter)

        return Lister(page_fetcher).list()
Ejemplo n.º 5
0
 def status_changes_for_object(self, key, object_id):
     url = "/events/{key}/objects/{objectId}/status-changes"
     page_fetcher = PageFetcher(StatusChange,
                                self.http_client,
                                url,
                                key=key,
                                objectId=object_id)
     return Lister(page_fetcher)
Ejemplo n.º 6
0
    def list(self, chart_filter=None, tag=None, expand_events=None, with_validation=False):
        page_fetcher = PageFetcher(Chart, self.http_client, "/charts") \
            .set_query_param("filter", chart_filter) \
            .set_query_param("tag", tag) \
            .set_query_param("validation", with_validation)

        if expand_events is not None:
            page_fetcher.set_query_param("expand", "events")
        return Lister(page_fetcher).list()
Ejemplo n.º 7
0
 def status_changes(self,
                    key,
                    filter=None,
                    sort_field=None,
                    sort_direction=None):
     page_fetcher = PageFetcher(StatusChange,
                                self.http_client,
                                "/events/{key}/status-changes",
                                key=key)
     page_fetcher.set_query_param("filter", filter)
     page_fetcher.set_query_param("sort",
                                  self.to_sort(sort_field, sort_direction))
     return Lister(page_fetcher)
Ejemplo n.º 8
0
 def __init__(self, http_client):
     ListableObjectsClient.__init__(self, http_client, Chart, "/charts")
     self.archive = Lister(PageFetcher(Chart, self.http_client, "/charts/archive"))
     self.reports = ChartReports(self.http_client)
Ejemplo n.º 9
0
 def __lister(self):
     return Lister(PageFetcher(self.cls, self.http_client, self.relative_url))