blob: 3b7a911b77648c4d68ec5f472acc4e2f6a22491b [file] [log] [blame]
srikanth116e6e82014-08-19 07:22:37 -07001#
2# Copyright (c) 2013 Big Switch Networks, Inc.
3#
4# Licensed under the Eclipse Public License, Version 1.0 (the
5# "License"); you may not use this file except in compliance with the
6# License. You may obtain a copy of the License at
7#
8# http://www.eclipse.org/legal/epl-v10.html
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13# implied. See the License for the specific language governing
14# permissions and limitations under the License.
15#
16
17# Views for the web UI
18#
19
20from django.shortcuts import render_to_response, render
21from django.utils import simplejson
22from django.http import HttpResponse
23from django.contrib.auth.decorators import login_required
24from django.contrib.auth.models import User
25from django.template import RequestContext
26from django.template.loader import render_to_string
27from sdncon.apploader import AppLoader, AppLister
28from sdncon.clusterAdmin.utils import conditionally, isCloudBuild
29from sdncon.clusterAdmin.models import Customer, Cluster, CustomerUser
30from scripts.showswitch import show_switch_data
31from scripts.buildtopology import build_topology_data
32from scripts.showlink import show_link_data
33from scripts.showtunnel import show_tunnel_data
34from scripts.showhost import show_host_data
35import os
36
37
38JSON_CONTENT_TYPE = 'application/json'
39
40# --- View for the root page of any application
41def index(request):
42 return render_to_response('ui/templates/index.html')
43
44def show_switch(request):
45 html = show_switch_data(request)
46 return HttpResponse(html)
47
48def show_link(request):
49 html = show_link_data(request)
50 return HttpResponse(html)
51
52def show_host(request):
53 html = show_host_data(request)
54 return HttpResponse(html)
55
56def show_tunnel(request):
57 html = show_tunnel_data(request)
58 return HttpResponse(html)
59
60
61def build_topology(request):
62 html = build_topology_data(request)
63 return HttpResponse(html)
64
65
66