views.py 文件源码

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

项目:sensu_drive 作者: ilavender 项目源码 文件源码
def resolve(request):

    mimetype = 'application/json'
    data = {}

    if request.method == 'POST' and 'entity' in request.POST and request.POST['entity'] != '':
        data['entity'] = request.POST['entity']        
        data['status'] = 0
        data['timestamp'] = datetime.datetime.now().timestamp()        
        data['output'] = "resolve request by %s" % (request.user.username)
        data['result'] = 'okay'

        sensu_event_resolve(data)
        Channel('background-alert').send(dict(data))


    return HttpResponse(json.dumps(data), mimetype)



#@login_required(login_url=reverse_lazy('login'))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号