blob: 581eb4672ff9b1ea4eee287aba846b7a2942008e [file] [log] [blame]
Scott Baker1a5fab32015-02-06 17:05:17 -08001import os
2import sys
3sys.path.append("/opt/xos")
Scott Baker86e132c2015-02-11 21:38:09 -08004os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
Scott Baker1a5fab32015-02-06 17:05:17 -08005import django
6from core.models import *
7django.setup()
8
9# python ./manage.py sqlflush | python ./manage.py dbshell
10
11os.system("python /opt/xos/manage.py sqlflush | python /opt/xos/manage.py dbshell")
12
13ADMIN_USERNAME = "padmin@vicci.org"
14ADMIN_PASSWORD = "letmein"
15FLAVORS = ["m1.small", "m1.medium", "m1.large"]
16SITE_ROLES = ["admin", "pi", "tech"]
17SLICE_ROLES = ["admin", "access"]
18DEPLOYMENT_ROLES = ["admin"]
19
Scott Baker1ebc7232015-02-17 14:39:47 -080020d = Deployment(name="MyDeployment")
Scott Baker1a5fab32015-02-06 17:05:17 -080021d.save()
22
23s = Site(name="MySite", enabled=True, login_base="mysite", is_public=True, abbreviated_name="mysite")
24s.save()
25
26sd = SiteDeployment(site=s, deployment=d)
27sd.save();
28
Scott Baker1ebc7232015-02-17 14:39:47 -080029u = User(email = ADMIN_USERNAME, password=ADMIN_PASSWORD, is_admin=True, is_active=True, site=s, firstname="XOS",
Scott Baker1a5fab32015-02-06 17:05:17 -080030 lastname="admin")
31u.save()
32
33for flavor_name in FLAVORS:
34 f = Flavor(name=flavor_name, flavor=flavor_name)
35 f.save()
36 f.deployments.add(d)
37 f.save()
38
39for site_role_name in SITE_ROLES:
40 sr = SiteRole(role=site_role_name)
41 sr.save()
42
43for slice_role_name in SLICE_ROLES:
44 sr = SliceRole(role=slice_role_name)
45 sr.save()
46
47for deployment_role_name in DEPLOYMENT_ROLES:
48 dr = DeploymentRole(role=deployment_role_name)
49 dr.save()
50
51DashboardView(name="xsh", url="template:xsh", enabled=True).save()
52DashboardView(name="Customize", url="template:customize", enabled=True).save()
Scott Baker1ebc7232015-02-17 14:39:47 -080053tv=DashboardView(name="Tenant", url="template:xosTenant", enabled=True)
54tv.save()
55tv.deployments.add(d)
56tv.save()
Scott Baker1a5fab32015-02-06 17:05:17 -080057DashboardView(name="Developer", url="template:xosDeveloper_datatables", enabled=True).save()
58
59ServiceClass(name="Best Effort", description="Best Effort").save()
60
Scott Baker85aaa432015-02-11 22:36:07 -080061NetworkTemplate(name="Private", description="A private virtual network", visibility="private", translation="none", topology_kind="bigswitch", controller_kind="none").save()
62NetworkTemplate(name="Public shared IPv4", description="Connect a sliver to the public network", visibility="private", translation="NAT", shared_network_name="nat-net", topology_kind="bigswitch", controller_kind="none").save()
63NetworkTemplate(name="Public dedicated IPv4", description="Connect a sliver to the public network", visibility="public", translation="none", shared_network_name="ext-net", topology_kind="bigswitch", controller_kind="none").save()
64