def create(self, term, options):
if not self._state:<EOL><INDENT>raise InvalidState("<STR_LIT>")<EOL><DEDENT>options['<STR_LIT:action>'] = '<STR_LIT>'<EOL>payload = self._build_payload(term, options)<EOL>url = self.ALERTS_CREATE_URL.format(requestX=self._state[<NUM_LIT:3>])<EOL>self._log.debug("<STR_LIT>" % url)<EOL>params = json.dumps(payload, separators=('<STR_LIT:U+002C>', '<STR_LIT::>'))<EOL>data = {'<STR_LIT>': params}<EOL>response = self._session.post(url, data=data, headers=self.HEADERS)<EOL>if response.status_code != <NUM_LIT:200>:<EOL><INDENT>raise ActionError("<STR_LIT>"<EOL>% response.content)<EOL><DEDENT>if options.get('<STR_LIT>', False):<EOL><INDENT>term = "<STR_LIT>" % term<EOL><DEDENT>return self.list(term)<EOL>
Create a monitor using passed configuration.