Beispiel #1
0
    def __init__(self, query_parameters, url_data, tenant, **kwargs):
        """Establish AWS report query handler.

        Args:
            query_parameters    (Dict): parameters for query
            url_data        (String): URL string to provide order information
            tenant    (String): the tenant to use to access CUR data
            kwargs    (Dict): A dictionary for internal query alteration based on path

        """
        provider = 'AWS'

        self._initialize_kwargs(kwargs)

        if kwargs.get('access'):
            query_parameters = update_query_parameters_for_aws(
                query_parameters, kwargs.get('access'))

        # do not override mapper if its already set
        try:
            getattr(self, '_mapper')
        except AttributeError:
            self._mapper = AWSProviderMap(
                provider=provider, report_type=kwargs.get('report_type'))

        self.group_by_options = self._mapper.provider_map.get(
            'group_by_options')
        self.query_parameters = query_parameters
        self.url_data = url_data
        self._limit = self.get_query_param_data('filter', 'limit')

        super().__init__(query_parameters, tenant, **kwargs)
Beispiel #2
0
    def __init__(self, parameters):
        """Establish AWS report query handler.

        Args:
            parameters    (QueryParameters): parameter object for query

        """
        if not hasattr(self, "_mapper"):
            self._mapper = AWSProviderMap(provider=self.provider, report_type=parameters.report_type)
        # super() needs to be called after _mapper is set
        super().__init__(parameters)
Beispiel #3
0
    def __init__(self, parameters):
        """Establish AWS report query handler.

        Args:
            parameters    (QueryParameters): parameter object for query

        """
        self._parameters = parameters
        if not hasattr(self, "_mapper"):
            self._mapper = AWSProviderMap(provider=self.provider, report_type=parameters.report_type)
        if parameters.get_filter("enabled") is None:
            parameters.set_filter(**{"enabled": True})
        # super() needs to be called after _mapper is set
        super().__init__(parameters)
Beispiel #4
0
    def __init__(self, parameters):
        """Establish AWS report query handler.

        Args:
            parameters    (QueryParameters): parameter object for query

        """
        # do not override mapper if its already set
        try:
            getattr(self, "_mapper")
        except AttributeError:
            self._mapper = AWSProviderMap(provider=self.provider, report_type=parameters.report_type)

        self.group_by_options = self._mapper.provider_map.get("group_by_options")
        self._limit = parameters.get_filter("limit")

        # super() needs to be called after _mapper and _limit is set
        super().__init__(parameters)