(self, rule_text)
Get a Sigma object from a rule text.

        Args:
            rule_text: Rule text to be parsed.

        Raises:
            ValueError: If no response was given
Get a Sigma object from a rule text.
Get a Sigma object from a rule text .
def from_text(self, rule_text):
        """Get a Sigma object from a rule text.

        Args:
            rule_text: Rule text to be parsed.

        Raises:
            ValueError: If no response was given
        """
        self.resource_uri = '{0:s}/sigma/text/'.format(self.api.api_root)
        data = {'title': 'Get_Sigma_by_text', 'content': rule_text}
        response = self.api.session.post(self.resource_uri, json=data)
        response_dict = error.get_response_json(response, logger)

        objects = response_dict.get('objects')
        if not objects:
            logger.warning(
                'Unable to parse rule with given text')
            raise ValueError('No rules found.')

        rule_dict = objects[0]
        for key, value in rule_dict.items():
            self.set_value(key, value)
def from_text ( self , rule_text ) : self . resource_uri = '{0:s}/sigma/text/' . format ( self . api . api_root ) data = { 'title' : 'Get_Sigma_by_text' , 'content' : rule_text } response = self . api . session . post ( self . resource_uri , json = data ) response_dict = error . get_response_json ( response , logger ) objects = response_dict . get ( 'objects' ) if not objects : logger . warning ( 'Unable to parse rule with given text' ) raise ValueError ( 'No rules found.' ) rule_dict = objects [ 0 ] for key , value in rule_dict . items ( ) : self . set_value ( key , value )