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'))
评论列表
文章目录