blob: c92866feec911acc899f5e76d5718537b7e510cf [file] [log] [blame]
Scott Bakerca78dc42015-02-06 17:05:17 -08001import os
2import sys
3sys.path.append("/opt/xos")
Scott Baker76a840e2015-02-11 21:38:09 -08004os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
Scott Bakerca78dc42015-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 Baker0700e832015-02-09 11:20:29 -080020d = Deployment(name="ViCCI")
Scott Bakerca78dc42015-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
29u = User(email = "padmin@vicci.org", password="letmein", is_admin=True, is_active=True, site=s, firstname="XOS",
30 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()
53DashboardView(name="Tenant", url="template:xosTenant", enabled=True).save()
54DashboardView(name="Developer", url="template:xosDeveloper_datatables", enabled=True).save()
55
56ServiceClass(name="Best Effort", description="Best Effort").save()
57
Scott Baker1420ab22015-02-11 22:36:07 -080058NetworkTemplate(name="Private", description="A private virtual network", visibility="private", translation="none", topology_kind="bigswitch", controller_kind="none").save()
59NetworkTemplate(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()
60NetworkTemplate(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()
61