ghost2loggersensor.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:stackstorm-ghost2logger 作者: StackStorm-Exchange 项目源码 文件源码
def _process_request(self, request):
        self._logger.info('[Ghost2logger]: Received Request')
        if request.headers['Content-Type'] == 'application/json':
            payload = request.json
            if 'pattern' and 'host' and 'hostpattern' and 'message' in payload:
                self._logger.info(request.json)
                self._logger.debug('[ghost2logger_sensor]: processing request'
                                   ' {}'.format(payload))

                self._sensor_service.dispatch(trigger=self._pmatch,
                                              payload=payload)
                return ('ok', 200)
            else:
                return ('fail', 415)
        else:
            return ('fail', 415)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号