(
            self, aggregator_name, parameters, search_id=None, chart_type=None)
return error.get_response_json(response, logger)
Run an aggregator class.

        Args:
            aggregator_name: the name of the aggregator class.
            parameters: a dict with the parameters for the aggregation class.
            search_id: an optional integer value with a primary key to a
                saved search.
            chart_type: string with the chart type.

        Returns:
            A dict with the aggregation results.
Run an aggregator class.
Run an aggregator class .
def _run_aggregator(
            self, aggregator_name, parameters, search_id=None, chart_type=None):
        """Run an aggregator class.

        Args:
            aggregator_name: the name of the aggregator class.
            parameters: a dict with the parameters for the aggregation class.
            search_id: an optional integer value with a primary key to a
                saved search.
            chart_type: string with the chart type.

        Returns:
            A dict with the aggregation results.
        """
        resource_url = '{0:s}/sketches/{1:d}/aggregation/explore/'.format(
            self.api.api_root, self._sketch.id)

        if chart_type is None and parameters.get('supported_charts'):
            chart_type = parameters.get('supported_charts')
            if isinstance(chart_type, (list, tuple)):
                chart_type = chart_type[0]

        if chart_type:
            self.chart_type = chart_type

        if search_id:
            self.search_id = search_id

        self.aggregator_name = aggregator_name
        self.chart_color = parameters.get('chart_color', '')
        self._parameters = parameters

        form_data = {
            'aggregator_name': aggregator_name,
            'aggregator_parameters': parameters,
            'chart_type': chart_type,
            'view_id': search_id,
        }

        response = self.api.session.post(resource_url, json=form_data)
        if not error.check_return_status(response, logger):
            error.error_message(
                response, message='Unable to query results', error=ValueError)

        return error.get_response_json(response, logger)
def _run_aggregator ( self , aggregator_name , parameters , search_id = None , chart_type = None ) : resource_url = '{0:s}/sketches/{1:d}/aggregation/explore/' . format ( self . api . api_root , self . _sketch . id ) if chart_type is None and parameters . get ( 'supported_charts' ) : chart_type = parameters . get ( 'supported_charts' ) if isinstance ( chart_type , ( list , tuple ) ) : chart_type = chart_type [ 0 ] if chart_type : self . chart_type = chart_type if search_id : self . search_id = search_id self . aggregator_name = aggregator_name self . chart_color = parameters . get ( 'chart_color' , '' ) self . _parameters = parameters form_data = { 'aggregator_name' : aggregator_name , 'aggregator_parameters' : parameters , 'chart_type' : chart_type , 'view_id' : search_id , } response = self . api . session . post ( resource_url , json = form_data ) if not error . check_return_status ( response , logger ) : error . error_message ( response , message = 'Unable to query results' , error = ValueError ) return error . get_response_json ( response , logger )