|
|
@@ -0,0 +1,979 @@
|
|
|
+# Generated by Django 4.2.9 on 2024-01-18 18:27
|
|
|
+
|
|
|
+import dcim.fields
|
|
|
+import django.contrib.postgres.fields
|
|
|
+import django.core.validators
|
|
|
+from django.db import migrations, models
|
|
|
+import django.db.models.deletion
|
|
|
+import timezone_field.fields
|
|
|
+import utilities.fields
|
|
|
+import utilities.json
|
|
|
+import utilities.ordering
|
|
|
+import utilities.query_functions
|
|
|
+import utilities.tracking
|
|
|
+import utilities.validators
|
|
|
+
|
|
|
+
|
|
|
+class Migration(migrations.Migration):
|
|
|
+
|
|
|
+ initial = True
|
|
|
+
|
|
|
+ dependencies = [
|
|
|
+ ]
|
|
|
+
|
|
|
+ operations = [
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='Cable',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('comments', models.TextField(blank=True)),
|
|
|
+ ('type', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('status', models.CharField(default='connected', max_length=50)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=100)),
|
|
|
+ ('color', utilities.fields.ColorField(blank=True, max_length=6)),
|
|
|
+ ('length', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True)),
|
|
|
+ ('length_unit', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('_abs_length', models.DecimalField(blank=True, decimal_places=4, max_digits=10, null=True)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'cable',
|
|
|
+ 'verbose_name_plural': 'cables',
|
|
|
+ 'ordering': ('pk',),
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='CablePath',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('path', models.JSONField(default=list)),
|
|
|
+ ('is_active', models.BooleanField(default=False)),
|
|
|
+ ('is_complete', models.BooleanField(default=False)),
|
|
|
+ ('is_split', models.BooleanField(default=False)),
|
|
|
+ ('_nodes', dcim.fields.PathField(base_field=models.CharField(max_length=40), size=None)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'cable path',
|
|
|
+ 'verbose_name_plural': 'cable paths',
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='CableTermination',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('cable_end', models.CharField(max_length=1)),
|
|
|
+ ('termination_id', models.PositiveBigIntegerField()),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'cable termination',
|
|
|
+ 'verbose_name_plural': 'cable terminations',
|
|
|
+ 'ordering': ('cable', 'cable_end', 'pk'),
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='ConsolePort',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('cable_end', models.CharField(blank=True, max_length=1)),
|
|
|
+ ('mark_connected', models.BooleanField(default=False)),
|
|
|
+ ('type', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('speed', models.PositiveIntegerField(blank=True, null=True)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'console port',
|
|
|
+ 'verbose_name_plural': 'console ports',
|
|
|
+ 'ordering': ('device', '_name'),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='ConsolePortTemplate',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('type', models.CharField(blank=True, max_length=50)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'console port template',
|
|
|
+ 'verbose_name_plural': 'console port templates',
|
|
|
+ 'ordering': ('device_type', 'module_type', '_name'),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='ConsoleServerPort',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('cable_end', models.CharField(blank=True, max_length=1)),
|
|
|
+ ('mark_connected', models.BooleanField(default=False)),
|
|
|
+ ('type', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('speed', models.PositiveIntegerField(blank=True, null=True)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'console server port',
|
|
|
+ 'verbose_name_plural': 'console server ports',
|
|
|
+ 'ordering': ('device', '_name'),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='ConsoleServerPortTemplate',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('type', models.CharField(blank=True, max_length=50)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'console server port template',
|
|
|
+ 'verbose_name_plural': 'console server port templates',
|
|
|
+ 'ordering': ('device_type', 'module_type', '_name'),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='Device',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('comments', models.TextField(blank=True)),
|
|
|
+ ('local_context_data', models.JSONField(blank=True, null=True)),
|
|
|
+ ('name', models.CharField(blank=True, max_length=64, null=True)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize, null=True)),
|
|
|
+ ('serial', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('asset_tag', models.CharField(blank=True, max_length=50, null=True, unique=True)),
|
|
|
+ ('position', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100.5)])),
|
|
|
+ ('face', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('status', models.CharField(default='active', max_length=50)),
|
|
|
+ ('airflow', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('vc_position', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MaxValueValidator(255)])),
|
|
|
+ ('vc_priority', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MaxValueValidator(255)])),
|
|
|
+ ('latitude', models.DecimalField(blank=True, decimal_places=6, max_digits=8, null=True)),
|
|
|
+ ('longitude', models.DecimalField(blank=True, decimal_places=6, max_digits=9, null=True)),
|
|
|
+ ('console_port_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.ConsolePort')),
|
|
|
+ ('console_server_port_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.ConsoleServerPort')),
|
|
|
+ ('power_port_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.PowerPort')),
|
|
|
+ ('power_outlet_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.PowerOutlet')),
|
|
|
+ ('interface_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.Interface')),
|
|
|
+ ('front_port_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.FrontPort')),
|
|
|
+ ('rear_port_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.RearPort')),
|
|
|
+ ('device_bay_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.DeviceBay')),
|
|
|
+ ('module_bay_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.ModuleBay')),
|
|
|
+ ('inventory_item_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.InventoryItem')),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'device',
|
|
|
+ 'verbose_name_plural': 'devices',
|
|
|
+ 'ordering': ('_name', 'pk'),
|
|
|
+ },
|
|
|
+ bases=(utilities.tracking.TrackingModelMixin, models.Model),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='DeviceBay',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'device bay',
|
|
|
+ 'verbose_name_plural': 'device bays',
|
|
|
+ 'ordering': ('device', '_name'),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='DeviceBayTemplate',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'device bay template',
|
|
|
+ 'verbose_name_plural': 'device bay templates',
|
|
|
+ 'ordering': ('device_type', '_name'),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='DeviceRole',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('name', models.CharField(max_length=100, unique=True)),
|
|
|
+ ('slug', models.SlugField(max_length=100, unique=True)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('color', utilities.fields.ColorField(default='9e9e9e', max_length=6)),
|
|
|
+ ('vm_role', models.BooleanField(default=True)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'device role',
|
|
|
+ 'verbose_name_plural': 'device roles',
|
|
|
+ 'ordering': ('name',),
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='DeviceType',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('comments', models.TextField(blank=True)),
|
|
|
+ ('weight', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True)),
|
|
|
+ ('weight_unit', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('_abs_weight', models.PositiveBigIntegerField(blank=True, null=True)),
|
|
|
+ ('model', models.CharField(max_length=100)),
|
|
|
+ ('slug', models.SlugField(max_length=100)),
|
|
|
+ ('part_number', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('u_height', models.DecimalField(decimal_places=1, default=1.0, max_digits=4)),
|
|
|
+ ('is_full_depth', models.BooleanField(default=True)),
|
|
|
+ ('subdevice_role', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('airflow', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('front_image', models.ImageField(blank=True, upload_to='devicetype-images')),
|
|
|
+ ('rear_image', models.ImageField(blank=True, upload_to='devicetype-images')),
|
|
|
+ ('console_port_template_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.ConsolePortTemplate')),
|
|
|
+ ('console_server_port_template_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.ConsoleServerPortTemplate')),
|
|
|
+ ('power_port_template_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.PowerPortTemplate')),
|
|
|
+ ('power_outlet_template_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.PowerOutletTemplate')),
|
|
|
+ ('interface_template_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.InterfaceTemplate')),
|
|
|
+ ('front_port_template_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.FrontPortTemplate')),
|
|
|
+ ('rear_port_template_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.RearPortTemplate')),
|
|
|
+ ('device_bay_template_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.DeviceBayTemplate')),
|
|
|
+ ('module_bay_template_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.ModuleBayTemplate')),
|
|
|
+ ('inventory_item_template_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.InventoryItemTemplate')),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'device type',
|
|
|
+ 'verbose_name_plural': 'device types',
|
|
|
+ 'ordering': ['manufacturer', 'model'],
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='FrontPort',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('cable_end', models.CharField(blank=True, max_length=1)),
|
|
|
+ ('mark_connected', models.BooleanField(default=False)),
|
|
|
+ ('type', models.CharField(max_length=50)),
|
|
|
+ ('color', utilities.fields.ColorField(blank=True, max_length=6)),
|
|
|
+ ('rear_port_position', models.PositiveSmallIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1024)])),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'front port',
|
|
|
+ 'verbose_name_plural': 'front ports',
|
|
|
+ 'ordering': ('device', '_name'),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='FrontPortTemplate',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('type', models.CharField(max_length=50)),
|
|
|
+ ('color', utilities.fields.ColorField(blank=True, max_length=6)),
|
|
|
+ ('rear_port_position', models.PositiveSmallIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1024)])),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'front port template',
|
|
|
+ 'verbose_name_plural': 'front port templates',
|
|
|
+ 'ordering': ('device_type', 'module_type', '_name'),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='Interface',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('cable_end', models.CharField(blank=True, max_length=1)),
|
|
|
+ ('mark_connected', models.BooleanField(default=False)),
|
|
|
+ ('enabled', models.BooleanField(default=True)),
|
|
|
+ ('mac_address', dcim.fields.MACAddressField(blank=True, null=True)),
|
|
|
+ ('mtu', models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(65536)])),
|
|
|
+ ('mode', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize_interface)),
|
|
|
+ ('type', models.CharField(max_length=50)),
|
|
|
+ ('mgmt_only', models.BooleanField(default=False)),
|
|
|
+ ('speed', models.PositiveIntegerField(blank=True, null=True)),
|
|
|
+ ('duplex', models.CharField(blank=True, max_length=50, null=True)),
|
|
|
+ ('wwn', dcim.fields.WWNField(blank=True, null=True)),
|
|
|
+ ('rf_role', models.CharField(blank=True, max_length=30)),
|
|
|
+ ('rf_channel', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('rf_channel_frequency', models.DecimalField(blank=True, decimal_places=2, max_digits=7, null=True)),
|
|
|
+ ('rf_channel_width', models.DecimalField(blank=True, decimal_places=3, max_digits=7, null=True)),
|
|
|
+ ('tx_power', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MaxValueValidator(127)])),
|
|
|
+ ('poe_mode', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('poe_type', models.CharField(blank=True, max_length=50)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'interface',
|
|
|
+ 'verbose_name_plural': 'interfaces',
|
|
|
+ 'ordering': ('device', utilities.query_functions.CollateAsChar('_name')),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='InterfaceTemplate',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize_interface)),
|
|
|
+ ('type', models.CharField(max_length=50)),
|
|
|
+ ('enabled', models.BooleanField(default=True)),
|
|
|
+ ('mgmt_only', models.BooleanField(default=False)),
|
|
|
+ ('poe_mode', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('poe_type', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('rf_role', models.CharField(blank=True, max_length=30)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'interface template',
|
|
|
+ 'verbose_name_plural': 'interface templates',
|
|
|
+ 'ordering': ('device_type', 'module_type', '_name'),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='InventoryItem',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('component_id', models.PositiveBigIntegerField(blank=True, null=True)),
|
|
|
+ ('part_id', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('serial', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('asset_tag', models.CharField(blank=True, max_length=50, null=True, unique=True)),
|
|
|
+ ('discovered', models.BooleanField(default=False)),
|
|
|
+ ('lft', models.PositiveIntegerField(editable=False)),
|
|
|
+ ('rght', models.PositiveIntegerField(editable=False)),
|
|
|
+ ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
|
|
|
+ ('level', models.PositiveIntegerField(editable=False)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'inventory item',
|
|
|
+ 'verbose_name_plural': 'inventory items',
|
|
|
+ 'ordering': ('device__id', 'parent__id', '_name'),
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='InventoryItemRole',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('name', models.CharField(max_length=100, unique=True)),
|
|
|
+ ('slug', models.SlugField(max_length=100, unique=True)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('color', utilities.fields.ColorField(default='9e9e9e', max_length=6)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'inventory item role',
|
|
|
+ 'verbose_name_plural': 'inventory item roles',
|
|
|
+ 'ordering': ('name',),
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='InventoryItemTemplate',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('component_id', models.PositiveBigIntegerField(blank=True, null=True)),
|
|
|
+ ('part_id', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('lft', models.PositiveIntegerField(editable=False)),
|
|
|
+ ('rght', models.PositiveIntegerField(editable=False)),
|
|
|
+ ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
|
|
|
+ ('level', models.PositiveIntegerField(editable=False)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'inventory item template',
|
|
|
+ 'verbose_name_plural': 'inventory item templates',
|
|
|
+ 'ordering': ('device_type__id', 'parent__id', '_name'),
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='Location',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('name', models.CharField(max_length=100)),
|
|
|
+ ('slug', models.SlugField(max_length=100)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('status', models.CharField(default='active', max_length=50)),
|
|
|
+ ('lft', models.PositiveIntegerField(editable=False)),
|
|
|
+ ('rght', models.PositiveIntegerField(editable=False)),
|
|
|
+ ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
|
|
|
+ ('level', models.PositiveIntegerField(editable=False)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'location',
|
|
|
+ 'verbose_name_plural': 'locations',
|
|
|
+ 'ordering': ['site', 'name'],
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='Manufacturer',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('name', models.CharField(max_length=100, unique=True)),
|
|
|
+ ('slug', models.SlugField(max_length=100, unique=True)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'manufacturer',
|
|
|
+ 'verbose_name_plural': 'manufacturers',
|
|
|
+ 'ordering': ('name',),
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='Module',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('comments', models.TextField(blank=True)),
|
|
|
+ ('local_context_data', models.JSONField(blank=True, null=True)),
|
|
|
+ ('status', models.CharField(default='active', max_length=50)),
|
|
|
+ ('serial', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('asset_tag', models.CharField(blank=True, max_length=50, null=True, unique=True)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'module',
|
|
|
+ 'verbose_name_plural': 'modules',
|
|
|
+ 'ordering': ('module_bay',),
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='ModuleBay',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('position', models.CharField(blank=True, max_length=30)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'module bay',
|
|
|
+ 'verbose_name_plural': 'module bays',
|
|
|
+ 'ordering': ('device', '_name'),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='ModuleBayTemplate',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('position', models.CharField(blank=True, max_length=30)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'module bay template',
|
|
|
+ 'verbose_name_plural': 'module bay templates',
|
|
|
+ 'ordering': ('device_type', '_name'),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='ModuleType',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('comments', models.TextField(blank=True)),
|
|
|
+ ('weight', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True)),
|
|
|
+ ('weight_unit', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('_abs_weight', models.PositiveBigIntegerField(blank=True, null=True)),
|
|
|
+ ('model', models.CharField(max_length=100)),
|
|
|
+ ('part_number', models.CharField(blank=True, max_length=50)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'module type',
|
|
|
+ 'verbose_name_plural': 'module types',
|
|
|
+ 'ordering': ('manufacturer', 'model'),
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='Platform',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('name', models.CharField(max_length=100, unique=True)),
|
|
|
+ ('slug', models.SlugField(max_length=100, unique=True)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'platform',
|
|
|
+ 'verbose_name_plural': 'platforms',
|
|
|
+ 'ordering': ('name',),
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='PowerFeed',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('comments', models.TextField(blank=True)),
|
|
|
+ ('cable_end', models.CharField(blank=True, max_length=1)),
|
|
|
+ ('mark_connected', models.BooleanField(default=False)),
|
|
|
+ ('name', models.CharField(max_length=100)),
|
|
|
+ ('status', models.CharField(default='active', max_length=50)),
|
|
|
+ ('type', models.CharField(default='primary', max_length=50)),
|
|
|
+ ('supply', models.CharField(default='ac', max_length=50)),
|
|
|
+ ('phase', models.CharField(default='single-phase', max_length=50)),
|
|
|
+ ('voltage', models.SmallIntegerField(validators=[utilities.validators.ExclusionValidator([0])])),
|
|
|
+ ('amperage', models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(1)])),
|
|
|
+ ('max_utilization', models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100)])),
|
|
|
+ ('available_power', models.PositiveIntegerField(default=0, editable=False)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'power feed',
|
|
|
+ 'verbose_name_plural': 'power feeds',
|
|
|
+ 'ordering': ['power_panel', 'name'],
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='PowerOutlet',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('cable_end', models.CharField(blank=True, max_length=1)),
|
|
|
+ ('mark_connected', models.BooleanField(default=False)),
|
|
|
+ ('type', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('feed_leg', models.CharField(blank=True, max_length=50)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'power outlet',
|
|
|
+ 'verbose_name_plural': 'power outlets',
|
|
|
+ 'ordering': ('device', '_name'),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='PowerOutletTemplate',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('type', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('feed_leg', models.CharField(blank=True, max_length=50)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'power outlet template',
|
|
|
+ 'verbose_name_plural': 'power outlet templates',
|
|
|
+ 'ordering': ('device_type', 'module_type', '_name'),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='PowerPanel',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('comments', models.TextField(blank=True)),
|
|
|
+ ('name', models.CharField(max_length=100)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'power panel',
|
|
|
+ 'verbose_name_plural': 'power panels',
|
|
|
+ 'ordering': ['site', 'name'],
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='PowerPort',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('cable_end', models.CharField(blank=True, max_length=1)),
|
|
|
+ ('mark_connected', models.BooleanField(default=False)),
|
|
|
+ ('type', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('maximum_draw', models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)])),
|
|
|
+ ('allocated_draw', models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)])),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'power port',
|
|
|
+ 'verbose_name_plural': 'power ports',
|
|
|
+ 'ordering': ('device', '_name'),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='PowerPortTemplate',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('type', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('maximum_draw', models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)])),
|
|
|
+ ('allocated_draw', models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)])),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'power port template',
|
|
|
+ 'verbose_name_plural': 'power port templates',
|
|
|
+ 'ordering': ('device_type', 'module_type', '_name'),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='Rack',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('comments', models.TextField(blank=True)),
|
|
|
+ ('weight', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True)),
|
|
|
+ ('weight_unit', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('_abs_weight', models.PositiveBigIntegerField(blank=True, null=True)),
|
|
|
+ ('name', models.CharField(max_length=100)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('facility_id', models.CharField(blank=True, max_length=50, null=True)),
|
|
|
+ ('status', models.CharField(default='active', max_length=50)),
|
|
|
+ ('serial', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('asset_tag', models.CharField(blank=True, max_length=50, null=True, unique=True)),
|
|
|
+ ('type', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('width', models.PositiveSmallIntegerField(default=19)),
|
|
|
+ ('u_height', models.PositiveSmallIntegerField(default=42, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100)])),
|
|
|
+ ('starting_unit', models.PositiveSmallIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1)])),
|
|
|
+ ('desc_units', models.BooleanField(default=False)),
|
|
|
+ ('outer_width', models.PositiveSmallIntegerField(blank=True, null=True)),
|
|
|
+ ('outer_depth', models.PositiveSmallIntegerField(blank=True, null=True)),
|
|
|
+ ('outer_unit', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('max_weight', models.PositiveIntegerField(blank=True, null=True)),
|
|
|
+ ('_abs_max_weight', models.PositiveBigIntegerField(blank=True, null=True)),
|
|
|
+ ('mounting_depth', models.PositiveSmallIntegerField(blank=True, null=True)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'rack',
|
|
|
+ 'verbose_name_plural': 'racks',
|
|
|
+ 'ordering': ('site', 'location', '_name', 'pk'),
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='RackReservation',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('comments', models.TextField(blank=True)),
|
|
|
+ ('units', django.contrib.postgres.fields.ArrayField(base_field=models.PositiveSmallIntegerField(), size=None)),
|
|
|
+ ('description', models.CharField(max_length=200)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'rack reservation',
|
|
|
+ 'verbose_name_plural': 'rack reservations',
|
|
|
+ 'ordering': ['created', 'pk'],
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='RackRole',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('name', models.CharField(max_length=100, unique=True)),
|
|
|
+ ('slug', models.SlugField(max_length=100, unique=True)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('color', utilities.fields.ColorField(default='9e9e9e', max_length=6)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'rack role',
|
|
|
+ 'verbose_name_plural': 'rack roles',
|
|
|
+ 'ordering': ('name',),
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='RearPort',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('cable_end', models.CharField(blank=True, max_length=1)),
|
|
|
+ ('mark_connected', models.BooleanField(default=False)),
|
|
|
+ ('type', models.CharField(max_length=50)),
|
|
|
+ ('color', utilities.fields.ColorField(blank=True, max_length=6)),
|
|
|
+ ('positions', models.PositiveSmallIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1024)])),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'rear port',
|
|
|
+ 'verbose_name_plural': 'rear ports',
|
|
|
+ 'ordering': ('device', '_name'),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='RearPortTemplate',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('label', models.CharField(blank=True, max_length=64)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('type', models.CharField(max_length=50)),
|
|
|
+ ('color', utilities.fields.ColorField(blank=True, max_length=6)),
|
|
|
+ ('positions', models.PositiveSmallIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1024)])),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'rear port template',
|
|
|
+ 'verbose_name_plural': 'rear port templates',
|
|
|
+ 'ordering': ('device_type', 'module_type', '_name'),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ bases=(models.Model, utilities.tracking.TrackingModelMixin),
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='Region',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('name', models.CharField(max_length=100)),
|
|
|
+ ('slug', models.SlugField(max_length=100)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('lft', models.PositiveIntegerField(editable=False)),
|
|
|
+ ('rght', models.PositiveIntegerField(editable=False)),
|
|
|
+ ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
|
|
|
+ ('level', models.PositiveIntegerField(editable=False)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'region',
|
|
|
+ 'verbose_name_plural': 'regions',
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='Site',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('comments', models.TextField(blank=True)),
|
|
|
+ ('name', models.CharField(max_length=100, unique=True)),
|
|
|
+ ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
|
|
+ ('slug', models.SlugField(max_length=100, unique=True)),
|
|
|
+ ('status', models.CharField(default='active', max_length=50)),
|
|
|
+ ('facility', models.CharField(blank=True, max_length=50)),
|
|
|
+ ('time_zone', timezone_field.fields.TimeZoneField(blank=True)),
|
|
|
+ ('physical_address', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('shipping_address', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('latitude', models.DecimalField(blank=True, decimal_places=6, max_digits=8, null=True)),
|
|
|
+ ('longitude', models.DecimalField(blank=True, decimal_places=6, max_digits=9, null=True)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'site',
|
|
|
+ 'verbose_name_plural': 'sites',
|
|
|
+ 'ordering': ('_name',),
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='SiteGroup',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('name', models.CharField(max_length=100)),
|
|
|
+ ('slug', models.SlugField(max_length=100)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('lft', models.PositiveIntegerField(editable=False)),
|
|
|
+ ('rght', models.PositiveIntegerField(editable=False)),
|
|
|
+ ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
|
|
|
+ ('level', models.PositiveIntegerField(editable=False)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'site group',
|
|
|
+ 'verbose_name_plural': 'site groups',
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='VirtualChassis',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('comments', models.TextField(blank=True)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('domain', models.CharField(blank=True, max_length=30)),
|
|
|
+ ('member_count', utilities.fields.CounterCacheField(default=0, editable=False, to_field='virtual_chassis', to_model='dcim.Device')),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'virtual chassis',
|
|
|
+ 'verbose_name_plural': 'virtual chassis',
|
|
|
+ 'ordering': ['name'],
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='VirtualDeviceContext',
|
|
|
+ fields=[
|
|
|
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
|
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
|
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
|
+ ('description', models.CharField(blank=True, max_length=200)),
|
|
|
+ ('name', models.CharField(max_length=64)),
|
|
|
+ ('status', models.CharField(max_length=50)),
|
|
|
+ ('identifier', models.PositiveSmallIntegerField(blank=True, null=True)),
|
|
|
+ ('comments', models.TextField(blank=True)),
|
|
|
+ ('device', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='vdcs', to='dcim.device')),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'virtual device context',
|
|
|
+ 'verbose_name_plural': 'virtual device contexts',
|
|
|
+ 'ordering': ['name'],
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ]
|