Lab as a Service 2.0
[laas.git] / src / api / migrations / 0001_initial.py
1 ##############################################################################
2 # Copyright (c) 2018 Parker Berberian, Sawyer Bergeron, and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 # Generated by Django 2.1 on 2018-09-14 14:48
10
11 import api.models
12 from django.conf import settings
13 from django.db import migrations, models
14 import django.db.models.deletion
15
16
17 class Migration(migrations.Migration):
18
19     initial = True
20
21     dependencies = [
22         migrations.swappable_dependency(settings.AUTH_USER_MODEL),
23         ('booking', '__first__'),
24         ('resource_inventory', '__first__'),
25     ]
26
27     operations = [
28         migrations.CreateModel(
29             name='AccessRelation',
30             fields=[
31                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
32                 ('status', models.IntegerField(default=0)),
33                 ('task_id', models.CharField(default=api.models.get_task_uuid, max_length=37)),
34                 ('lab_token', models.CharField(default='null', max_length=50)),
35                 ('message', models.TextField(default='')),
36             ],
37             options={
38                 'abstract': False,
39             },
40         ),
41         migrations.CreateModel(
42             name='HostHardwareRelation',
43             fields=[
44                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
45                 ('status', models.IntegerField(default=0)),
46                 ('task_id', models.CharField(default=api.models.get_task_uuid, max_length=37)),
47                 ('lab_token', models.CharField(default='null', max_length=50)),
48                 ('message', models.TextField(default='')),
49                 ('host', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='resource_inventory.Host')),
50             ],
51             options={
52                 'abstract': False,
53             },
54         ),
55         migrations.CreateModel(
56             name='HostNetworkRelation',
57             fields=[
58                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
59                 ('status', models.IntegerField(default=0)),
60                 ('task_id', models.CharField(default=api.models.get_task_uuid, max_length=37)),
61                 ('lab_token', models.CharField(default='null', max_length=50)),
62                 ('message', models.TextField(default='')),
63                 ('host', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='resource_inventory.Host')),
64             ],
65             options={
66                 'abstract': False,
67             },
68         ),
69         migrations.CreateModel(
70             name='Job',
71             fields=[
72                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
73                 ('status', models.IntegerField(default=0)),
74                 ('delta', models.TextField()),
75                 ('complete', models.BooleanField(default=False)),
76                 ('booking', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='booking.Booking')),
77             ],
78         ),
79         migrations.CreateModel(
80             name='OpnfvApiConfig',
81             fields=[
82                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
83                 ('installer', models.CharField(max_length=100)),
84                 ('scenario', models.CharField(max_length=100)),
85                 ('delta', models.TextField()),
86                 ('roles', models.ManyToManyField(to='resource_inventory.Host')),
87             ],
88         ),
89         migrations.CreateModel(
90             name='SoftwareRelation',
91             fields=[
92                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
93                 ('status', models.IntegerField(default=0)),
94                 ('task_id', models.CharField(default=api.models.get_task_uuid, max_length=37)),
95                 ('lab_token', models.CharField(default='null', max_length=50)),
96                 ('message', models.TextField(default='')),
97                 ('job', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Job')),
98             ],
99             options={
100                 'abstract': False,
101             },
102         ),
103         migrations.CreateModel(
104             name='TaskConfig',
105             fields=[
106                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
107             ],
108         ),
109         migrations.CreateModel(
110             name='AccessConfig',
111             fields=[
112                 ('taskconfig_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='api.TaskConfig')),
113                 ('access_type', models.CharField(max_length=50)),
114                 ('revoke', models.BooleanField(default=False)),
115                 ('context', models.TextField(default='')),
116                 ('delta', models.TextField()),
117                 ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
118             ],
119             bases=('api.taskconfig',),
120         ),
121         migrations.CreateModel(
122             name='HardwareConfig',
123             fields=[
124                 ('taskconfig_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='api.TaskConfig')),
125                 ('image', models.CharField(default='defimage', max_length=100)),
126                 ('power', models.CharField(default='off', max_length=100)),
127                 ('hostname', models.CharField(default='hostname', max_length=100)),
128                 ('ipmi_create', models.BooleanField(default=False)),
129                 ('delta', models.TextField()),
130             ],
131             bases=('api.taskconfig',),
132         ),
133         migrations.CreateModel(
134             name='NetworkConfig',
135             fields=[
136                 ('taskconfig_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='api.TaskConfig')),
137                 ('delta', models.TextField()),
138                 ('interfaces', models.ManyToManyField(to='resource_inventory.Interface')),
139             ],
140             bases=('api.taskconfig',),
141         ),
142         migrations.CreateModel(
143             name='SoftwareConfig',
144             fields=[
145                 ('taskconfig_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='api.TaskConfig')),
146                 ('opnfv', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.OpnfvApiConfig')),
147             ],
148             bases=('api.taskconfig',),
149         ),
150         migrations.AddField(
151             model_name='hostnetworkrelation',
152             name='job',
153             field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Job'),
154         ),
155         migrations.AddField(
156             model_name='hosthardwarerelation',
157             name='job',
158             field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Job'),
159         ),
160         migrations.AddField(
161             model_name='accessrelation',
162             name='job',
163             field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Job'),
164         ),
165         migrations.AddField(
166             model_name='softwarerelation',
167             name='config',
168             field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='api.SoftwareConfig'),
169         ),
170         migrations.AddField(
171             model_name='hostnetworkrelation',
172             name='config',
173             field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='api.NetworkConfig'),
174         ),
175         migrations.AddField(
176             model_name='hosthardwarerelation',
177             name='config',
178             field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='api.HardwareConfig'),
179         ),
180         migrations.AddField(
181             model_name='accessrelation',
182             name='config',
183             field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='api.AccessConfig'),
184         ),
185     ]