Example #1
0
def index(request):
    tenant_id = '09688e8787a84ab5b103c7721cecb1ce'
    token = api.get_token(tenant_id)

    instances = Instance.objects.all()
    instances.delete()

    api.save_server_detail(tenant_id, token)

    return HttpResponseRedirect('/admin/instances/instance/')
Example #2
0
def associate(request):
    tenant_id = '09688e8787a84ab5b103c7721cecb1ce'
    token = api.get_token(tenant_id)

    ip = request.GET['ip']

    instances = Instance.objects.all()
    instances.delete()

    api.save_server_detail(tenant_id, token)

    instance_list = Instance.objects.all()

    return render_to_response('admin/floatingip_associate.html', {'ip':ip, 'instance_list':instance_list}, context_instance=RequestContext(request))