(self, aggregate_dsl, **kwargs)
Initialize the aggregation object by running an aggregation DSL.

        Args:
            aggregate_dsl: OpenSearch aggregation query DSL string.
Initialize the aggregation object by running an aggregation DSL.
Initialize the aggregation object by running an aggregation DSL .
def from_manual(self, aggregate_dsl, **kwargs):
        """Initialize the aggregation object by running an aggregation DSL.

        Args:
            aggregate_dsl: OpenSearch aggregation query DSL string.
        """
        super().from_manual(**kwargs)
        resource_url = '{0:s}/sketches/{1:d}/aggregation/explore/'.format(
            self.api.api_root, self._sketch.id)

        self.aggregator_name = 'DSL'
        self._username = getpass.getuser()
        self.type = 'DSL'

        date_now = datetime.datetime.now(datetime.timezone.utc)
        self._created_at = date_now.isoformat()
        self._updated_at = date_now.isoformat()

        form_data = {
            'aggregation_dsl': aggregate_dsl,
        }

        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)

        self.resource_data = error.get_response_json(response, logger)
def from_manual ( self , aggregate_dsl , * * kwargs ) : super ( ) . from_manual ( * * kwargs ) resource_url = '{0:s}/sketches/{1:d}/aggregation/explore/' . format ( self . api . api_root , self . _sketch . id ) self . aggregator_name = 'DSL' self . _username = getpass . getuser ( ) self . type = 'DSL' date_now = datetime . datetime . now ( datetime . timezone . utc ) self . _created_at = date_now . isoformat ( ) self . _updated_at = date_now . isoformat ( ) form_data = { 'aggregation_dsl' : aggregate_dsl , } 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 ) self . resource_data = error . get_response_json ( response , logger )