Esempio n. 1
0
def retrievePortById(request, port_id):
    if request.is_ajax() and request.method == 'POST':
        sess = login("admin", "chiron", "admin", "http://192.168.10.6/identity/v3")
        port = portInfoCmd(sess, port_id)
        return JsonResponse({ 'port' : port })
    else:
        return render(request, 'admin/networks/ports/info.html', {'port_id': port_id})
Esempio n. 2
0
def retrieveNetworkList(request):
    if request.is_ajax() and request.method == 'POST':
        sess = login("admin", "chiron", "admin", "http://192.168.10.6/identity/v3")
        networks = networkIndexCmd("", sess)
        return JsonResponse({ 'networkList' : networks })
    else:
        return render(request, 'admin/networks/index.html', {})
Esempio n. 3
0
def retrieveSubnetById(request, subnet_id):
    if request.is_ajax() and request.method == 'POST':
        sess = login("admin", "chiron", "admin", "http://192.168.10.6/identity/v3")
        subnet = subnetInfoCmd(sess, subnet_id)
        return JsonResponse({ 'subnet' : subnet })
    else:
        # print "is ajax : ", request.is_ajax(), " method:", request.method
        return render(request, 'admin/networks/subnets/info.html', {'subnet_id': subnet_id})
Esempio n. 4
0
def retrieveNetworkById(request, network_id):
    # logger.info("retrieveNetworkById")
    if request.is_ajax() and request.method == 'POST':
        sess = login("admin", "chiron", "admin", "http://192.168.10.6/identity/v3")
        network = networkInfoCmd(sess, network_id)
        return JsonResponse({ 'data' : network })
    else:
        return render(request, 'admin/networks/info.html', { 'network_id' : network_id })
Esempio n. 5
0
def retrieveRouterList(request):
    # logger.info("retrieveRouterList")
    if request.is_ajax() and request.method == 'POST':
        sess = login("admin", "chiron", "admin",
                     "http://192.168.10.6/identity/v3")
        routers = routersIndexCmd(sess)
        return JsonResponse({'data': routers})
    else:
        return render(request, 'admin/routers/index.html', {})
Esempio n. 6
0
def retrieveInstanceList(request):
    sess = login("admin", "chiron", "admin", "http://192.168.10.6:35357/v3")
    novaCmd("", sess)
    instanceList = getInstanceList()
    return render(request, 'admin/instances/index.html',
                  {'instanceList': instanceList})