# Generated by Django 5.0.9 on 2024-11-20 15:48

import django.core.validators
import django.db.models.deletion
import taggit.managers
import utilities.json
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('dcim', '0191_module_bay_rebuild'),
        ('extras', '0121_customfield_related_object_filter'),
        ('ipam', '0070_vlangroup_vlan_id_ranges'),
        ('tenancy', '0015_contactassignment_rename_content_type'),
    ]

    operations = [
        migrations.CreateModel(
            name='ApplicationProfile',
            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)),
                ('slug', models.SlugField(max_length=100, null=True, unique=True)),
                ('description', models.CharField(blank=True, max_length=100)),
                ('comments', models.TextField(blank=True)),
                ('name', models.CharField(max_length=100, unique=True, validators=[django.core.validators.RegexValidator('^[a-zA-Z0-9-_]+$', 'Only alphanumeric, hyphens, and underscores are allowed.')])),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
                ('tenant', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='tenancy.tenant')),
            ],
            options={
                'verbose_name': 'Application Profile',
                'verbose_name_plural': 'Application Profiles',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='BridgeDomain',
            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)),
                ('slug', models.SlugField(max_length=100, null=True, unique=True)),
                ('description', models.CharField(blank=True, max_length=100)),
                ('comments', models.TextField(blank=True)),
                ('name', models.CharField(max_length=100, unique=True, validators=[django.core.validators.RegexValidator('^[a-zA-Z0-9-_]+$', 'Only alphanumeric, hyphens, and underscores are allowed.')])),
                ('l2_unknown_unicast', models.CharField(blank=True, default='hardware_proxy')),
                ('arp_flooding', models.BooleanField(default=True)),
                ('unicast_routing', models.BooleanField(default=False)),
                ('subnets', models.ManyToManyField(blank=True, related_name='bd_subnet', to='ipam.ipaddress')),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
                ('vrf', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='ipam.vrf')),
            ],
            options={
                'verbose_name': 'Bridge Domain',
                'verbose_name_plural': 'Bridge Domains',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Contract',
            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)),
                ('slug', models.SlugField(max_length=100, null=True, unique=True)),
                ('description', models.CharField(blank=True, max_length=100)),
                ('comments', models.TextField(blank=True)),
                ('name', models.CharField(max_length=100, unique=True, validators=[django.core.validators.RegexValidator('^[a-zA-Z0-9-_]+$', 'Only alphanumeric, hyphens, and underscores are allowed.')])),
                ('scope', models.CharField(blank=True)),
                ('qos_class', models.CharField(blank=True)),
                ('target_dscp', models.CharField(blank=True)),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
                ('vrfs_consume', models.ManyToManyField(blank=True, related_name='vrf_contract_consume', to='ipam.vrf')),
                ('vrfs_provide', models.ManyToManyField(blank=True, related_name='vrf_contract_provide', to='ipam.vrf')),
            ],
            options={
                'verbose_name': 'Contract',
                'verbose_name_plural': 'Contracts',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='ContractFilter',
            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)),
                ('slug', models.SlugField(max_length=100, null=True, unique=True)),
                ('description', models.CharField(blank=True, max_length=100)),
                ('comments', models.TextField(blank=True)),
                ('name', models.CharField(max_length=50, unique=True, validators=[django.core.validators.RegexValidator('^[a-zA-Z0-9-_]+$', 'Only alphanumeric, hyphens, and underscores are allowed.')])),
                ('directives', models.CharField(blank=True)),
                ('action', models.CharField(blank=True)),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
            ],
            options={
                'verbose_name': 'Contract Filter',
                'verbose_name_plural': 'Contract Filters',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='ContractFilterEntry',
            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)),
                ('slug', models.SlugField(max_length=100, null=True, unique=True)),
                ('description', models.CharField(blank=True, max_length=100)),
                ('comments', models.TextField(blank=True)),
                ('name', models.CharField(max_length=50, unique=True, validators=[django.core.validators.RegexValidator('^[a-zA-Z0-9-_]+$', 'Only alphanumeric, hyphens, and underscores are allowed.')])),
                ('ether_type', models.CharField(blank=True)),
                ('ip_protocol', models.CharField(blank=True)),
                ('arp_flag', models.CharField(blank=True)),
                ('sport_from', models.CharField(blank=True, max_length=5, null=True, validators=[django.core.validators.RegexValidator('^(1|6[0-5][0-5][0-3][0-5]|[1-5][0-9][0-9][0-9][0-9]|[1-9][0-9]{0,3})$', 'Port must be in the form 1-65535')])),
                ('sport_to', models.CharField(blank=True, max_length=5, null=True, validators=[django.core.validators.RegexValidator('^(1|6[0-5][0-5][0-3][0-5]|[1-5][0-9][0-9][0-9][0-9]|[1-9][0-9]{0,3})$', 'Port must be in the form 1-65535')])),
                ('dport_from', models.CharField(blank=True, max_length=5, null=True, validators=[django.core.validators.RegexValidator('^(1|6[0-5][0-5][0-3][0-5]|[1-5][0-9][0-9][0-9][0-9]|[1-9][0-9]{0,3})$', 'Port must be in the form 1-65535')])),
                ('dport_to', models.CharField(blank=True, max_length=5, null=True, validators=[django.core.validators.RegexValidator('^(1|6[0-5][0-5][0-3][0-5]|[1-5][0-9][0-9][0-9][0-9]|[1-9][0-9]{0,3})$', 'Port must be in the form 1-65535')])),
                ('contractfilter', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='entry_filter', to='netbox_aci.contractfilter')),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
            ],
            options={
                'verbose_name': 'Contract Filter Entry',
                'verbose_name_plural': 'Contract Filter Entries',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='ContractSubject',
            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)),
                ('slug', models.SlugField(max_length=100, null=True, unique=True)),
                ('description', models.CharField(blank=True, max_length=100)),
                ('comments', models.TextField(blank=True)),
                ('name', models.CharField(max_length=50, unique=True, validators=[django.core.validators.RegexValidator('^[a-zA-Z0-9-_]+$', 'Only alphanumeric, hyphens, and underscores are allowed.')])),
                ('target_dscp', models.CharField(blank=True)),
                ('qos_priority', models.CharField(blank=True)),
                ('apply_both_directions', models.BooleanField(default=True)),
                ('reverse_filter_ports', models.BooleanField(default=True)),
                ('contract', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='subject_contract', to='netbox_aci.contract')),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
            ],
            options={
                'verbose_name': 'Contract Subject',
                'verbose_name_plural': 'Contract Subjects',
                'ordering': ['name'],
            },
        ),
        migrations.AddField(
            model_name='contractfilter',
            name='contractsubject',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='filter_subject', to='netbox_aci.contractsubject'),
        ),
        migrations.CreateModel(
            name='Domain',
            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)),
                ('slug', models.SlugField(max_length=100, null=True, unique=True)),
                ('description', models.CharField(blank=True, max_length=100)),
                ('comments', models.TextField(blank=True)),
                ('name', models.CharField(max_length=100, unique=True, validators=[django.core.validators.RegexValidator('^[a-zA-Z0-9-_]+$', 'Only alphanumeric, hyphens, and underscores are allowed.')])),
                ('domain_type', models.CharField(blank=True)),
                ('pool_allocation_mode', models.CharField(blank=True)),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
                ('vlan_pool', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='ipam.vlangroup')),
            ],
            options={
                'verbose_name': 'Domain',
                'verbose_name_plural': 'Domains',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='AAEP',
            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)),
                ('slug', models.SlugField(max_length=100, null=True, unique=True)),
                ('description', models.CharField(blank=True, max_length=100)),
                ('comments', models.TextField(blank=True)),
                ('name', models.CharField(max_length=100, unique=True, validators=[django.core.validators.RegexValidator('^[a-zA-Z0-9-_]+$', 'Only alphanumeric, hyphens, and underscores are allowed.')])),
                ('infrastructure_vlan', models.BooleanField(default=False)),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
                ('domains', models.ManyToManyField(blank=True, related_name='aaep_domain', to='netbox_aci.domain')),
            ],
            options={
                'verbose_name': 'AAEP',
                'verbose_name_plural': 'AAEPs',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='EndPointGroup',
            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)),
                ('slug', models.SlugField(max_length=100, null=True, unique=True)),
                ('description', models.CharField(blank=True, max_length=100)),
                ('comments', models.TextField(blank=True)),
                ('name', models.CharField(max_length=100, unique=True, validators=[django.core.validators.RegexValidator('^[a-zA-Z0-9-_]+$', 'Only alphanumeric, hyphens, and underscores are allowed.')])),
                ('applicationprofile', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='netbox_aci.applicationprofile')),
                ('bridgedomain', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='netbox_aci.bridgedomain')),
                ('contracts_consume', models.ManyToManyField(blank=True, related_name='epg_contract_consume', to='netbox_aci.contract')),
                ('contracts_provide', models.ManyToManyField(blank=True, related_name='epg_contract_provide', to='netbox_aci.contract')),
                ('domains', models.ManyToManyField(blank=True, related_name='epg_domain', to='netbox_aci.domain')),
                ('subnets', models.ManyToManyField(blank=True, related_name='epg_subnet', to='ipam.ipaddress')),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
            ],
            options={
                'verbose_name': 'End Point Group',
                'verbose_name_plural': 'End Point Groups',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='EndPointSecurityGroup',
            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)),
                ('slug', models.SlugField(max_length=100, null=True, unique=True)),
                ('description', models.CharField(blank=True, max_length=100)),
                ('comments', models.TextField(blank=True)),
                ('name', models.CharField(max_length=100, unique=True, validators=[django.core.validators.RegexValidator('^[a-zA-Z0-9-_]+$', 'Only alphanumeric, hyphens, and underscores are allowed.')])),
                ('applicationprofile', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='netbox_aci.applicationprofile')),
                ('contracts_consume', models.ManyToManyField(blank=True, related_name='esg_contract_consume', to='netbox_aci.contract')),
                ('contracts_provide', models.ManyToManyField(blank=True, related_name='esg_contract_provide', to='netbox_aci.contract')),
                ('epgs_selector', models.ManyToManyField(blank=True, related_name='esg_epg_selector', to='netbox_aci.endpointgroup')),
                ('ip_subnets_selector', models.ManyToManyField(blank=True, related_name='esg_ip_subnet_selector', to='ipam.prefix')),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
                ('tags_selector', models.ManyToManyField(blank=True, related_name='esg_tag_selector', to='extras.tag')),
                ('vrf', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='ipam.vrf')),
            ],
            options={
                'verbose_name': 'End Point Security Group',
                'verbose_name_plural': 'End Point Security Groups',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='L3Out',
            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)),
                ('slug', models.SlugField(max_length=100, null=True, unique=True)),
                ('description', models.CharField(blank=True, max_length=100)),
                ('comments', models.TextField(blank=True)),
                ('name', models.CharField(max_length=100, unique=True, validators=[django.core.validators.RegexValidator('^[a-zA-Z0-9-_]+$', 'Only alphanumeric, hyphens, and underscores are allowed.')])),
                ('domains', models.ManyToManyField(blank=True, related_name='l3out_domain', to='netbox_aci.domain')),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
                ('vrf', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='ipam.vrf')),
            ],
            options={
                'verbose_name': 'L3 Out',
                'verbose_name_plural': 'L3 Outs',
                'ordering': ['name'],
            },
        ),
        migrations.AddField(
            model_name='bridgedomain',
            name='l3outs',
            field=models.ManyToManyField(blank=True, related_name='bd_l3out', to='netbox_aci.l3out'),
        ),
        migrations.CreateModel(
            name='LinkLevel',
            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)),
                ('slug', models.SlugField(max_length=100, null=True, unique=True)),
                ('description', models.CharField(blank=True, max_length=100)),
                ('comments', models.TextField(blank=True)),
                ('name', models.CharField(max_length=100, unique=True, validators=[django.core.validators.RegexValidator('^[a-zA-Z0-9-_]+$', 'Only alphanumeric, hyphens, and underscores are allowed.')])),
                ('negotiation', models.CharField(blank=True)),
                ('speed', models.CharField(blank=True)),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
            ],
            options={
                'verbose_name': 'Link Level Policy',
                'verbose_name_plural': 'Link Level Policies',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='PolicyGroup',
            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)),
                ('slug', models.SlugField(max_length=100, null=True, unique=True)),
                ('description', models.CharField(blank=True, max_length=100)),
                ('comments', models.TextField(blank=True)),
                ('name', models.CharField(max_length=100, unique=True, validators=[django.core.validators.RegexValidator('^[a-zA-Z0-9-_]+$', 'Only alphanumeric, hyphens, and underscores are allowed.')])),
                ('aaep', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='ipg_aaep', to='netbox_aci.aaep')),
                ('linklevel', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='ipg_linklevel', to='netbox_aci.linklevel')),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
            ],
            options={
                'verbose_name': 'Policy Group',
                'verbose_name_plural': 'Policy Groups',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='PolicyGroupAssignement',
            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)),
                ('device', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='dcim.device')),
                ('interface', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='dcim.interface')),
                ('ipg', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ipgassignement', to='netbox_aci.policygroup')),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
            ],
            options={
                'verbose_name': 'Policy Group Assignement',
                'verbose_name_plural': 'Policy Groups Assignements',
                'ordering': ['ipg'],
            },
        ),
        migrations.CreateModel(
            name='AAEPStaticBinding',
            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)),
                ('index', models.PositiveIntegerField(null=True)),
                ('encap', models.CharField(max_length=9, null=True, validators=[django.core.validators.RegexValidator('^vlan-(?:[1-9][0-9]{0,2}|[1-3][0-9]{3}|40[0-3][0-9]|409[0-4])$', 'Vlan must be in the form vlan-[1-4094]')])),
                ('mode', models.CharField()),
                ('aaep', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='aaepstaticbinding_aaep', to='netbox_aci.aaep')),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
                ('tenant', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='aaepstaticbinding_tenant', to='tenancy.tenant')),
                ('applicationprofile', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='aaepstaticbinding_applicationprofile', to='netbox_aci.applicationprofile')),
                ('epg', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='aaepstaticbinding_epg', to='netbox_aci.endpointgroup')),
            ],
            options={
                'ordering': ['aaep', 'index'],
                'unique_together': {('aaep', 'index')},
            },
        ),
    ]
