Exemplo n.º 1
0
    def list_collections(self) -> List[dict]:
        """
        Loads all available imagecollections types.

        :return: list of collection meta data dictionaries
        """
        data = self.get('/collections').json()["collections"]
        return VisualList("collections", data=data)
Exemplo n.º 2
0
    def list_processes(self) -> List[dict]:
        # TODO: Maybe format the result dictionary so that the process_id is the key of the dictionary.
        """
        Loads all available processes of the back end.

        :return: processes_dict: Dict All available processes of the back end.
        """
        data = self.get('/processes').json()["processes"]
        return VisualList("processes", data=data)
Exemplo n.º 3
0
 def logs(self, offset=None) -> List[LogEntry]:
     """ Retrieve service logs."""
     url = "/service/{}/logs".format(self.service_id)
     logs = self.connection.get(url,
                                params={
                                    'offset': offset
                                },
                                expected_status=200).json()["logs"]
     entries = [LogEntry(log) for log in logs]
     return VisualList('logs', data=entries)
Exemplo n.º 4
0
    def list_files(self):
        """
        Lists all files that the logged in user uploaded.

        :return: file_list: List of the user uploaded files.
        """

        files = self.get('/files').json()['files']
        return VisualList("data-table",
                          data=files,
                          parameters={'columns': 'files'})
Exemplo n.º 5
0
    def list_jobs(self) -> dict:
        """
        Lists all jobs of the authenticated user.

        :return: job_list: Dict of all jobs of the user.
        """
        # TODO: Parse the result so that there get Job classes returned?
        jobs = self.get('/jobs').json()["jobs"]
        return VisualList("data-table",
                          data=jobs,
                          parameters={'columns': 'jobs'})
Exemplo n.º 6
0
    def list_services(self) -> dict:
        """
        Loads all available services of the authenticated user.

        :return: data_dict: Dict All available services
        """
        # TODO return parsed service objects
        services = self.get('/services').json()["services"]
        return VisualList("data-table",
                          data=services,
                          parameters={'columns': 'services'})
Exemplo n.º 7
0
 def logs(self, offset=None) -> List[LogEntry]:
     """ Retrieve job logs."""
     # TODO: option to filter on level? Or move filtering functionality to a separate batch job logs class?
     url = "/jobs/{}/logs".format(self.job_id)
     logs = self.connection.get(url,
                                params={
                                    'offset': offset
                                },
                                expected_status=200).json()["logs"]
     entries = [LogEntry(log) for log in logs]
     return VisualList('logs', data=entries)