def ajax_weight(request, mode, port, realserver, weight, realsmode): if not ipvsadm.ipvadmin_exists(): return HttpResponseServerError('<h1>Command ipvsadm not found</h1>') if 0 != ipvsadm.weight_real_server(mode, port, realserver, weight, realsmode.upper()): return HttpResponseServerError('<h1>Error with ipvsadm execution</h1>') return JsonResponse({'return': 'OK'})
def ajax_weight(request,mode,port,realserver,weight,realsmode): if not ipvsadm.ipvadmin_exists(): return HttpResponseServerError('<h1>Command ipvsadm not found</h1>') if 0 != ipvsadm.weight_real_server(mode, port,realserver,weight,realsmode.upper()): return HttpResponseServerError('<h1>Error with ipvsadm execution</h1>') return JsonResponse({'return':'OK'})
def ajax_delete_virtual_server(request, mode, port): if not ipvsadm.ipvadmin_exists(): return HttpResponseServerError('<h1>Command ipvsadm not found</h1>') if 0 != ipvsadm.delete_virtual_server(mode, port): return HttpResponseServerError('<h1>Error with ipvsadm execution</h1>') return JsonResponse({'return': 'OK'})
def ajax_delete_virtual_server(request,mode,port): if not ipvsadm.ipvadmin_exists(): return HttpResponseServerError('<h1>Command ipvsadm not found</h1>') if 0 != ipvsadm.delete_virtual_server(mode, port): return HttpResponseServerError('<h1>Error with ipvsadm execution</h1>') return JsonResponse({'return':'OK'})