Exemplo n.º 1
0
def queue_list(request, server_id, xml=False):
    server = Server(server_id)
    if xml:
        return HttpResponse(serializers.serialize('xml',
                                                  server.queue_list(),
                                                  indent=True),
                            mimetype='text/xml')
    return render_to_response('pbs_servers/queue_list.html',
                              locals(),
                              context_instance=RequestContext(request))
Exemplo n.º 2
0
def user_detail(request, username, xml=False):

    job_list = []

    for s in settings.LOCAL_PBS_SERVERS:
        try:
            server = Server(s)
            job_list.extend(server.job_list([username]))
        except:
            pass

    return render_to_response('pbs_users/user_detail.html', locals(), context_instance=RequestContext(request))
Exemplo n.º 3
0
def server_detail(request, server_id, xml=False):

    if not server_id in settings.LOCAL_PBS_SERVERS:
        raise Http404

    server = Server(server_id)
    
    c_used, c_total = server.cpu_stats()
    c_percent = (float(c_used)/float(c_total))*100.00

    if xml:
        return HttpResponse(serializers.serialize('xml', [server], indent=True), mimetype='text/xml')

    return render_to_response('pbs_servers/server_detail.html', locals(), context_instance=RequestContext(request))
Exemplo n.º 4
0
def user_detail(request, username):

    job_list = []

    for s in settings.LOCAL_PBS_SERVERS:
        try:
            server = Server(s)
            job_list.extend(server.job_list([username]))
        except:
            pass

    return render_to_response('pbs_users/user_detail.html',
                              locals(),
                              context_instance=RequestContext(request))
Exemplo n.º 5
0
def server_detail(request, server_id, xml=False):

    if not server_id in settings.LOCAL_PBS_SERVERS:
        raise Http404

    server = Server(server_id)

    c_used, c_total = server.cpu_stats()
    c_percent = (float(c_used) / float(c_total)) * 100.00

    if xml:
        return HttpResponse(serializers.serialize('xml', [server],
                                                  indent=True),
                            mimetype='text/xml')

    return render_to_response('pbs_servers/server_detail.html',
                              locals(),
                              context_instance=RequestContext(request))
Exemplo n.º 6
0
def job_detail(request, job_id, server_id=None, xml=False):

    
    id, server = job_id.split('.', 1)

    try:
        job = Job(Server(server), id)
    except:
        raise Http404

    if xml:
        return HttpResponse(serializers.serialize('xml', [job], indent=True), mimetype='text/xml')

    return render_to_response('pbs_jobs/job_detail.html', locals(), context_instance=RequestContext(request))
Exemplo n.º 7
0
def queue_list(request, server_id, xml=False):
    server = Server(server_id)
    if xml:
        return HttpResponse(serializers.serialize('xml', server.queue_list(), indent=True), mimetype='text/xml')
    return render_to_response('pbs_servers/queue_list.html', locals(), context_instance=RequestContext(request))