def get(self, location_id):
        """
        Get information for a Location
        """

        location_id = normalize_key(location_id)

        results = DATA.get_location_info(location_id)
        return results
Example #2
0
    def get(self, location_id):
        """
        Get information for a Location
        """

        location_id = normalize_key(location_id)

        results = DATA.get_location_info(location_id)
        return results
    def get(self, location_id, client_isp_id):
        """
        Get info for a particular Location + Client
        """

        location_id = normalize_key(location_id)

        results = DATA.get_location_client_isp_info(location_id, client_isp_id)

        return results
    def get(self, location_id):
        """
        Get Locations matching a query
        """

        args = type_arguments.parse_args(request)
        location_id = normalize_key(location_id)

        results = DATA.get_location_children(location_id, args.get('type'))
        return results
Example #5
0
    def get(self, location_id):
        """
        Get Locations matching a query
        """

        args = TYPE_ARGUMENTS.parse_args(request)
        location_id = normalize_key(location_id)

        results = DATA.get_location_children(location_id, args.get('type'))
        return results
    def get(self, location_id):
        """
        Get list of Servers related to this Location
        """

        location_id = normalize_key(location_id)

        args = include_data_arguments.parse_args(request)
        results = DATA.get_location_servers(location_id, args.get('data'))

        return results
Example #7
0
    def get(self, location_id):
        """
        Get list of Servers related to this Location
        """

        location_id = normalize_key(location_id)

        args = INCLUDE_DATA_ARGUMENTS.parse_args(request)
        results = DATA.get_location_servers(location_id, args.get('data'))

        return results
Example #8
0
    def get(self, location_id):
        """
        Get list of Servers related to this Location
        """

        location_id = normalize_key(location_id)

        args = INCLUDE_DATA_ARGUMENTS.parse_args(request)
        results = DATA.get_location_servers(location_id, args.get('data'))

        return results
Example #9
0
    def get(self, location_id, client_isp_id):
        """
        Get info for a particular Location + Client
        """

        location_id = normalize_key(location_id)


        results = DATA.get_location_client_isp_info(location_id, client_isp_id)


        return results
Example #10
0
    def get(self):
        """
        Lists BigTable Connection Details
        Indicate if a BigTable connection has been made \
        and if so, what tables are accessible to the API.
        """
        pool = DATA.get_pool()

        if pool:
            with pool.connection() as connection:
                return {"message": "Connection", "tables": connection.tables()}
        else:
            return {"error": 'No Connection', "tables": []}
    def get(self, location_id):
        """
        Get time-based metrics for a Location
        """

        location_id = normalize_key(location_id)
        args = date_arguments.parse_args(request)
        (startdate, enddate) = get_time_window(args, TIME_BINS)

        timebin = args.get('timebin')
        results = DATA.get_location_metrics(location_id, timebin, startdate,
                                            enddate)

        return results
Example #12
0
    def get(self, location_id, client_id):
        """
        Get time-based metrics for a Location + Client
        """
        location_id = normalize_key(location_id)

        args = DATE_ARGUMENTS.parse_args(request)
        (startdate, enddate) = get_time_window(args, TIME_BINS)

        timebin = args.get('timebin')
        results = DATA.get_location_client_metrics(location_id, client_id,
                                                   timebin, startdate, enddate)

        return results
Example #13
0
    def get(self, location_id, client_id, server_id):
        """
        Get time-based metrics for a Location + Client + Server
        """

        location_id = normalize_key(location_id)

        args = DATE_ARGUMENTS.parse_args(request)
        (startdate, enddate) = get_time_window(args, TIME_BINS)

        timebin = args.get('timebin')
        results = DATA.get_location_client_server_metrics(
            location_id, client_id, server_id, timebin, startdate, enddate)

        return results
Example #14
0
    def get(self):
        """
        Lists BigTable Connection Details
        Indicate if a BigTable connection has been made \
        and if so, what tables are accessible to the API.
        """
        pool = DATA.get_pool()

        if pool:
            with pool.connection() as connection:
                return {
                    "message": "Connection",
                    "project": os.environ.get("PROJECT"),
                    "instance": os.environ.get("BIGTABLE_INSTANCE"),
                    "tables": connection.tables()
                }
        else:
            return {"error":'No Connection', "tables": []}