blob: 3146a402f612bdf741d67d1efa55a89e2d33c1d8 [file] [log] [blame]
Matteo Scandolo4a716cc2019-02-07 17:07:27 -08001#!/usr/bin/python
2
3# Copyright 2017-present Open Networking Foundation
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17from __future__ import unicode_literals
18
19import core.models.xosbase_header
20from django.db import migrations, models
21import django.db.models.deletion
22import django.utils.timezone
23
24
25class Migration(migrations.Migration):
26
27 initial = True
28
29 dependencies = [
30 ('core', '0002_initial_data'),
31 ]
32
33 operations = [
34 migrations.CreateModel(
35 name='OLTDevice_decl',
36 fields=[
37 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
38 ('created', models.DateTimeField(auto_now_add=True, help_text=b'Time this model was created')),
39 ('updated', models.DateTimeField(default=django.utils.timezone.now, help_text=b'Time this model was changed by a non-synchronizer')),
40 ('enacted', models.DateTimeField(blank=True, default=None, help_text=b'When synced, set to the timestamp of the data that was synced', null=True)),
41 ('policed', models.DateTimeField(blank=True, default=None, help_text=b'When policed, set to the timestamp of the data that was policed', null=True)),
42 ('backend_register', models.CharField(blank=True, default=b'{}', max_length=1024, null=True)),
43 ('backend_need_delete', models.BooleanField(default=False)),
44 ('backend_need_reap', models.BooleanField(default=False)),
45 ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=1024, null=True)),
46 ('backend_code', models.IntegerField(default=0)),
47 ('deleted', models.BooleanField(default=False)),
48 ('write_protect', models.BooleanField(default=False)),
49 ('lazy_blocked', models.BooleanField(default=False)),
50 ('no_sync', models.BooleanField(default=False)),
51 ('no_policy', models.BooleanField(default=False)),
52 ('policy_status', models.CharField(blank=True, default=b'Policy in process', max_length=1024, null=True)),
53 ('policy_code', models.IntegerField(blank=True, default=0, null=True)),
54 ('leaf_model_name', models.CharField(help_text=b'The most specialized model in this chain of inheritance, often defined by a service developer', max_length=1024)),
55 ('backend_need_delete_policy', models.BooleanField(default=False, help_text=b'True if delete model_policy must be run before object can be reaped')),
56 ('xos_managed', models.BooleanField(default=True, help_text=b'True if xos is responsible for creating/deleting this object')),
57 ('backend_handle', models.CharField(blank=True, help_text=b'Handle used by the backend to track this object', max_length=1024, null=True)),
58 ('changed_by_step', models.DateTimeField(blank=True, default=None, help_text=b'Time this model was changed by a sync step', null=True)),
59 ('changed_by_policy', models.DateTimeField(blank=True, default=None, help_text=b'Time this model was changed by a model policy', null=True)),
60 ('name', models.CharField(blank=True, help_text=b'Human-readable name of device', max_length=254, null=True, unique=True)),
61 ('device_type', models.CharField(default=b'openolt', help_text=b'Phyiscal Device Type', max_length=254)),
62 ('host', models.CharField(blank=True, help_text=b'IP Address of physical OLT Device', max_length=254, null=True)),
63 ('port', models.IntegerField(blank=True, help_text=b'Port Number of physical OLT Device', null=True)),
64 ('mac_address', models.TextField(blank=True, help_text=b'Mac address of physical OLT Device', null=True)),
65 ('serial_number', models.TextField(blank=True, help_text=b'Serial Number', null=True)),
66 ('device_id', models.TextField(blank=True, help_text=b'Voltha Device ID', null=True)),
67 ('admin_state', models.TextField(blank=True, choices=[(b'DISABLED', b'DISABLED'), (b'ENABLED', b'ENABLED')], default=b'ENABLED', help_text=b'admin state, whether OLT should be enabled', null=True)),
68 ('oper_status', models.TextField(blank=True, help_text=b'operational status, whether OLT is active', null=True)),
69 ('of_id', models.TextField(blank=True, help_text=b'Logical device openflow id', null=True)),
70 ('dp_id', models.TextField(blank=True, help_text=b'Logical device datapath id', null=True)),
71 ('uplink', models.TextField(help_text=b'uplink port, exposed via sadis')),
72 ('driver', models.TextField(default=b'voltha', help_text=b'DEPRECATED')),
73 ('switch_datapath_id', models.TextField(blank=True, help_text=b'Fabric switch to which the OLT is connected', null=True)),
74 ('switch_port', models.TextField(blank=True, help_text=b'Fabric port to which the OLT is connected', null=True)),
75 ('outer_tpid', models.TextField(blank=True, help_text=b'Outer VLAN id field EtherType', null=True)),
76 ('nas_id', models.TextField(blank=True, help_text=b'Authentication ID (propagated to the free-radius server via sadis)', null=True)),
77 ],
78 options={
79 'verbose_name': 'OLT Device',
80 },
81 bases=(models.Model, core.models.xosbase_header.PlModelMixIn),
82 ),
83 migrations.CreateModel(
84 name='ONUDevice_decl',
85 fields=[
86 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
87 ('created', models.DateTimeField(auto_now_add=True, help_text=b'Time this model was created')),
88 ('updated', models.DateTimeField(default=django.utils.timezone.now, help_text=b'Time this model was changed by a non-synchronizer')),
89 ('enacted', models.DateTimeField(blank=True, default=None, help_text=b'When synced, set to the timestamp of the data that was synced', null=True)),
90 ('policed', models.DateTimeField(blank=True, default=None, help_text=b'When policed, set to the timestamp of the data that was policed', null=True)),
91 ('backend_register', models.CharField(blank=True, default=b'{}', max_length=1024, null=True)),
92 ('backend_need_delete', models.BooleanField(default=False)),
93 ('backend_need_reap', models.BooleanField(default=False)),
94 ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=1024, null=True)),
95 ('backend_code', models.IntegerField(default=0)),
96 ('deleted', models.BooleanField(default=False)),
97 ('write_protect', models.BooleanField(default=False)),
98 ('lazy_blocked', models.BooleanField(default=False)),
99 ('no_sync', models.BooleanField(default=False)),
100 ('no_policy', models.BooleanField(default=False)),
101 ('policy_status', models.CharField(blank=True, default=b'Policy in process', max_length=1024, null=True)),
102 ('policy_code', models.IntegerField(blank=True, default=0, null=True)),
103 ('leaf_model_name', models.CharField(help_text=b'The most specialized model in this chain of inheritance, often defined by a service developer', max_length=1024)),
104 ('backend_need_delete_policy', models.BooleanField(default=False, help_text=b'True if delete model_policy must be run before object can be reaped')),
105 ('xos_managed', models.BooleanField(default=True, help_text=b'True if xos is responsible for creating/deleting this object')),
106 ('backend_handle', models.CharField(blank=True, help_text=b'Handle used by the backend to track this object', max_length=1024, null=True)),
107 ('changed_by_step', models.DateTimeField(blank=True, default=None, help_text=b'Time this model was changed by a sync step', null=True)),
108 ('changed_by_policy', models.DateTimeField(blank=True, default=None, help_text=b'Time this model was changed by a model policy', null=True)),
109 ('serial_number', models.CharField(help_text=b'Serial number of ONU Device', max_length=254, unique=True)),
110 ('vendor', models.CharField(help_text=b'Vendor of ONU Device', max_length=254)),
111 ('device_type', models.CharField(default=b'asfvolt16_olt', help_text=b'Device Type', max_length=254)),
112 ('device_id', models.CharField(blank=True, help_text=b'Voltha Device ID', max_length=254, null=True)),
113 ('admin_state', models.TextField(blank=True, choices=[(b'DISABLED', b'DISABLED'), (b'ENABLED', b'ENABLED')], default=b'ENABLED', help_text=b'admin state, whether port should be enabled', null=True)),
114 ('oper_status', models.TextField(blank=True, help_text=b'oper_status', null=True)),
115 ('connect_status', models.TextField(blank=True, help_text=b'operational status, whether port is active', null=True)),
116 ('reason', models.TextField(blank=True, help_text=b'ONU device configuration state machine status message', null=True)),
117 ],
118 options={
119 'verbose_name': 'ONU Device',
120 },
121 bases=(models.Model, core.models.xosbase_header.PlModelMixIn),
122 ),
123 migrations.CreateModel(
124 name='PortBase_decl',
125 fields=[
126 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
127 ('created', models.DateTimeField(auto_now_add=True, help_text=b'Time this model was created')),
128 ('updated', models.DateTimeField(default=django.utils.timezone.now, help_text=b'Time this model was changed by a non-synchronizer')),
129 ('enacted', models.DateTimeField(blank=True, default=None, help_text=b'When synced, set to the timestamp of the data that was synced', null=True)),
130 ('policed', models.DateTimeField(blank=True, default=None, help_text=b'When policed, set to the timestamp of the data that was policed', null=True)),
131 ('backend_register', models.CharField(blank=True, default=b'{}', max_length=1024, null=True)),
132 ('backend_need_delete', models.BooleanField(default=False)),
133 ('backend_need_reap', models.BooleanField(default=False)),
134 ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=1024, null=True)),
135 ('backend_code', models.IntegerField(default=0)),
136 ('deleted', models.BooleanField(default=False)),
137 ('write_protect', models.BooleanField(default=False)),
138 ('lazy_blocked', models.BooleanField(default=False)),
139 ('no_sync', models.BooleanField(default=False)),
140 ('no_policy', models.BooleanField(default=False)),
141 ('policy_status', models.CharField(blank=True, default=b'Policy in process', max_length=1024, null=True)),
142 ('policy_code', models.IntegerField(blank=True, default=0, null=True)),
143 ('leaf_model_name', models.CharField(help_text=b'The most specialized model in this chain of inheritance, often defined by a service developer', max_length=1024)),
144 ('backend_need_delete_policy', models.BooleanField(default=False, help_text=b'True if delete model_policy must be run before object can be reaped')),
145 ('xos_managed', models.BooleanField(default=True, help_text=b'True if xos is responsible for creating/deleting this object')),
146 ('backend_handle', models.CharField(blank=True, help_text=b'Handle used by the backend to track this object', max_length=1024, null=True)),
147 ('changed_by_step', models.DateTimeField(blank=True, default=None, help_text=b'Time this model was changed by a sync step', null=True)),
148 ('changed_by_policy', models.DateTimeField(blank=True, default=None, help_text=b'Time this model was changed by a model policy', null=True)),
149 ('name', models.TextField(db_index=True, help_text=b'Human-readable name of port')),
150 ('port_no', models.IntegerField(help_text=b'Port Number')),
151 ('admin_state', models.TextField(blank=True, help_text=b'admin state, whether port should be enabled', null=True)),
152 ('oper_status', models.TextField(blank=True, help_text=b'operational status, whether port is active', null=True)),
153 ],
154 options={
155 'verbose_name': 'PortBase',
156 },
157 bases=(models.Model, core.models.xosbase_header.PlModelMixIn),
158 ),
159 migrations.CreateModel(
160 name='VOLTService_decl',
161 fields=[
162 ('service_decl_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.Service_decl')),
163 ('voltha_url', models.CharField(default=b'voltha.voltha.svc.cluster.local', help_text=b'The Voltha API address. By default voltha.voltha.svc.cluster.local', max_length=254)),
164 ('voltha_port', models.IntegerField(default=8882, help_text=b'The Voltha API port. By default 8882')),
165 ('voltha_user', models.CharField(default=b'voltha', help_text=b'The Voltha username. By default voltha', max_length=254)),
166 ('voltha_pass', models.CharField(default=b'admin', help_text=b'The Voltha password. By default admin', max_length=254)),
167 ('onos_voltha_url', models.CharField(default=b'onos-voltha-ui.voltha.svc.cluster.local', help_text=b'The ONOS Voltha address. By default onos-voltha-ui.voltha.svc.cluster.local', max_length=254)),
168 ('onos_voltha_port', models.IntegerField(default=8181, help_text=b'The Voltha API port. By default 8181')),
169 ('onos_voltha_user', models.CharField(default=b'onos', help_text=b'The ONOS Voltha username. By default sdn', max_length=254)),
170 ('onos_voltha_pass', models.CharField(default=b'rocks', help_text=b'The ONOS Voltha password. By default rocks', max_length=254)),
171 ],
172 options={
173 'verbose_name': 'vOLT Service',
174 },
175 bases=('core.service',),
176 ),
177 migrations.CreateModel(
178 name='VOLTServiceInstance_decl',
179 fields=[
180 ('serviceinstance_decl_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.ServiceInstance_decl')),
181 ('description', models.CharField(blank=True, help_text=b'Human-readable description', max_length=254, null=True)),
182 ('onu_device', models.ForeignKey(blank=True, help_text=b'ONUDevice that belongs to this Subscriber chain', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='volt_service_instances', to='volt.ONUDevice_decl')),
183 ],
184 options={
185 'verbose_name': 'vOLT Service Instance',
186 },
187 bases=('core.serviceinstance',),
188 ),
189 migrations.CreateModel(
190 name='NNIPort_decl',
191 fields=[
192 ('portbase_decl_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='volt.PortBase_decl')),
193 ],
194 options={
195 'verbose_name': 'NNI Port',
196 },
197 bases=('volt.portbase_decl',),
198 ),
199 migrations.CreateModel(
200 name='PONONUPort_decl',
201 fields=[
202 ('portbase_decl_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='volt.PortBase_decl')),
203 ],
204 options={
205 'verbose_name': 'ANI Port',
206 },
207 bases=('volt.portbase_decl',),
208 ),
209 migrations.CreateModel(
210 name='PONPort_decl',
211 fields=[
212 ('portbase_decl_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='volt.PortBase_decl')),
213 ],
214 options={
215 'verbose_name': 'PON Port',
216 },
217 bases=('volt.portbase_decl',),
218 ),
219 migrations.CreateModel(
220 name='UNIPort_decl',
221 fields=[
222 ('portbase_decl_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='volt.PortBase_decl')),
223 ],
224 options={
225 'verbose_name': 'UNI Port',
226 },
227 bases=('volt.portbase_decl',),
228 ),
229 migrations.AddField(
230 model_name='oltdevice_decl',
231 name='volt_service',
232 field=models.ForeignKey(help_text=b'VOLTService that owns this OLT', on_delete=django.db.models.deletion.CASCADE, related_name='volt_devices', to='volt.VOLTService_decl'),
233 ),
234 migrations.CreateModel(
235 name='OLTDevice',
236 fields=[
237 ],
238 options={
239 'proxy': True,
240 'indexes': [],
241 },
242 bases=('volt.oltdevice_decl',),
243 ),
244 migrations.CreateModel(
245 name='ONUDevice',
246 fields=[
247 ],
248 options={
249 'proxy': True,
250 'indexes': [],
251 },
252 bases=('volt.onudevice_decl',),
253 ),
254 migrations.CreateModel(
255 name='PortBase',
256 fields=[
257 ],
258 options={
259 'proxy': True,
260 'indexes': [],
261 },
262 bases=('volt.portbase_decl',),
263 ),
264 migrations.CreateModel(
265 name='VOLTService',
266 fields=[
267 ],
268 options={
269 'proxy': True,
270 'indexes': [],
271 },
272 bases=('volt.voltservice_decl',),
273 ),
274 migrations.CreateModel(
275 name='VOLTServiceInstance',
276 fields=[
277 ],
278 options={
279 'proxy': True,
280 'indexes': [],
281 },
282 bases=('volt.voltserviceinstance_decl',),
283 ),
284 migrations.AddField(
285 model_name='uniport_decl',
286 name='onu_device',
287 field=models.ForeignKey(help_text=b'ONUDevice that owns this UNIPort', on_delete=django.db.models.deletion.CASCADE, related_name='uni_ports', to='volt.ONUDevice_decl'),
288 ),
289 migrations.AddField(
290 model_name='ponport_decl',
291 name='olt_device',
292 field=models.ForeignKey(help_text=b'OLTDevice that owns this PONPort', on_delete=django.db.models.deletion.CASCADE, related_name='pon_ports', to='volt.OLTDevice_decl'),
293 ),
294 migrations.AddField(
295 model_name='pononuport_decl',
296 name='onu_device',
297 field=models.ForeignKey(help_text=b'ONUDevice that owns this PONONUPort', on_delete=django.db.models.deletion.CASCADE, related_name='pononu_ports', to='volt.ONUDevice_decl'),
298 ),
299 migrations.AddField(
300 model_name='onudevice_decl',
301 name='pon_port',
302 field=models.ForeignKey(help_text=b'PONPort that connects this ONUDevice to an OLTDevice', on_delete=django.db.models.deletion.CASCADE, related_name='onu_devices', to='volt.PONPort_decl'),
303 ),
304 migrations.AlterUniqueTogether(
305 name='oltdevice_decl',
306 unique_together=set([('host', 'port')]),
307 ),
308 migrations.AddField(
309 model_name='nniport_decl',
310 name='olt_device',
311 field=models.ForeignKey(help_text=b'OLTDevice that owns this NNIPort', on_delete=django.db.models.deletion.CASCADE, related_name='nni_ports', to='volt.OLTDevice_decl'),
312 ),
313 migrations.CreateModel(
314 name='NNIPort',
315 fields=[
316 ],
317 options={
318 'proxy': True,
319 'indexes': [],
320 },
321 bases=('volt.nniport_decl',),
322 ),
323 migrations.CreateModel(
324 name='PONONUPort',
325 fields=[
326 ],
327 options={
328 'proxy': True,
329 'indexes': [],
330 },
331 bases=('volt.pononuport_decl',),
332 ),
333 migrations.CreateModel(
334 name='PONPort',
335 fields=[
336 ],
337 options={
338 'proxy': True,
339 'indexes': [],
340 },
341 bases=('volt.ponport_decl',),
342 ),
343 migrations.CreateModel(
344 name='UNIPort',
345 fields=[
346 ],
347 options={
348 'proxy': True,
349 'indexes': [],
350 },
351 bases=('volt.uniport_decl',),
352 ),
353 ]