netbox-plugin-dns 0.22.9__py3-none-any.whl → 1.0b1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of netbox-plugin-dns might be problematic. Click here for more details.
- netbox_dns/__init__.py +3 -14
- netbox_dns/api/nested_serializers.py +4 -60
- netbox_dns/api/serializers.py +8 -314
- netbox_dns/api/serializers_/__init__.py +0 -0
- netbox_dns/api/serializers_/contact.py +37 -0
- netbox_dns/api/serializers_/nameserver.py +39 -0
- netbox_dns/api/serializers_/record.py +90 -0
- netbox_dns/api/serializers_/registrar.py +31 -0
- netbox_dns/api/serializers_/view.py +29 -0
- netbox_dns/api/serializers_/zone.py +170 -0
- netbox_dns/api/views.py +13 -13
- netbox_dns/fields/network.py +1 -1
- netbox_dns/fields/rfc2317.py +1 -1
- netbox_dns/{filters → filtersets}/contact.py +2 -1
- netbox_dns/filtersets/nameserver.py +37 -0
- netbox_dns/{filters → filtersets}/record.py +51 -6
- netbox_dns/{filters → filtersets}/registrar.py +2 -1
- netbox_dns/{filters → filtersets}/view.py +2 -2
- netbox_dns/filtersets/zone.py +205 -0
- netbox_dns/forms/contact.py +61 -33
- netbox_dns/forms/nameserver.py +21 -8
- netbox_dns/forms/record.py +35 -36
- netbox_dns/forms/registrar.py +45 -15
- netbox_dns/forms/view.py +19 -8
- netbox_dns/forms/zone.py +112 -87
- netbox_dns/graphql/__init__.py +17 -27
- netbox_dns/graphql/filters.py +49 -0
- netbox_dns/graphql/schema.py +66 -7
- netbox_dns/graphql/types.py +146 -0
- netbox_dns/management/commands/cleanup_database.py +0 -4
- netbox_dns/management/commands/cleanup_rrset_ttl.py +3 -5
- netbox_dns/management/commands/setup_coupling.py +15 -15
- netbox_dns/management/commands/update_soa.py +1 -1
- netbox_dns/migrations/0001_squashed_netbox_dns_0_15.py +0 -27
- netbox_dns/migrations/0001_squashed_netbox_dns_0_22.py +556 -0
- netbox_dns/migrations/{0013_add_nameserver_zone_record_description.py → 0002_contact_description_registrar_description.py} +4 -9
- netbox_dns/migrations/0020_netbox_3_4.py +1 -1
- netbox_dns/models/contact.py +6 -1
- netbox_dns/models/nameserver.py +3 -3
- netbox_dns/models/record.py +8 -15
- netbox_dns/models/registrar.py +5 -1
- netbox_dns/models/view.py +1 -1
- netbox_dns/models/zone.py +6 -9
- netbox_dns/navigation.py +1 -15
- netbox_dns/signals/ipam_coupling.py +3 -8
- netbox_dns/tables/contact.py +1 -0
- netbox_dns/tables/nameserver.py +0 -2
- netbox_dns/tables/registrar.py +1 -0
- netbox_dns/template_content.py +3 -7
- netbox_dns/templates/netbox_dns/contact.html +60 -56
- netbox_dns/templates/netbox_dns/nameserver.html +27 -27
- netbox_dns/templates/netbox_dns/record.html +92 -94
- netbox_dns/templates/netbox_dns/registrar.html +38 -36
- netbox_dns/templates/netbox_dns/view.html +21 -21
- netbox_dns/templates/netbox_dns/zone/base.html +5 -3
- netbox_dns/templates/netbox_dns/zone/child.html +3 -3
- netbox_dns/templates/netbox_dns/zone/managed_record.html +1 -1
- netbox_dns/templates/netbox_dns/zone/record.html +3 -3
- netbox_dns/templates/netbox_dns/zone/registration.html +26 -27
- netbox_dns/templates/netbox_dns/zone/rfc2317_child_zone.html +1 -1
- netbox_dns/templates/netbox_dns/zone.html +150 -149
- netbox_dns/utilities/__init__.py +1 -6
- netbox_dns/utilities/ipam_coupling.py +2 -7
- netbox_dns/validators/dns_name.py +4 -9
- netbox_dns/validators/rfc2317.py +2 -2
- netbox_dns/views/contact.py +4 -4
- netbox_dns/views/nameserver.py +5 -5
- netbox_dns/views/record.py +19 -12
- netbox_dns/views/registrar.py +4 -4
- netbox_dns/views/view.py +4 -4
- netbox_dns/views/zone.py +7 -8
- {netbox_plugin_dns-0.22.9.dist-info → netbox_plugin_dns-1.0b1.dist-info}/METADATA +5 -7
- netbox_plugin_dns-1.0b1.dist-info/RECORD +103 -0
- netbox_dns/filters/nameserver.py +0 -18
- netbox_dns/filters/zone.py +0 -112
- netbox_dns/graphql/contact.py +0 -19
- netbox_dns/graphql/nameserver.py +0 -19
- netbox_dns/graphql/record.py +0 -19
- netbox_dns/graphql/registrar.py +0 -19
- netbox_dns/graphql/view.py +0 -19
- netbox_dns/graphql/zone.py +0 -19
- netbox_dns/migrations/0001_initial.py +0 -115
- netbox_dns/migrations/0002_zone_default_ttl.py +0 -18
- netbox_dns/migrations/0003_soa_managed_records.py +0 -112
- netbox_dns/migrations/0004_create_ptr_for_a_aaaa_records.py +0 -80
- netbox_dns/migrations/0005_update_ns_records.py +0 -41
- netbox_dns/migrations/0006_zone_soa_serial_auto.py +0 -29
- netbox_dns/migrations/0007_alter_zone_soa_serial_auto.py +0 -17
- netbox_dns/migrations/0008_zone_status_names.py +0 -21
- netbox_dns/migrations/0009_netbox32.py +0 -71
- netbox_dns/migrations/0010_update_soa_records.py +0 -58
- netbox_dns/migrations/0011_add_view_model.py +0 -70
- netbox_dns/migrations/0012_adjust_zone_and_record.py +0 -17
- netbox_dns/migrations/0014_add_view_description.py +0 -16
- netbox_dns/migrations/0015_add_record_status.py +0 -17
- netbox_dns/migrations/0016_cleanup_ptr_records.py +0 -38
- netbox_dns/migrations/0017_alter_record_ttl.py +0 -17
- netbox_dns/migrations/0018_zone_arpa_network.py +0 -51
- netbox_dns/migrations/0019_update_ns_ttl.py +0 -19
- netbox_plugin_dns-0.22.9.dist-info/RECORD +0 -117
- /netbox_dns/{filters → filtersets}/__init__.py +0 -0
- {netbox_plugin_dns-0.22.9.dist-info → netbox_plugin_dns-1.0b1.dist-info}/LICENSE +0 -0
- {netbox_plugin_dns-0.22.9.dist-info → netbox_plugin_dns-1.0b1.dist-info}/WHEEL +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
from django.core.management.base import BaseCommand
|
|
1
|
+
from django.core.management.base import BaseCommand
|
|
2
2
|
|
|
3
|
-
from
|
|
3
|
+
from core.models import ObjectType
|
|
4
4
|
from extras.models import CustomField
|
|
5
5
|
from extras.choices import CustomFieldTypeChoices
|
|
6
6
|
from ipam.models import IPAddress
|
|
7
|
-
from netbox_dns.models import
|
|
7
|
+
from netbox_dns.models import Zone
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class Command(BaseCommand):
|
|
@@ -17,7 +17,7 @@ class Command(BaseCommand):
|
|
|
17
17
|
parser.add_argument("--verbose", action="store_true", help="Verbose output")
|
|
18
18
|
|
|
19
19
|
def handle(self, *model_names, **options):
|
|
20
|
-
ipaddress_object_type =
|
|
20
|
+
ipaddress_object_type = ObjectType.objects.get_for_model(IPAddress)
|
|
21
21
|
|
|
22
22
|
if options["remove"]:
|
|
23
23
|
for cf in (
|
|
@@ -28,18 +28,18 @@ class Command(BaseCommand):
|
|
|
28
28
|
):
|
|
29
29
|
try:
|
|
30
30
|
CustomField.objects.get(
|
|
31
|
-
name=cf,
|
|
31
|
+
name=cf, object_types=ipaddress_object_type
|
|
32
32
|
).delete()
|
|
33
33
|
if options.get("verbose"):
|
|
34
34
|
self.stdout.write(f"Custom field '{cf}' removed")
|
|
35
|
-
except:
|
|
35
|
+
except CustomField.DoesNotExist:
|
|
36
36
|
pass
|
|
37
37
|
|
|
38
38
|
else:
|
|
39
39
|
if not CustomField.objects.filter(
|
|
40
40
|
name="ipaddress_dns_record_name",
|
|
41
41
|
type=CustomFieldTypeChoices.TYPE_TEXT,
|
|
42
|
-
|
|
42
|
+
object_types=ipaddress_object_type,
|
|
43
43
|
).exists():
|
|
44
44
|
cf_name = CustomField.objects.create(
|
|
45
45
|
name="ipaddress_dns_record_name",
|
|
@@ -48,7 +48,7 @@ class Command(BaseCommand):
|
|
|
48
48
|
required=False,
|
|
49
49
|
group_name="DNS",
|
|
50
50
|
)
|
|
51
|
-
cf_name.
|
|
51
|
+
cf_name.object_types.set([ipaddress_object_type])
|
|
52
52
|
if options.get("verbose"):
|
|
53
53
|
self.stdout.write(
|
|
54
54
|
"Created custom field 'ipaddress_dns_record_name'"
|
|
@@ -57,7 +57,7 @@ class Command(BaseCommand):
|
|
|
57
57
|
if not CustomField.objects.filter(
|
|
58
58
|
name="ipaddress_dns_record_ttl",
|
|
59
59
|
type=CustomFieldTypeChoices.TYPE_INTEGER,
|
|
60
|
-
|
|
60
|
+
object_types=ipaddress_object_type,
|
|
61
61
|
).exists():
|
|
62
62
|
cf_ttl = CustomField.objects.create(
|
|
63
63
|
name="ipaddress_dns_record_ttl",
|
|
@@ -68,14 +68,14 @@ class Command(BaseCommand):
|
|
|
68
68
|
required=False,
|
|
69
69
|
group_name="DNS",
|
|
70
70
|
)
|
|
71
|
-
cf_ttl.
|
|
71
|
+
cf_ttl.object_types.set([ipaddress_object_type])
|
|
72
72
|
if options.get("verbose"):
|
|
73
73
|
self.stdout.write("Created custom field 'ipaddress_dns_record_ttl'")
|
|
74
74
|
|
|
75
75
|
if not CustomField.objects.filter(
|
|
76
76
|
name="ipaddress_dns_record_disable_ptr",
|
|
77
77
|
type=CustomFieldTypeChoices.TYPE_BOOLEAN,
|
|
78
|
-
|
|
78
|
+
object_types=ipaddress_object_type,
|
|
79
79
|
).exists():
|
|
80
80
|
cf_disable_ptr = CustomField.objects.create(
|
|
81
81
|
name="ipaddress_dns_record_disable_ptr",
|
|
@@ -85,7 +85,7 @@ class Command(BaseCommand):
|
|
|
85
85
|
default=False,
|
|
86
86
|
group_name="DNS",
|
|
87
87
|
)
|
|
88
|
-
cf_disable_ptr.
|
|
88
|
+
cf_disable_ptr.object_types.set([ipaddress_object_type])
|
|
89
89
|
if options.get("verbose"):
|
|
90
90
|
self.stdout.write(
|
|
91
91
|
"Created custom field 'ipaddress_dns_record_disable_ptr'"
|
|
@@ -94,16 +94,16 @@ class Command(BaseCommand):
|
|
|
94
94
|
if not CustomField.objects.filter(
|
|
95
95
|
name="ipaddress_dns_zone_id",
|
|
96
96
|
type=CustomFieldTypeChoices.TYPE_OBJECT,
|
|
97
|
-
|
|
97
|
+
object_types=ipaddress_object_type,
|
|
98
98
|
).exists():
|
|
99
99
|
cf_zone = CustomField.objects.create(
|
|
100
100
|
name="ipaddress_dns_zone_id",
|
|
101
101
|
label="Zone",
|
|
102
102
|
type=CustomFieldTypeChoices.TYPE_OBJECT,
|
|
103
|
-
|
|
103
|
+
related_object_type=ObjectType.objects.get_for_model(Zone),
|
|
104
104
|
required=False,
|
|
105
105
|
group_name="DNS",
|
|
106
106
|
)
|
|
107
|
-
cf_zone.
|
|
107
|
+
cf_zone.object_types.set([ipaddress_object_type])
|
|
108
108
|
if options.get("verbose"):
|
|
109
109
|
self.stdout.write("Created custom field 'ipaddress_dns_zone_id'")
|
|
@@ -9,35 +9,8 @@ import netbox_dns.fields.network
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class Migration(migrations.Migration):
|
|
12
|
-
replaces = [
|
|
13
|
-
("netbox_dns", "0001_initial"),
|
|
14
|
-
("netbox_dns", "0015_add_record_status"),
|
|
15
|
-
("netbox_dns", "0013_add_nameserver_zone_record_description"),
|
|
16
|
-
("netbox_dns", "0011_add_view_model"),
|
|
17
|
-
("netbox_dns", "0002_zone_default_ttl"),
|
|
18
|
-
("netbox_dns", "0003_soa_managed_records"),
|
|
19
|
-
("netbox_dns", "0004_create_ptr_for_a_aaaa_records"),
|
|
20
|
-
("netbox_dns", "0006_zone_soa_serial_auto"),
|
|
21
|
-
("netbox_dns", "0007_alter_zone_soa_serial_auto"),
|
|
22
|
-
("netbox_dns", "0005_update_ns_records"),
|
|
23
|
-
("netbox_dns", "0008_zone_status_names"),
|
|
24
|
-
("netbox_dns", "0009_netbox32"),
|
|
25
|
-
("netbox_dns", "0010_update_soa_records"),
|
|
26
|
-
("netbox_dns", "0012_adjust_zone_and_record"),
|
|
27
|
-
("netbox_dns", "0014_add_view_description"),
|
|
28
|
-
("netbox_dns", "0016_cleanup_ptr_records"),
|
|
29
|
-
("netbox_dns", "0017_alter_record_ttl"),
|
|
30
|
-
("netbox_dns", "0018_zone_arpa_network"),
|
|
31
|
-
("netbox_dns", "0019_update_ns_ttl"),
|
|
32
|
-
]
|
|
33
|
-
|
|
34
|
-
initial = True
|
|
35
|
-
|
|
36
12
|
dependencies = [
|
|
37
|
-
("extras", "0072_created_datetimefield"),
|
|
38
|
-
("extras", "0062_clear_secrets_changelog"),
|
|
39
13
|
("extras", "0073_journalentry_tags_custom_fields"),
|
|
40
|
-
("extras", "0059_exporttemplate_as_attachment"),
|
|
41
14
|
]
|
|
42
15
|
|
|
43
16
|
operations = [
|