views.py 文件源码

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

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

    mimetype = 'application/json'
    data = {}

    if request.method == 'POST' and 'entity' in request.POST and request.POST['entity'] != '':        
        data['client'], data['check'] = request.POST['entity'].split(':')       
        data['status'] = 0
        data['timestamp'] = datetime.datetime.now().timestamp()

        if sensu_result_delete(data):
            data['result'] = 'okay'
        else:        
            data['result'] = 'failed deleting result using sensu api for: ' + request.POST['entity']

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



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


问题


面经


文章

微信
公众号

扫码关注公众号