Exemplo n.º 1
0
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'})
Exemplo n.º 2
0
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'})
Exemplo n.º 3
0
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'})
Exemplo n.º 4
0
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'})