netbox-plugin-dns 1.0.5__tar.gz → 1.0.7__tar.gz
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_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/PKG-INFO +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/__init__.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/nested_serializers.py +18 -17
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/contact.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/nameserver.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/record.py +2 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/record_template.py +2 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/registrar.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/view.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/zone.py +2 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/zone_template.py +2 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/views.py +0 -28
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/choices/record.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/choices/zone.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/fields/address.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/fields/network.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/fields/rfc2317.py +4 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/contact.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/nameserver.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/record.py +2 -2
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/record_template.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/registrar.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/view.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/zone.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/zone_template.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/forms/contact.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/forms/nameserver.py +14 -3
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/forms/record.py +2 -2
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/forms/record_template.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/forms/registrar.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/forms/view.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/forms/zone.py +17 -6
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/forms/zone_template.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/graphql/schema.py +16 -40
- netbox_plugin_dns-1.0.7/netbox_dns/migrations/0007_alter_ordering_options.py +25 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/mixins/object_modification.py +3 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/models/contact.py +10 -4
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/models/nameserver.py +9 -4
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/models/record.py +19 -5
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/models/record_template.py +5 -2
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/models/registrar.py +8 -2
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/models/view.py +10 -3
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/models/zone.py +19 -13
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/models/zone_template.py +10 -6
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/tables/contact.py +1 -2
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/tables/nameserver.py +2 -8
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/tables/record.py +11 -31
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/tables/record_template.py +1 -18
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/tables/registrar.py +1 -3
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/tables/view.py +2 -9
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/tables/zone.py +1 -16
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/tables/zone_template.py +3 -17
- netbox_plugin_dns-1.0.7/netbox_dns/urls/contact.py +29 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/urls/nameserver.py +14 -38
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/urls/record.py +7 -19
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/urls/record_template.py +18 -27
- netbox_plugin_dns-1.0.7/netbox_dns/urls/registrar.py +39 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/urls/view.py +8 -22
- netbox_plugin_dns-1.0.7/netbox_dns/urls/zone.py +25 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/urls/zone_template.py +16 -26
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/validators/dns_name.py +10 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/validators/dns_value.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/validators/rfc2317.py +1 -1
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/views/contact.py +2 -2
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/views/nameserver.py +9 -4
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/views/record.py +10 -3
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/views/record_template.py +2 -2
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/views/registrar.py +1 -2
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/views/view.py +7 -2
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/views/zone.py +8 -7
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/views/zone_template.py +3 -3
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/pyproject.toml +1 -1
- netbox_plugin_dns-1.0.5/netbox_dns/urls/contact.py +0 -51
- netbox_plugin_dns-1.0.5/netbox_dns/urls/registrar.py +0 -63
- netbox_plugin_dns-1.0.5/netbox_dns/urls/zone.py +0 -63
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/LICENSE +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/README.md +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/__init__.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/urls.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/apps.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/choices/__init__.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/fields/__init__.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/__init__.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/forms/__init__.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/graphql/__init__.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/graphql/filters.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/graphql/types.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/management/commands/cleanup_database.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/management/commands/cleanup_rrset_ttl.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/management/commands/setup_coupling.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/management/commands/update_soa.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0001_squashed_netbox_dns_0_15.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0001_squashed_netbox_dns_0_22.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0002_contact_description_registrar_description.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0003_default_view.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0004_create_and_assign_default_view.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0005_alter_zone_view_not_null.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0006_templating.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0020_netbox_3_4.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0021_record_ip_address.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0022_search.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0023_alter_record_value.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0024_tenancy.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0025_ipam_coupling_cf.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0026_domain_registration.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0027_alter_registrar_iana_id.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0028_rfc2317_fields.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0029_record_fqdn.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/__init__.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/mixins/__init__.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/models/__init__.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/navigation.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/signals/__init__.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/signals/ipam_coupling.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/tables/__init__.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/template_content.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/contact.html +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/nameserver.html +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/record/managed.html +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/record/related.html +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/record.html +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/recordtemplate.html +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/registrar.html +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/related_dns_objects.html +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/view.html +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/zone/base.html +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/zone/child.html +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/zone/child_zone.html +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/zone/managed_record.html +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/zone/record.html +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/zone/registration.html +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/zone/rfc2317_child_zone.html +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/zone.html +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/zonetemplate.html +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/urls/__init__.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/utilities/__init__.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/utilities/ipam_coupling.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/validators/__init__.py +0 -0
- {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/views/__init__.py +0 -0
|
@@ -6,7 +6,7 @@ from netbox_dns.models import Zone, Record, ZoneTemplate, RecordTemplate
|
|
|
6
6
|
from netbox_dns.api.serializers_.view import ViewSerializer
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
__all__ = (
|
|
10
10
|
"NestedZoneSerializer",
|
|
11
11
|
"NestedRecordSerializer",
|
|
12
12
|
"NestedZoneTemplateSerializer",
|
|
@@ -59,6 +59,22 @@ class NestedZoneSerializer(WritableNestedSerializer):
|
|
|
59
59
|
]
|
|
60
60
|
|
|
61
61
|
|
|
62
|
+
class NestedZoneTemplateSerializer(WritableNestedSerializer):
|
|
63
|
+
url = serializers.HyperlinkedIdentityField(
|
|
64
|
+
view_name="plugins-api:netbox_dns-api:zonetemplate-detail"
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
class Meta:
|
|
68
|
+
model = ZoneTemplate
|
|
69
|
+
fields = (
|
|
70
|
+
"id",
|
|
71
|
+
"url",
|
|
72
|
+
"name",
|
|
73
|
+
"display",
|
|
74
|
+
"description",
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
|
|
62
78
|
class NestedRecordSerializer(WritableNestedSerializer):
|
|
63
79
|
url = serializers.HyperlinkedIdentityField(
|
|
64
80
|
view_name="plugins-api:netbox_dns-api:record-detail"
|
|
@@ -86,6 +102,7 @@ class NestedRecordSerializer(WritableNestedSerializer):
|
|
|
86
102
|
"status",
|
|
87
103
|
"ttl",
|
|
88
104
|
"zone",
|
|
105
|
+
"managed",
|
|
89
106
|
"active",
|
|
90
107
|
]
|
|
91
108
|
|
|
@@ -109,19 +126,3 @@ class NestedRecordTemplateSerializer(WritableNestedSerializer):
|
|
|
109
126
|
"ttl",
|
|
110
127
|
"description",
|
|
111
128
|
)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
class NestedZoneTemplateSerializer(WritableNestedSerializer):
|
|
115
|
-
url = serializers.HyperlinkedIdentityField(
|
|
116
|
-
view_name="plugins-api:netbox_dns-api:zonetemplate-detail"
|
|
117
|
-
)
|
|
118
|
-
|
|
119
|
-
class Meta:
|
|
120
|
-
model = ZoneTemplate
|
|
121
|
-
fields = (
|
|
122
|
-
"id",
|
|
123
|
-
"url",
|
|
124
|
-
"name",
|
|
125
|
-
"display",
|
|
126
|
-
"description",
|
|
127
|
-
)
|
|
@@ -9,7 +9,7 @@ from netbox_dns.models import Record
|
|
|
9
9
|
from ..nested_serializers import NestedZoneSerializer, NestedRecordSerializer
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
__all__ = ("RecordSerializer",)
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class RecordSerializer(NetBoxModelSerializer):
|
|
@@ -87,5 +87,6 @@ class RecordSerializer(NetBoxModelSerializer):
|
|
|
87
87
|
"status",
|
|
88
88
|
"ttl",
|
|
89
89
|
"description",
|
|
90
|
+
"managed",
|
|
90
91
|
"active",
|
|
91
92
|
)
|
{netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/record_template.py
RENAMED
|
@@ -7,7 +7,8 @@ from netbox_dns.models import RecordTemplate
|
|
|
7
7
|
|
|
8
8
|
from ..nested_serializers import NestedZoneTemplateSerializer
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
__all__ = ("RecordTemplateSerializer",)
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
class RecordTemplateSerializer(NetBoxModelSerializer):
|
{netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/zone_template.py
RENAMED
|
@@ -10,7 +10,8 @@ from .nameserver import NameServerSerializer
|
|
|
10
10
|
from .registrar import RegistrarSerializer
|
|
11
11
|
from .contact import ContactSerializer
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
__all__ = ("ZoneTemplateSerializer",)
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
class ZoneTemplateSerializer(NetBoxModelSerializer):
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
from rest_framework import serializers
|
|
2
|
-
from rest_framework.decorators import action
|
|
3
|
-
from rest_framework.response import Response
|
|
4
2
|
from rest_framework.routers import APIRootView
|
|
5
3
|
|
|
6
4
|
from netbox.api.viewsets import NetBoxModelViewSet
|
|
@@ -47,12 +45,6 @@ class ViewViewSet(NetBoxModelViewSet):
|
|
|
47
45
|
serializer_class = ViewSerializer
|
|
48
46
|
filterset_class = ViewFilterSet
|
|
49
47
|
|
|
50
|
-
@action(detail=True, methods=["get"])
|
|
51
|
-
def views(self, request, pk=None):
|
|
52
|
-
views = View.objects.filter(zone=pk)
|
|
53
|
-
serializer = ViewSerializer(views, many=True, context={"request": request})
|
|
54
|
-
return Response(serializer.data)
|
|
55
|
-
|
|
56
48
|
|
|
57
49
|
class ZoneViewSet(NetBoxModelViewSet):
|
|
58
50
|
queryset = Zone.objects.prefetch_related(
|
|
@@ -66,32 +58,12 @@ class ZoneViewSet(NetBoxModelViewSet):
|
|
|
66
58
|
serializer_class = ZoneSerializer
|
|
67
59
|
filterset_class = ZoneFilterSet
|
|
68
60
|
|
|
69
|
-
@action(detail=True, methods=["get"])
|
|
70
|
-
def records(self, request, pk=None):
|
|
71
|
-
records = Record.objects.filter(zone=pk)
|
|
72
|
-
serializer = RecordSerializer(records, many=True, context={"request": request})
|
|
73
|
-
return Response(serializer.data)
|
|
74
|
-
|
|
75
|
-
@action(detail=True, methods=["get"])
|
|
76
|
-
def nameservers(self, request, pk=None):
|
|
77
|
-
nameservers = NameServer.objects.filter(zones__id=pk)
|
|
78
|
-
serializer = NameServerSerializer(
|
|
79
|
-
nameservers, many=True, context={"request": request}
|
|
80
|
-
)
|
|
81
|
-
return Response(serializer.data)
|
|
82
|
-
|
|
83
61
|
|
|
84
62
|
class NameServerViewSet(NetBoxModelViewSet):
|
|
85
63
|
queryset = NameServer.objects.prefetch_related("zones", "tenant")
|
|
86
64
|
serializer_class = NameServerSerializer
|
|
87
65
|
filterset_class = NameServerFilterSet
|
|
88
66
|
|
|
89
|
-
@action(detail=True, methods=["get"])
|
|
90
|
-
def zones(self, request, pk=None):
|
|
91
|
-
zones = Zone.objects.filter(nameservers__id=pk)
|
|
92
|
-
serializer = ZoneSerializer(zones, many=True, context={"request": request})
|
|
93
|
-
return Response(serializer.data)
|
|
94
|
-
|
|
95
67
|
|
|
96
68
|
class RecordViewSet(NetBoxModelViewSet):
|
|
97
69
|
queryset = Record.objects.all().prefetch_related("zone", "zone__view", "tenant")
|
|
@@ -10,7 +10,10 @@ from .network import NetContains, NetContained, NetOverlap, NetMaskLength
|
|
|
10
10
|
INVALID_RFC2317 = "RFC2317 requires an IPv4 prefix with a length of at least 25 bits."
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
__all__ = (
|
|
14
|
+
"RFC2317NetworkField",
|
|
15
|
+
"RFC2317NetworkFormField",
|
|
16
|
+
)
|
|
14
17
|
|
|
15
18
|
|
|
16
19
|
class RFC2317NetworkFormField(forms.Field):
|
|
@@ -13,7 +13,7 @@ from netbox_dns.models import View, Zone, Record
|
|
|
13
13
|
from netbox_dns.choices import RecordTypeChoices, RecordStatusChoices
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
__all__ = ("RecordFilterSet",)
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class RecordFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
|
|
@@ -121,7 +121,7 @@ class RecordFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
|
|
|
121
121
|
if not value.strip():
|
|
122
122
|
return queryset
|
|
123
123
|
qs_filter = (
|
|
124
|
-
Q(
|
|
124
|
+
Q(fqdn__icontains=value)
|
|
125
125
|
| Q(value__icontains=value)
|
|
126
126
|
| Q(zone__name__icontains=value)
|
|
127
127
|
)
|
{netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/record_template.py
RENAMED
|
@@ -8,7 +8,7 @@ from netbox_dns.models import RecordTemplate, ZoneTemplate
|
|
|
8
8
|
from netbox_dns.choices import RecordTypeChoices, RecordStatusChoices
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
__all__ = ("RecordTemplateFilterSet",)
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class RecordTemplateFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
|
|
@@ -11,7 +11,7 @@ from netbox_dns.models import View, Zone, Registrar, Contact, NameServer
|
|
|
11
11
|
from netbox_dns.choices import ZoneStatusChoices
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
__all__ = ("ZoneFilterSet",)
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class ZoneFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
|
|
@@ -11,16 +11,17 @@ from utilities.forms.fields import (
|
|
|
11
11
|
TagFilterField,
|
|
12
12
|
CSVModelChoiceField,
|
|
13
13
|
DynamicModelChoiceField,
|
|
14
|
+
DynamicModelMultipleChoiceField,
|
|
14
15
|
)
|
|
15
16
|
from utilities.forms.rendering import FieldSet
|
|
16
17
|
from tenancy.models import Tenant
|
|
17
18
|
from tenancy.forms import TenancyForm, TenancyFilterForm
|
|
18
19
|
|
|
19
|
-
from netbox_dns.models import NameServer
|
|
20
|
+
from netbox_dns.models import NameServer, Zone
|
|
20
21
|
from netbox_dns.utilities import name_to_unicode
|
|
21
22
|
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
__all__ = (
|
|
24
25
|
"NameServerForm",
|
|
25
26
|
"NameServerFilterForm",
|
|
26
27
|
"NameServerImportForm",
|
|
@@ -50,6 +51,16 @@ class NameServerForm(TenancyForm, NetBoxModelForm):
|
|
|
50
51
|
class NameServerFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
51
52
|
model = NameServer
|
|
52
53
|
|
|
54
|
+
zone_id = DynamicModelMultipleChoiceField(
|
|
55
|
+
queryset=Zone.objects.all(),
|
|
56
|
+
required=False,
|
|
57
|
+
label="Zones",
|
|
58
|
+
)
|
|
59
|
+
soa_zone_id = DynamicModelMultipleChoiceField(
|
|
60
|
+
queryset=Zone.objects.all(),
|
|
61
|
+
required=False,
|
|
62
|
+
label="SOA Zones",
|
|
63
|
+
)
|
|
53
64
|
name = forms.CharField(
|
|
54
65
|
required=False,
|
|
55
66
|
)
|
|
@@ -60,7 +71,7 @@ class NameServerFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
60
71
|
|
|
61
72
|
fieldsets = (
|
|
62
73
|
FieldSet("q", "filter_id", "tag"),
|
|
63
|
-
FieldSet("name", "description", name="Attributes"),
|
|
74
|
+
FieldSet("name", "zone_id", "soa_zone_id", "description", name="Attributes"),
|
|
64
75
|
FieldSet("tenant_group_id", "tenant_id", name="Tenancy"),
|
|
65
76
|
)
|
|
66
77
|
|
|
@@ -24,7 +24,7 @@ from netbox_dns.choices import RecordTypeChoices, RecordStatusChoices
|
|
|
24
24
|
from netbox_dns.utilities import name_to_unicode
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
__all__ = (
|
|
28
28
|
"RecordForm",
|
|
29
29
|
"RecordFilterForm",
|
|
30
30
|
"RecordImportForm",
|
|
@@ -60,7 +60,7 @@ class RecordForm(TenancyForm, NetBoxModelForm):
|
|
|
60
60
|
label="Zone",
|
|
61
61
|
)
|
|
62
62
|
|
|
63
|
-
disable_ptr = forms.
|
|
63
|
+
disable_ptr = forms.BooleanField(
|
|
64
64
|
label="Disable PTR",
|
|
65
65
|
required=False,
|
|
66
66
|
)
|
|
@@ -39,7 +39,7 @@ from netbox_dns.fields import RFC2317NetworkFormField
|
|
|
39
39
|
from netbox_dns.validators import validate_ipv4, validate_prefix, validate_rfc2317
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
__all__ = (
|
|
43
43
|
"ZoneForm",
|
|
44
44
|
"ZoneFilterForm",
|
|
45
45
|
"ZoneImportForm",
|
|
@@ -81,6 +81,14 @@ class ZoneTemplateUpdateMixin:
|
|
|
81
81
|
else:
|
|
82
82
|
zone_data = self.cleaned_data.copy()
|
|
83
83
|
|
|
84
|
+
custom_fields = dict()
|
|
85
|
+
for key, value in zone_data.copy().items():
|
|
86
|
+
if key.startswith("cf_"):
|
|
87
|
+
custom_fields[key[3:]] = value
|
|
88
|
+
zone_data.pop(key)
|
|
89
|
+
if custom_fields:
|
|
90
|
+
zone_data["custom_field_data"] = custom_fields
|
|
91
|
+
|
|
84
92
|
zone_data.pop("template", None)
|
|
85
93
|
zone_data.pop("tenant_group", None)
|
|
86
94
|
zone_data.pop("_init_time", None)
|
|
@@ -261,9 +269,6 @@ class ZoneForm(ZoneTemplateUpdateMixin, TenancyForm, NetBoxModelForm):
|
|
|
261
269
|
if self.initial.get("soa_ttl") is None:
|
|
262
270
|
self.initial["soa_ttl"] = self.initial.get("default_ttl")
|
|
263
271
|
|
|
264
|
-
if self.initial.get("soa_serial_auto"):
|
|
265
|
-
self.initial["soa_serial"] = None
|
|
266
|
-
|
|
267
272
|
if self.initial.get("soa_mname") is None:
|
|
268
273
|
default_soa_mname = defaults.get("zone_soa_mname")
|
|
269
274
|
if default_soa_mname is not None:
|
|
@@ -330,7 +335,12 @@ class ZoneFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
330
335
|
fieldsets = (
|
|
331
336
|
FieldSet("q", "filter_id", "tag"),
|
|
332
337
|
FieldSet(
|
|
333
|
-
"view_id",
|
|
338
|
+
"view_id",
|
|
339
|
+
"status",
|
|
340
|
+
"name",
|
|
341
|
+
"nameserver_id",
|
|
342
|
+
"description",
|
|
343
|
+
name="Attributes",
|
|
334
344
|
),
|
|
335
345
|
FieldSet(
|
|
336
346
|
"soa_mname_id",
|
|
@@ -368,9 +378,10 @@ class ZoneFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
368
378
|
name = forms.CharField(
|
|
369
379
|
required=False,
|
|
370
380
|
)
|
|
371
|
-
|
|
381
|
+
nameserver_id = DynamicModelMultipleChoiceField(
|
|
372
382
|
queryset=NameServer.objects.all(),
|
|
373
383
|
required=False,
|
|
384
|
+
label="Nameservers",
|
|
374
385
|
)
|
|
375
386
|
description = forms.CharField(
|
|
376
387
|
required=False,
|
|
@@ -25,79 +25,55 @@ from .types import (
|
|
|
25
25
|
)
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
@strawberry.type
|
|
28
|
+
@strawberry.type(name="Query")
|
|
29
29
|
class NetBoxDNSNameServerQuery:
|
|
30
|
-
|
|
31
|
-
def netbox_dns_nameserver(self, id: int) -> NetBoxDNSNameServerType:
|
|
32
|
-
return NameServer.objects.get(pk=id)
|
|
33
|
-
|
|
30
|
+
netbox_dns_nameserver: NetBoxDNSNameServerType = strawberry_django.field()
|
|
34
31
|
netbox_dns_nameserver_list: List[NetBoxDNSNameServerType] = (
|
|
35
32
|
strawberry_django.field()
|
|
36
33
|
)
|
|
37
34
|
|
|
38
35
|
|
|
39
|
-
@strawberry.type
|
|
36
|
+
@strawberry.type(name="Query")
|
|
40
37
|
class NetBoxDNSViewQuery:
|
|
41
|
-
|
|
42
|
-
def netbox_dns_view(self, id: int) -> NetBoxDNSViewType:
|
|
43
|
-
return View.objects.get(pk=id)
|
|
44
|
-
|
|
38
|
+
netbox_dns_view: NetBoxDNSViewType = strawberry_django.field()
|
|
45
39
|
netbox_dns_view_list: List[NetBoxDNSViewType] = strawberry_django.field()
|
|
46
40
|
|
|
47
41
|
|
|
48
|
-
@strawberry.type
|
|
42
|
+
@strawberry.type(name="Query")
|
|
49
43
|
class NetBoxDNSZoneQuery:
|
|
50
|
-
|
|
51
|
-
def netbox_dns_zone(self, id: int) -> NetBoxDNSZoneType:
|
|
52
|
-
return Zone.objects.get(pk=id)
|
|
53
|
-
|
|
44
|
+
netbox_dns_zone: NetBoxDNSZoneType = strawberry_django.field()
|
|
54
45
|
netbox_dns_zone_list: List[NetBoxDNSZoneType] = strawberry_django.field()
|
|
55
46
|
|
|
56
47
|
|
|
57
|
-
@strawberry.type
|
|
48
|
+
@strawberry.type(name="Query")
|
|
58
49
|
class NetBoxDNSRecordQuery:
|
|
59
|
-
|
|
60
|
-
def netbox_dns_record(self, id: int) -> NetBoxDNSRecordType:
|
|
61
|
-
return Record.objects.get(pk=id)
|
|
62
|
-
|
|
50
|
+
netbox_dns_record: NetBoxDNSRecordType = strawberry_django.field()
|
|
63
51
|
netbox_dns_record_list: List[NetBoxDNSRecordType] = strawberry_django.field()
|
|
64
52
|
|
|
65
53
|
|
|
66
|
-
@strawberry.type
|
|
54
|
+
@strawberry.type(name="Query")
|
|
67
55
|
class NetBoxDNSContactQuery:
|
|
68
|
-
|
|
69
|
-
def netbox_dns_contact(self, id: int) -> NetBoxDNSContactType:
|
|
70
|
-
return Contact.objects.get(pk=id)
|
|
71
|
-
|
|
56
|
+
netbox_dns_contact: NetBoxDNSContactType = strawberry_django.field()
|
|
72
57
|
netbox_dns_contact_list: List[NetBoxDNSContactType] = strawberry_django.field()
|
|
73
58
|
|
|
74
59
|
|
|
75
|
-
@strawberry.type
|
|
60
|
+
@strawberry.type(name="Query")
|
|
76
61
|
class NetBoxDNSRegistrarQuery:
|
|
77
|
-
|
|
78
|
-
def netbox_dns_registrar(self, id: int) -> NetBoxDNSRegistrarType:
|
|
79
|
-
return Registrar.objects.get(pk=id)
|
|
80
|
-
|
|
62
|
+
netbox_dns_registrar: NetBoxDNSRegistrarType = strawberry_django.field()
|
|
81
63
|
netbox_dns_registrar_list: List[NetBoxDNSRegistrarType] = strawberry_django.field()
|
|
82
64
|
|
|
83
65
|
|
|
84
|
-
@strawberry.type
|
|
66
|
+
@strawberry.type(name="Query")
|
|
85
67
|
class NetBoxDNSZoneTemplateQuery:
|
|
86
|
-
|
|
87
|
-
def netbox_dns_zone_template(self, id: int) -> NetBoxDNSZoneTemplateType:
|
|
88
|
-
return ZoneTemplate.objects.get(pk=id)
|
|
89
|
-
|
|
68
|
+
netbox_dns_zone_template: NetBoxDNSZoneTemplateType = strawberry_django.field()
|
|
90
69
|
netbox_dns_zone_template_list: List[NetBoxDNSZoneTemplateType] = (
|
|
91
70
|
strawberry_django.field()
|
|
92
71
|
)
|
|
93
72
|
|
|
94
73
|
|
|
95
|
-
@strawberry.type
|
|
74
|
+
@strawberry.type(name="Query")
|
|
96
75
|
class NetBoxDNSRecordTemplateQuery:
|
|
97
|
-
|
|
98
|
-
def netbox_dns_record_template(self, id: int) -> NetBoxDNSRecordTemplateType:
|
|
99
|
-
return RecordTemplate.objects.get(pk=id)
|
|
100
|
-
|
|
76
|
+
netbox_dns_record_template: NetBoxDNSRecordTemplateType = strawberry_django.field()
|
|
101
77
|
netbox_dns_record_template_list: List[NetBoxDNSRecordTemplateType] = (
|
|
102
78
|
strawberry_django.field()
|
|
103
79
|
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Generated by Django 5.0.7 on 2024-08-27 09:29
|
|
2
|
+
|
|
3
|
+
from django.db import migrations
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
("netbox_dns", "0006_templating"),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AlterModelOptions(
|
|
14
|
+
name="record",
|
|
15
|
+
options={"ordering": ("fqdn", "zone", "name", "type", "value", "status")},
|
|
16
|
+
),
|
|
17
|
+
migrations.AlterModelOptions(
|
|
18
|
+
name="recordtemplate",
|
|
19
|
+
options={"ordering": ("name",)},
|
|
20
|
+
),
|
|
21
|
+
migrations.AlterModelOptions(
|
|
22
|
+
name="zonetemplate",
|
|
23
|
+
options={"ordering": ("name",)},
|
|
24
|
+
),
|
|
25
|
+
]
|