Matteo Scandolo | d53c223 | 2019-02-07 17:06:40 -0800 | [diff] [blame] | 1 | #!/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 | |
| 17 | from __future__ import unicode_literals |
| 18 | |
| 19 | import core.models.xosbase_header |
| 20 | from django.db import migrations, models |
| 21 | import django.db.models.deletion |
| 22 | import django.utils.timezone |
| 23 | |
| 24 | |
| 25 | class Migration(migrations.Migration): |
| 26 | |
| 27 | initial = True |
| 28 | |
| 29 | dependencies = [ |
| 30 | ('core', '0002_initial_data'), |
| 31 | ] |
| 32 | |
| 33 | operations = [ |
| 34 | migrations.CreateModel( |
| 35 | name='FabricIpAddress', |
| 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 | ('ip', models.CharField(help_text=b'The unique IP address (either IPv4 or IPv6 / netmask)', max_length=52)), |
| 61 | ('description', models.CharField(blank=True, help_text=b'A short description of the IP address', max_length=254, null=True)), |
| 62 | ], |
| 63 | options={ |
| 64 | 'verbose_name': 'IP address', |
| 65 | }, |
| 66 | bases=(models.Model, core.models.xosbase_header.PlModelMixIn), |
| 67 | ), |
| 68 | migrations.CreateModel( |
| 69 | name='FabricService', |
| 70 | fields=[ |
| 71 | ('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')), |
| 72 | ('autoconfig', models.BooleanField(default=True, help_text=b'Automatically apply addresses from AddressManager service to Fabric')), |
| 73 | ], |
| 74 | options={ |
| 75 | 'verbose_name': 'Fabric Service', |
| 76 | }, |
| 77 | bases=('core.service',), |
| 78 | ), |
| 79 | migrations.CreateModel( |
| 80 | name='NodeToSwitchPort', |
| 81 | fields=[ |
| 82 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 83 | ('created', models.DateTimeField(auto_now_add=True, help_text=b'Time this model was created')), |
| 84 | ('updated', models.DateTimeField(default=django.utils.timezone.now, help_text=b'Time this model was changed by a non-synchronizer')), |
| 85 | ('enacted', models.DateTimeField(blank=True, default=None, help_text=b'When synced, set to the timestamp of the data that was synced', null=True)), |
| 86 | ('policed', models.DateTimeField(blank=True, default=None, help_text=b'When policed, set to the timestamp of the data that was policed', null=True)), |
| 87 | ('backend_register', models.CharField(blank=True, default=b'{}', max_length=1024, null=True)), |
| 88 | ('backend_need_delete', models.BooleanField(default=False)), |
| 89 | ('backend_need_reap', models.BooleanField(default=False)), |
| 90 | ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=1024, null=True)), |
| 91 | ('backend_code', models.IntegerField(default=0)), |
| 92 | ('deleted', models.BooleanField(default=False)), |
| 93 | ('write_protect', models.BooleanField(default=False)), |
| 94 | ('lazy_blocked', models.BooleanField(default=False)), |
| 95 | ('no_sync', models.BooleanField(default=False)), |
| 96 | ('no_policy', models.BooleanField(default=False)), |
| 97 | ('policy_status', models.CharField(blank=True, default=b'Policy in process', max_length=1024, null=True)), |
| 98 | ('policy_code', models.IntegerField(blank=True, default=0, null=True)), |
| 99 | ('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)), |
| 100 | ('backend_need_delete_policy', models.BooleanField(default=False, help_text=b'True if delete model_policy must be run before object can be reaped')), |
| 101 | ('xos_managed', models.BooleanField(default=True, help_text=b'True if xos is responsible for creating/deleting this object')), |
| 102 | ('backend_handle', models.CharField(blank=True, help_text=b'Handle used by the backend to track this object', max_length=1024, null=True)), |
| 103 | ('changed_by_step', models.DateTimeField(blank=True, default=None, help_text=b'Time this model was changed by a sync step', null=True)), |
| 104 | ('changed_by_policy', models.DateTimeField(blank=True, default=None, help_text=b'Time this model was changed by a model policy', null=True)), |
| 105 | ('node', models.ForeignKey(help_text=b'The ComputeNode this port is connected to', on_delete=django.db.models.deletion.CASCADE, related_name='node_to_switch_ports', to='core.Node')), |
| 106 | ], |
| 107 | options={ |
| 108 | 'verbose_name': 'Node to switch port', |
| 109 | }, |
| 110 | bases=(models.Model, core.models.xosbase_header.PlModelMixIn), |
| 111 | ), |
| 112 | migrations.CreateModel( |
| 113 | name='PortInterface', |
| 114 | fields=[ |
| 115 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 116 | ('created', models.DateTimeField(auto_now_add=True, help_text=b'Time this model was created')), |
| 117 | ('updated', models.DateTimeField(default=django.utils.timezone.now, help_text=b'Time this model was changed by a non-synchronizer')), |
| 118 | ('enacted', models.DateTimeField(blank=True, default=None, help_text=b'When synced, set to the timestamp of the data that was synced', null=True)), |
| 119 | ('policed', models.DateTimeField(blank=True, default=None, help_text=b'When policed, set to the timestamp of the data that was policed', null=True)), |
| 120 | ('backend_register', models.CharField(blank=True, default=b'{}', max_length=1024, null=True)), |
| 121 | ('backend_need_delete', models.BooleanField(default=False)), |
| 122 | ('backend_need_reap', models.BooleanField(default=False)), |
| 123 | ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=1024, null=True)), |
| 124 | ('backend_code', models.IntegerField(default=0)), |
| 125 | ('deleted', models.BooleanField(default=False)), |
| 126 | ('write_protect', models.BooleanField(default=False)), |
| 127 | ('lazy_blocked', models.BooleanField(default=False)), |
| 128 | ('no_sync', models.BooleanField(default=False)), |
| 129 | ('no_policy', models.BooleanField(default=False)), |
| 130 | ('policy_status', models.CharField(blank=True, default=b'Policy in process', max_length=1024, null=True)), |
| 131 | ('policy_code', models.IntegerField(blank=True, default=0, null=True)), |
| 132 | ('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)), |
| 133 | ('backend_need_delete_policy', models.BooleanField(default=False, help_text=b'True if delete model_policy must be run before object can be reaped')), |
| 134 | ('xos_managed', models.BooleanField(default=True, help_text=b'True if xos is responsible for creating/deleting this object')), |
| 135 | ('backend_handle', models.CharField(blank=True, help_text=b'Handle used by the backend to track this object', max_length=1024, null=True)), |
| 136 | ('changed_by_step', models.DateTimeField(blank=True, default=None, help_text=b'Time this model was changed by a sync step', null=True)), |
| 137 | ('changed_by_policy', models.DateTimeField(blank=True, default=None, help_text=b'Time this model was changed by a model policy', null=True)), |
| 138 | ('name', models.CharField(help_text=b'The unique name of the fabric switch port', max_length=254)), |
| 139 | ('vlanUntagged', models.IntegerField(blank=True, help_text=b'The optional untagged VLAN ID for the interface', null=True)), |
| 140 | ], |
| 141 | options={ |
| 142 | 'verbose_name': 'Fabric Port Interface', |
| 143 | }, |
| 144 | bases=(models.Model, core.models.xosbase_header.PlModelMixIn), |
| 145 | ), |
| 146 | migrations.CreateModel( |
| 147 | name='Switch', |
| 148 | fields=[ |
| 149 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 150 | ('created', models.DateTimeField(auto_now_add=True, help_text=b'Time this model was created')), |
| 151 | ('updated', models.DateTimeField(default=django.utils.timezone.now, help_text=b'Time this model was changed by a non-synchronizer')), |
| 152 | ('enacted', models.DateTimeField(blank=True, default=None, help_text=b'When synced, set to the timestamp of the data that was synced', null=True)), |
| 153 | ('policed', models.DateTimeField(blank=True, default=None, help_text=b'When policed, set to the timestamp of the data that was policed', null=True)), |
| 154 | ('backend_register', models.CharField(blank=True, default=b'{}', max_length=1024, null=True)), |
| 155 | ('backend_need_delete', models.BooleanField(default=False)), |
| 156 | ('backend_need_reap', models.BooleanField(default=False)), |
| 157 | ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=1024, null=True)), |
| 158 | ('backend_code', models.IntegerField(default=0)), |
| 159 | ('deleted', models.BooleanField(default=False)), |
| 160 | ('write_protect', models.BooleanField(default=False)), |
| 161 | ('lazy_blocked', models.BooleanField(default=False)), |
| 162 | ('no_sync', models.BooleanField(default=False)), |
| 163 | ('no_policy', models.BooleanField(default=False)), |
| 164 | ('policy_status', models.CharField(blank=True, default=b'Policy in process', max_length=1024, null=True)), |
| 165 | ('policy_code', models.IntegerField(blank=True, default=0, null=True)), |
| 166 | ('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)), |
| 167 | ('backend_need_delete_policy', models.BooleanField(default=False, help_text=b'True if delete model_policy must be run before object can be reaped')), |
| 168 | ('xos_managed', models.BooleanField(default=True, help_text=b'True if xos is responsible for creating/deleting this object')), |
| 169 | ('backend_handle', models.CharField(blank=True, help_text=b'Handle used by the backend to track this object', max_length=1024, null=True)), |
| 170 | ('changed_by_step', models.DateTimeField(blank=True, default=None, help_text=b'Time this model was changed by a sync step', null=True)), |
| 171 | ('changed_by_policy', models.DateTimeField(blank=True, default=None, help_text=b'Time this model was changed by a model policy', null=True)), |
| 172 | ('ofId', models.CharField(help_text=b'The unique OpenFlow ID of the fabric switch', max_length=19)), |
| 173 | ('name', models.CharField(help_text=b'The unique name of the fabric switch', max_length=254)), |
| 174 | ('driver', models.CharField(default=b'ofdpa3', help_text=b'The driver used by the SDN controller', max_length=254)), |
| 175 | ('ipv4NodeSid', models.IntegerField(help_text=b'The MPLS label used by the switch [17 - 1048576]')), |
| 176 | ('ipv4Loopback', models.CharField(help_text=b'Fabric loopback interface', max_length=17)), |
| 177 | ('routerMac', models.CharField(help_text=b'MAC address of the fabric switch used for all interfaces', max_length=17)), |
| 178 | ('isEdgeRouter', models.BooleanField(default=True, help_text=b'True if the fabric switch is a leaf, False if it is a spine')), |
| 179 | ], |
| 180 | options={ |
| 181 | 'verbose_name': 'Fabric Switch', |
| 182 | }, |
| 183 | bases=(models.Model, core.models.xosbase_header.PlModelMixIn), |
| 184 | ), |
| 185 | migrations.CreateModel( |
| 186 | name='SwitchPort', |
| 187 | fields=[ |
| 188 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 189 | ('created', models.DateTimeField(auto_now_add=True, help_text=b'Time this model was created')), |
| 190 | ('updated', models.DateTimeField(default=django.utils.timezone.now, help_text=b'Time this model was changed by a non-synchronizer')), |
| 191 | ('enacted', models.DateTimeField(blank=True, default=None, help_text=b'When synced, set to the timestamp of the data that was synced', null=True)), |
| 192 | ('policed', models.DateTimeField(blank=True, default=None, help_text=b'When policed, set to the timestamp of the data that was policed', null=True)), |
| 193 | ('backend_register', models.CharField(blank=True, default=b'{}', max_length=1024, null=True)), |
| 194 | ('backend_need_delete', models.BooleanField(default=False)), |
| 195 | ('backend_need_reap', models.BooleanField(default=False)), |
| 196 | ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=1024, null=True)), |
| 197 | ('backend_code', models.IntegerField(default=0)), |
| 198 | ('deleted', models.BooleanField(default=False)), |
| 199 | ('write_protect', models.BooleanField(default=False)), |
| 200 | ('lazy_blocked', models.BooleanField(default=False)), |
| 201 | ('no_sync', models.BooleanField(default=False)), |
| 202 | ('no_policy', models.BooleanField(default=False)), |
| 203 | ('policy_status', models.CharField(blank=True, default=b'Policy in process', max_length=1024, null=True)), |
| 204 | ('policy_code', models.IntegerField(blank=True, default=0, null=True)), |
| 205 | ('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)), |
| 206 | ('backend_need_delete_policy', models.BooleanField(default=False, help_text=b'True if delete model_policy must be run before object can be reaped')), |
| 207 | ('xos_managed', models.BooleanField(default=True, help_text=b'True if xos is responsible for creating/deleting this object')), |
| 208 | ('backend_handle', models.CharField(blank=True, help_text=b'Handle used by the backend to track this object', max_length=1024, null=True)), |
| 209 | ('changed_by_step', models.DateTimeField(blank=True, default=None, help_text=b'Time this model was changed by a sync step', null=True)), |
| 210 | ('changed_by_policy', models.DateTimeField(blank=True, default=None, help_text=b'Time this model was changed by a model policy', null=True)), |
| 211 | ('portId', models.IntegerField(help_text=b'The unique port OpenFlow port ID')), |
| 212 | ('host_learning', models.BooleanField(default=True, help_text=b'whether or not to enable autodiscovery')), |
| 213 | ('switch', models.ForeignKey(help_text=b'The fabric switch the port belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='ports', to='fabric.Switch')), |
| 214 | ], |
| 215 | options={ |
| 216 | 'verbose_name': 'Fabric Switch Port', |
| 217 | }, |
| 218 | bases=(models.Model, core.models.xosbase_header.PlModelMixIn), |
| 219 | ), |
| 220 | migrations.AddField( |
| 221 | model_name='portinterface', |
| 222 | name='port', |
| 223 | field=models.ForeignKey(help_text=b'The fabric switch port the interface belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='interfaces', to='fabric.SwitchPort'), |
| 224 | ), |
| 225 | migrations.AddField( |
| 226 | model_name='nodetoswitchport', |
| 227 | name='port', |
| 228 | field=models.ForeignKey(help_text=b'The fabric switch port the node is connected to', on_delete=django.db.models.deletion.CASCADE, related_name='node_to_switch_ports', to='fabric.SwitchPort'), |
| 229 | ), |
| 230 | migrations.AddField( |
| 231 | model_name='fabricipaddress', |
| 232 | name='interface', |
| 233 | field=models.ForeignKey(help_text=b'The port interface the IP address belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='ips', to='fabric.PortInterface'), |
| 234 | ), |
| 235 | migrations.AlterUniqueTogether( |
| 236 | name='fabricipaddress', |
| 237 | unique_together=set([('interface', 'ip')]), |
| 238 | ), |
| 239 | ] |