netbox-plugin-dns 0.21.4__py3-none-any.whl → 1.4.7__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.
- netbox_dns/__init__.py +106 -41
- netbox_dns/api/field_serializers.py +25 -0
- netbox_dns/api/nested_serializers.py +95 -52
- netbox_dns/api/serializers.py +14 -296
- netbox_dns/api/serializers_/__init__.py +0 -0
- netbox_dns/api/serializers_/dnssec_key_template.py +69 -0
- netbox_dns/api/serializers_/dnssec_policy.py +165 -0
- netbox_dns/api/serializers_/nameserver.py +56 -0
- netbox_dns/api/serializers_/prefix.py +18 -0
- netbox_dns/api/serializers_/record.py +105 -0
- netbox_dns/api/serializers_/record_template.py +71 -0
- netbox_dns/api/serializers_/registrar.py +45 -0
- netbox_dns/api/serializers_/registration_contact.py +50 -0
- netbox_dns/api/serializers_/view.py +81 -0
- netbox_dns/api/serializers_/zone.py +247 -0
- netbox_dns/api/serializers_/zone_template.py +157 -0
- netbox_dns/api/urls.py +13 -2
- netbox_dns/api/views.py +96 -58
- netbox_dns/choices/__init__.py +4 -0
- netbox_dns/choices/dnssec_key_template.py +67 -0
- netbox_dns/choices/dnssec_policy.py +40 -0
- netbox_dns/choices/record.py +104 -0
- netbox_dns/choices/utilities.py +4 -0
- netbox_dns/choices/zone.py +119 -0
- netbox_dns/fields/__init__.py +4 -0
- netbox_dns/fields/address.py +22 -16
- netbox_dns/fields/choice_array.py +33 -0
- netbox_dns/fields/ipam.py +15 -0
- netbox_dns/fields/network.py +42 -18
- netbox_dns/fields/rfc2317.py +97 -0
- netbox_dns/fields/timeperiod.py +33 -0
- netbox_dns/filters.py +7 -0
- netbox_dns/filtersets/__init__.py +12 -0
- netbox_dns/filtersets/dnssec_key_template.py +57 -0
- netbox_dns/filtersets/dnssec_policy.py +101 -0
- netbox_dns/filtersets/nameserver.py +46 -0
- netbox_dns/filtersets/record.py +135 -0
- netbox_dns/filtersets/record_template.py +59 -0
- netbox_dns/{filters → filtersets}/registrar.py +8 -1
- netbox_dns/{filters/contact.py → filtersets/registration_contact.py} +9 -3
- netbox_dns/filtersets/view.py +45 -0
- netbox_dns/filtersets/zone.py +254 -0
- netbox_dns/filtersets/zone_template.py +165 -0
- netbox_dns/forms/__init__.py +5 -1
- netbox_dns/forms/dnssec_key_template.py +250 -0
- netbox_dns/forms/dnssec_policy.py +654 -0
- netbox_dns/forms/nameserver.py +121 -27
- netbox_dns/forms/record.py +215 -104
- netbox_dns/forms/record_template.py +285 -0
- netbox_dns/forms/registrar.py +108 -31
- netbox_dns/forms/registration_contact.py +282 -0
- netbox_dns/forms/view.py +331 -20
- netbox_dns/forms/zone.py +769 -373
- netbox_dns/forms/zone_template.py +463 -0
- netbox_dns/graphql/__init__.py +25 -22
- netbox_dns/graphql/enums.py +41 -0
- netbox_dns/graphql/filter_lookups.py +13 -0
- netbox_dns/graphql/filters/__init__.py +12 -0
- netbox_dns/graphql/filters/dnssec_key_template.py +63 -0
- netbox_dns/graphql/filters/dnssec_policy.py +124 -0
- netbox_dns/graphql/filters/nameserver.py +32 -0
- netbox_dns/graphql/filters/record.py +89 -0
- netbox_dns/graphql/filters/record_template.py +55 -0
- netbox_dns/graphql/filters/registrar.py +30 -0
- netbox_dns/graphql/filters/registration_contact.py +27 -0
- netbox_dns/graphql/filters/view.py +28 -0
- netbox_dns/graphql/filters/zone.py +147 -0
- netbox_dns/graphql/filters/zone_template.py +97 -0
- netbox_dns/graphql/schema.py +89 -7
- netbox_dns/graphql/types.py +355 -0
- netbox_dns/locale/de/LC_MESSAGES/django.mo +0 -0
- netbox_dns/locale/en/LC_MESSAGES/django.mo +0 -0
- netbox_dns/locale/fr/LC_MESSAGES/django.mo +0 -0
- netbox_dns/management/commands/cleanup_database.py +175 -156
- netbox_dns/management/commands/cleanup_rrset_ttl.py +64 -0
- netbox_dns/management/commands/rebuild_dnssync.py +23 -0
- netbox_dns/management/commands/setup_dnssync.py +140 -0
- netbox_dns/migrations/0001_squashed_netbox_dns_0_15.py +0 -27
- netbox_dns/migrations/0001_squashed_netbox_dns_0_22.py +557 -0
- netbox_dns/migrations/{0013_add_nameserver_zone_record_description.py → 0002_contact_description_registrar_description.py} +4 -9
- netbox_dns/migrations/0003_default_view.py +15 -0
- netbox_dns/migrations/0004_create_and_assign_default_view.py +26 -0
- netbox_dns/migrations/0005_alter_zone_view_not_null.py +18 -0
- netbox_dns/migrations/0006_templating.py +172 -0
- netbox_dns/migrations/0007_alter_ordering_options.py +25 -0
- netbox_dns/migrations/0008_view_prefixes.py +18 -0
- netbox_dns/migrations/0009_rename_contact_registrationcontact.py +36 -0
- netbox_dns/migrations/0010_view_ip_address_filter.py +18 -0
- netbox_dns/migrations/0011_rename_related_fields.py +63 -0
- netbox_dns/migrations/0012_natural_ordering.py +88 -0
- netbox_dns/migrations/0013_zonetemplate_soa_mname_zonetemplate_soa_rname.py +30 -0
- netbox_dns/migrations/0014_alter_unique_constraints_lowercase.py +42 -0
- netbox_dns/migrations/0015_dnssec.py +168 -0
- netbox_dns/migrations/{0015_add_record_status.py → 0016_dnssec_policy_status.py} +5 -4
- netbox_dns/migrations/0017_dnssec_policy_zone_zone_template.py +41 -0
- netbox_dns/migrations/0018_zone_domain_status_zone_expiration_date.py +23 -0
- netbox_dns/migrations/0019_dnssecpolicy_parental_agents.py +25 -0
- netbox_dns/migrations/0020_netbox_3_4.py +1 -1
- netbox_dns/migrations/0020_remove_dnssecpolicy_parental_agents_and_more.py +29 -0
- netbox_dns/migrations/0021_alter_record_ptr_record.py +25 -0
- netbox_dns/migrations/0021_record_ip_address.py +1 -1
- netbox_dns/migrations/0022_alter_record_ipam_ip_address.py +26 -0
- netbox_dns/migrations/0023_disable_ptr_false.py +27 -0
- netbox_dns/migrations/0024_zonetemplate_parental_agents.py +25 -0
- netbox_dns/migrations/0025_remove_zone_inline_signing_and_more.py +22 -0
- netbox_dns/migrations/0026_alter_dnssecpolicy_nsec3_opt_out.py +18 -0
- netbox_dns/migrations/0026_domain_registration.py +1 -1
- netbox_dns/migrations/0027_zone_comments.py +18 -0
- netbox_dns/migrations/0028_alter_zone_default_ttl_alter_zone_soa_minimum_and_more.py +54 -0
- netbox_dns/migrations/0028_rfc2317_fields.py +44 -0
- netbox_dns/migrations/0029_alter_registrationcontact_street.py +18 -0
- netbox_dns/migrations/0029_record_fqdn.py +30 -0
- netbox_dns/mixins/__init__.py +1 -0
- netbox_dns/mixins/object_modification.py +57 -0
- netbox_dns/models/__init__.py +5 -1
- netbox_dns/models/dnssec_key_template.py +114 -0
- netbox_dns/models/dnssec_policy.py +203 -0
- netbox_dns/models/nameserver.py +61 -30
- netbox_dns/models/record.py +781 -234
- netbox_dns/models/record_template.py +198 -0
- netbox_dns/models/registrar.py +34 -15
- netbox_dns/models/{contact.py → registration_contact.py} +72 -43
- netbox_dns/models/view.py +129 -9
- netbox_dns/models/zone.py +806 -242
- netbox_dns/models/zone_template.py +209 -0
- netbox_dns/navigation.py +176 -76
- netbox_dns/signals/__init__.py +0 -0
- netbox_dns/signals/dnssec.py +32 -0
- netbox_dns/signals/ipam_dnssync.py +216 -0
- netbox_dns/tables/__init__.py +5 -1
- netbox_dns/tables/dnssec_key_template.py +49 -0
- netbox_dns/tables/dnssec_policy.py +140 -0
- netbox_dns/tables/ipam_dnssync.py +12 -0
- netbox_dns/tables/nameserver.py +14 -17
- netbox_dns/tables/record.py +117 -59
- netbox_dns/tables/record_template.py +91 -0
- netbox_dns/tables/registrar.py +20 -10
- netbox_dns/tables/{contact.py → registration_contact.py} +22 -11
- netbox_dns/tables/view.py +47 -3
- netbox_dns/tables/zone.py +62 -31
- netbox_dns/tables/zone_template.py +78 -0
- netbox_dns/template_content.py +124 -38
- netbox_dns/templates/netbox_dns/dnsseckeytemplate.html +70 -0
- netbox_dns/templates/netbox_dns/dnssecpolicy.html +163 -0
- netbox_dns/templates/netbox_dns/nameserver.html +31 -28
- netbox_dns/templates/netbox_dns/record/managed.html +2 -1
- netbox_dns/templates/netbox_dns/record/related.html +17 -6
- netbox_dns/templates/netbox_dns/record.html +140 -93
- netbox_dns/templates/netbox_dns/recordtemplate.html +96 -0
- netbox_dns/templates/netbox_dns/registrar.html +41 -34
- netbox_dns/templates/netbox_dns/registrationcontact.html +76 -0
- netbox_dns/templates/netbox_dns/view/button.html +10 -0
- netbox_dns/templates/netbox_dns/view/prefix.html +44 -0
- netbox_dns/templates/netbox_dns/view/related.html +33 -0
- netbox_dns/templates/netbox_dns/view.html +62 -18
- netbox_dns/templates/netbox_dns/zone/base.html +6 -3
- netbox_dns/templates/netbox_dns/zone/child.html +6 -5
- netbox_dns/templates/netbox_dns/zone/child_zone.html +18 -0
- netbox_dns/templates/netbox_dns/zone/delegation_record.html +18 -0
- netbox_dns/templates/netbox_dns/zone/managed_record.html +1 -1
- netbox_dns/templates/netbox_dns/zone/record.html +6 -5
- netbox_dns/templates/netbox_dns/zone/registration.html +43 -24
- netbox_dns/templates/netbox_dns/zone/rfc2317_child_zone.html +18 -0
- netbox_dns/templates/netbox_dns/zone.html +178 -119
- netbox_dns/templates/netbox_dns/zonetemplate/child.html +46 -0
- netbox_dns/templates/netbox_dns/zonetemplate.html +124 -0
- netbox_dns/templatetags/netbox_dns.py +10 -0
- netbox_dns/urls.py +50 -210
- netbox_dns/utilities/__init__.py +3 -0
- netbox_dns/{utilities.py → utilities/conversions.py} +55 -7
- netbox_dns/utilities/dns.py +11 -0
- netbox_dns/utilities/ipam_dnssync.py +370 -0
- netbox_dns/validators/__init__.py +4 -0
- netbox_dns/validators/dns_name.py +116 -0
- netbox_dns/validators/dns_value.py +147 -0
- netbox_dns/validators/dnssec.py +148 -0
- netbox_dns/validators/rfc2317.py +28 -0
- netbox_dns/views/__init__.py +5 -1
- netbox_dns/views/dnssec_key_template.py +78 -0
- netbox_dns/views/dnssec_policy.py +146 -0
- netbox_dns/views/nameserver.py +34 -15
- netbox_dns/views/record.py +156 -15
- netbox_dns/views/record_template.py +93 -0
- netbox_dns/views/registrar.py +32 -13
- netbox_dns/views/registration_contact.py +101 -0
- netbox_dns/views/view.py +58 -14
- netbox_dns/views/zone.py +130 -33
- netbox_dns/views/zone_template.py +82 -0
- netbox_plugin_dns-1.4.7.dist-info/METADATA +132 -0
- netbox_plugin_dns-1.4.7.dist-info/RECORD +201 -0
- {netbox_plugin_dns-0.21.4.dist-info → netbox_plugin_dns-1.4.7.dist-info}/WHEEL +2 -1
- {netbox_plugin_dns-0.21.4.dist-info → netbox_plugin_dns-1.4.7.dist-info/licenses}/LICENSE +2 -1
- netbox_plugin_dns-1.4.7.dist-info/top_level.txt +1 -0
- netbox_dns/filters/__init__.py +0 -6
- netbox_dns/filters/nameserver.py +0 -18
- netbox_dns/filters/record.py +0 -53
- netbox_dns/filters/view.py +0 -18
- netbox_dns/filters/zone.py +0 -112
- netbox_dns/forms/contact.py +0 -211
- 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/management/commands/setup_coupling.py +0 -75
- netbox_dns/management/commands/update_soa.py +0 -22
- netbox_dns/middleware.py +0 -226
- 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/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_dns/templates/netbox_dns/contact.html +0 -71
- netbox_dns/templates/netbox_dns/related_dns_objects.html +0 -21
- netbox_dns/templatetags/view_helpers.py +0 -15
- netbox_dns/validators.py +0 -57
- netbox_dns/views/contact.py +0 -83
- netbox_plugin_dns-0.21.4.dist-info/METADATA +0 -101
- netbox_plugin_dns-0.21.4.dist-info/RECORD +0 -110
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
from django import forms
|
|
2
|
+
from django.utils.translation import gettext_lazy as _
|
|
3
|
+
from django.contrib.postgres.forms import SimpleArrayField
|
|
4
|
+
|
|
5
|
+
from netbox.forms import (
|
|
6
|
+
NetBoxModelBulkEditForm,
|
|
7
|
+
NetBoxModelFilterSetForm,
|
|
8
|
+
NetBoxModelImportForm,
|
|
9
|
+
NetBoxModelForm,
|
|
10
|
+
)
|
|
11
|
+
from utilities.forms.fields import (
|
|
12
|
+
DynamicModelMultipleChoiceField,
|
|
13
|
+
TagFilterField,
|
|
14
|
+
CSVModelChoiceField,
|
|
15
|
+
CSVModelMultipleChoiceField,
|
|
16
|
+
DynamicModelChoiceField,
|
|
17
|
+
)
|
|
18
|
+
from utilities.forms.rendering import FieldSet
|
|
19
|
+
from tenancy.models import Tenant, TenantGroup
|
|
20
|
+
from tenancy.forms import TenancyForm, TenancyFilterForm
|
|
21
|
+
|
|
22
|
+
from netbox_dns.models import (
|
|
23
|
+
ZoneTemplate,
|
|
24
|
+
RecordTemplate,
|
|
25
|
+
NameServer,
|
|
26
|
+
Registrar,
|
|
27
|
+
RegistrationContact,
|
|
28
|
+
DNSSECPolicy,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
__all__ = (
|
|
33
|
+
"ZoneTemplateForm",
|
|
34
|
+
"ZoneTemplateFilterForm",
|
|
35
|
+
"ZoneTemplateImportForm",
|
|
36
|
+
"ZoneTemplateBulkEditForm",
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class ZoneTemplateForm(TenancyForm, NetBoxModelForm):
|
|
41
|
+
class Meta:
|
|
42
|
+
model = ZoneTemplate
|
|
43
|
+
|
|
44
|
+
fields = (
|
|
45
|
+
"name",
|
|
46
|
+
"nameservers",
|
|
47
|
+
"soa_mname",
|
|
48
|
+
"soa_rname",
|
|
49
|
+
"dnssec_policy",
|
|
50
|
+
"parental_agents",
|
|
51
|
+
"record_templates",
|
|
52
|
+
"description",
|
|
53
|
+
"registrar",
|
|
54
|
+
"registrant",
|
|
55
|
+
"admin_c",
|
|
56
|
+
"tech_c",
|
|
57
|
+
"billing_c",
|
|
58
|
+
"tenant_group",
|
|
59
|
+
"tenant",
|
|
60
|
+
"tags",
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
labels = {
|
|
64
|
+
"soa_rname": _("RName"),
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
fieldsets = (
|
|
68
|
+
FieldSet(
|
|
69
|
+
"name",
|
|
70
|
+
"description",
|
|
71
|
+
"nameservers",
|
|
72
|
+
name=_("Zone Template"),
|
|
73
|
+
),
|
|
74
|
+
FieldSet(
|
|
75
|
+
"soa_mname",
|
|
76
|
+
"soa_rname",
|
|
77
|
+
name=_("SOA"),
|
|
78
|
+
),
|
|
79
|
+
FieldSet(
|
|
80
|
+
"record_templates",
|
|
81
|
+
name=_("Record Templates"),
|
|
82
|
+
),
|
|
83
|
+
FieldSet(
|
|
84
|
+
"dnssec_policy",
|
|
85
|
+
"parental_agents",
|
|
86
|
+
name=_("DNSSEC"),
|
|
87
|
+
),
|
|
88
|
+
FieldSet(
|
|
89
|
+
"registrar",
|
|
90
|
+
"registrant",
|
|
91
|
+
"admin_c",
|
|
92
|
+
"tech_c",
|
|
93
|
+
"billing_c",
|
|
94
|
+
name=_("Domain Registration"),
|
|
95
|
+
),
|
|
96
|
+
FieldSet(
|
|
97
|
+
"tenant_group",
|
|
98
|
+
"tenant",
|
|
99
|
+
name=_("Tenancy"),
|
|
100
|
+
),
|
|
101
|
+
FieldSet(
|
|
102
|
+
"tags",
|
|
103
|
+
name=_("Tags"),
|
|
104
|
+
),
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
nameservers = DynamicModelMultipleChoiceField(
|
|
108
|
+
queryset=NameServer.objects.all(),
|
|
109
|
+
required=False,
|
|
110
|
+
quick_add=True,
|
|
111
|
+
)
|
|
112
|
+
soa_mname = DynamicModelChoiceField(
|
|
113
|
+
queryset=NameServer.objects.all(),
|
|
114
|
+
required=False,
|
|
115
|
+
label=_("MName"),
|
|
116
|
+
quick_add=True,
|
|
117
|
+
)
|
|
118
|
+
record_templates = DynamicModelMultipleChoiceField(
|
|
119
|
+
queryset=RecordTemplate.objects.all(),
|
|
120
|
+
required=False,
|
|
121
|
+
quick_add=True,
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
class ZoneTemplateFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
126
|
+
model = ZoneTemplate
|
|
127
|
+
|
|
128
|
+
fieldsets = (
|
|
129
|
+
FieldSet(
|
|
130
|
+
"q",
|
|
131
|
+
"filter_id",
|
|
132
|
+
"tag",
|
|
133
|
+
),
|
|
134
|
+
FieldSet(
|
|
135
|
+
"name",
|
|
136
|
+
"nameserver_id",
|
|
137
|
+
"description",
|
|
138
|
+
name=_("Attributes"),
|
|
139
|
+
),
|
|
140
|
+
FieldSet(
|
|
141
|
+
"soa_mname_id",
|
|
142
|
+
"soa_rname",
|
|
143
|
+
name=_("SOA"),
|
|
144
|
+
),
|
|
145
|
+
FieldSet(
|
|
146
|
+
"record_template_id",
|
|
147
|
+
name=_("Record Templates"),
|
|
148
|
+
),
|
|
149
|
+
FieldSet(
|
|
150
|
+
"dnssec_policy",
|
|
151
|
+
"parental_agents",
|
|
152
|
+
name=_("DNSSEC"),
|
|
153
|
+
),
|
|
154
|
+
FieldSet(
|
|
155
|
+
"registrar_id",
|
|
156
|
+
"registrant_id",
|
|
157
|
+
"admin_c_id",
|
|
158
|
+
"tech_c_id",
|
|
159
|
+
"billing_c_id",
|
|
160
|
+
name=_("Registration"),
|
|
161
|
+
),
|
|
162
|
+
FieldSet(
|
|
163
|
+
"tenant_group_id",
|
|
164
|
+
"tenant_id",
|
|
165
|
+
name=_("Tenancy"),
|
|
166
|
+
),
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
name = forms.CharField(
|
|
170
|
+
required=False,
|
|
171
|
+
label=_("Template Name"),
|
|
172
|
+
)
|
|
173
|
+
nameserver_id = DynamicModelMultipleChoiceField(
|
|
174
|
+
queryset=NameServer.objects.all(),
|
|
175
|
+
required=False,
|
|
176
|
+
null_option=_("None"),
|
|
177
|
+
label=_("Nameservers"),
|
|
178
|
+
)
|
|
179
|
+
soa_mname_id = DynamicModelMultipleChoiceField(
|
|
180
|
+
queryset=NameServer.objects.all(),
|
|
181
|
+
required=False,
|
|
182
|
+
null_option=_("None"),
|
|
183
|
+
label=_("MName"),
|
|
184
|
+
)
|
|
185
|
+
soa_rname = forms.CharField(
|
|
186
|
+
required=False,
|
|
187
|
+
label=_("RName"),
|
|
188
|
+
)
|
|
189
|
+
record_template_id = DynamicModelMultipleChoiceField(
|
|
190
|
+
queryset=RecordTemplate.objects.all(),
|
|
191
|
+
required=False,
|
|
192
|
+
null_option=_("None"),
|
|
193
|
+
label=_("Record Templates"),
|
|
194
|
+
)
|
|
195
|
+
description = forms.CharField(
|
|
196
|
+
required=False,
|
|
197
|
+
)
|
|
198
|
+
dnssec_policy_id = DynamicModelMultipleChoiceField(
|
|
199
|
+
queryset=DNSSECPolicy.objects.all(),
|
|
200
|
+
required=False,
|
|
201
|
+
null_option=_("None"),
|
|
202
|
+
label=_("DNSSEC Policy ID"),
|
|
203
|
+
)
|
|
204
|
+
parental_agents = forms.GenericIPAddressField(
|
|
205
|
+
required=False,
|
|
206
|
+
label=_("Parental Agents"),
|
|
207
|
+
)
|
|
208
|
+
registrar_id = DynamicModelMultipleChoiceField(
|
|
209
|
+
queryset=Registrar.objects.all(),
|
|
210
|
+
required=False,
|
|
211
|
+
null_option=_("None"),
|
|
212
|
+
label=_("Registrar"),
|
|
213
|
+
)
|
|
214
|
+
registrant_id = DynamicModelMultipleChoiceField(
|
|
215
|
+
queryset=RegistrationContact.objects.all(),
|
|
216
|
+
required=False,
|
|
217
|
+
null_option=_("None"),
|
|
218
|
+
label=_("Registrant"),
|
|
219
|
+
)
|
|
220
|
+
admin_c_id = DynamicModelMultipleChoiceField(
|
|
221
|
+
queryset=RegistrationContact.objects.all(),
|
|
222
|
+
required=False,
|
|
223
|
+
null_option=_("None"),
|
|
224
|
+
label=_("Administrative Contact"),
|
|
225
|
+
)
|
|
226
|
+
tech_c_id = DynamicModelMultipleChoiceField(
|
|
227
|
+
queryset=RegistrationContact.objects.all(),
|
|
228
|
+
required=False,
|
|
229
|
+
null_option=_("None"),
|
|
230
|
+
label=_("Technical Contact"),
|
|
231
|
+
)
|
|
232
|
+
billing_c_id = DynamicModelMultipleChoiceField(
|
|
233
|
+
queryset=RegistrationContact.objects.all(),
|
|
234
|
+
required=False,
|
|
235
|
+
null_option=_("None"),
|
|
236
|
+
label=_("Billing Contact"),
|
|
237
|
+
)
|
|
238
|
+
tag = TagFilterField(ZoneTemplate)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
class ZoneTemplateImportForm(NetBoxModelImportForm):
|
|
242
|
+
class Meta:
|
|
243
|
+
model = ZoneTemplate
|
|
244
|
+
|
|
245
|
+
fields = (
|
|
246
|
+
"name",
|
|
247
|
+
"nameservers",
|
|
248
|
+
"soa_mname",
|
|
249
|
+
"soa_rname",
|
|
250
|
+
"record_templates",
|
|
251
|
+
"dnssec_policy",
|
|
252
|
+
"parental_agents",
|
|
253
|
+
"description",
|
|
254
|
+
"registrar",
|
|
255
|
+
"registrant",
|
|
256
|
+
"admin_c",
|
|
257
|
+
"tech_c",
|
|
258
|
+
"billing_c",
|
|
259
|
+
"tenant",
|
|
260
|
+
"tags",
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
nameservers = CSVModelMultipleChoiceField(
|
|
264
|
+
queryset=NameServer.objects.all(),
|
|
265
|
+
to_field_name="name",
|
|
266
|
+
required=False,
|
|
267
|
+
label=_("Nameservers"),
|
|
268
|
+
)
|
|
269
|
+
soa_mname = CSVModelChoiceField(
|
|
270
|
+
queryset=NameServer.objects.all(),
|
|
271
|
+
to_field_name="name",
|
|
272
|
+
required=False,
|
|
273
|
+
label=_("SOA MName"),
|
|
274
|
+
)
|
|
275
|
+
record_templates = CSVModelMultipleChoiceField(
|
|
276
|
+
queryset=RecordTemplate.objects.all(),
|
|
277
|
+
to_field_name="name",
|
|
278
|
+
required=False,
|
|
279
|
+
label=_("Record Templates"),
|
|
280
|
+
)
|
|
281
|
+
dnssec_policy = CSVModelChoiceField(
|
|
282
|
+
queryset=DNSSECPolicy.objects.all(),
|
|
283
|
+
required=False,
|
|
284
|
+
to_field_name="name",
|
|
285
|
+
error_messages={
|
|
286
|
+
"invalid_choice": _("DNSSEC policy %(value)s not found"),
|
|
287
|
+
},
|
|
288
|
+
label=_("DNSSEC Policy"),
|
|
289
|
+
)
|
|
290
|
+
registrar = CSVModelChoiceField(
|
|
291
|
+
queryset=Registrar.objects.all(),
|
|
292
|
+
required=False,
|
|
293
|
+
to_field_name="name",
|
|
294
|
+
error_messages={
|
|
295
|
+
"invalid_choice": _("Registrar %(value)s not found"),
|
|
296
|
+
},
|
|
297
|
+
label=_("Registrar"),
|
|
298
|
+
)
|
|
299
|
+
registrant = CSVModelChoiceField(
|
|
300
|
+
queryset=RegistrationContact.objects.all(),
|
|
301
|
+
required=False,
|
|
302
|
+
to_field_name="contact_id",
|
|
303
|
+
error_messages={
|
|
304
|
+
"invalid_choice": _("Registrant contact ID %(value)s not found"),
|
|
305
|
+
},
|
|
306
|
+
label=_("Registrant"),
|
|
307
|
+
)
|
|
308
|
+
admin_c = CSVModelChoiceField(
|
|
309
|
+
queryset=RegistrationContact.objects.all(),
|
|
310
|
+
required=False,
|
|
311
|
+
to_field_name="contact_id",
|
|
312
|
+
error_messages={
|
|
313
|
+
"invalid_choice": _("Administrative contact ID %(value)s not found"),
|
|
314
|
+
},
|
|
315
|
+
label=_("Administrative Contact"),
|
|
316
|
+
)
|
|
317
|
+
tech_c = CSVModelChoiceField(
|
|
318
|
+
queryset=RegistrationContact.objects.all(),
|
|
319
|
+
required=False,
|
|
320
|
+
to_field_name="contact_id",
|
|
321
|
+
error_messages={
|
|
322
|
+
"invalid_choice": _("Technical contact ID %(value)s not found"),
|
|
323
|
+
},
|
|
324
|
+
label=_("Technical Contact"),
|
|
325
|
+
)
|
|
326
|
+
billing_c = CSVModelChoiceField(
|
|
327
|
+
queryset=RegistrationContact.objects.all(),
|
|
328
|
+
required=False,
|
|
329
|
+
to_field_name="contact_id",
|
|
330
|
+
error_messages={
|
|
331
|
+
"invalid_choice": _("Billing contact ID %(value)s not found"),
|
|
332
|
+
},
|
|
333
|
+
label=_("Billing Contact"),
|
|
334
|
+
)
|
|
335
|
+
tenant = CSVModelChoiceField(
|
|
336
|
+
queryset=Tenant.objects.all(),
|
|
337
|
+
required=False,
|
|
338
|
+
to_field_name="name",
|
|
339
|
+
label=_("Tenant"),
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
class ZoneTemplateBulkEditForm(NetBoxModelBulkEditForm):
|
|
344
|
+
model = ZoneTemplate
|
|
345
|
+
|
|
346
|
+
fieldsets = (
|
|
347
|
+
FieldSet(
|
|
348
|
+
"nameservers",
|
|
349
|
+
"description",
|
|
350
|
+
name=_("Attributes"),
|
|
351
|
+
),
|
|
352
|
+
FieldSet(
|
|
353
|
+
"soa_mname",
|
|
354
|
+
"soa_rname",
|
|
355
|
+
name=_("SOA"),
|
|
356
|
+
),
|
|
357
|
+
FieldSet(
|
|
358
|
+
"record_templates",
|
|
359
|
+
name=_("Record Templates"),
|
|
360
|
+
),
|
|
361
|
+
FieldSet(
|
|
362
|
+
"dnssec_policy",
|
|
363
|
+
"parental_agents",
|
|
364
|
+
name=_("DNSSEC"),
|
|
365
|
+
),
|
|
366
|
+
FieldSet(
|
|
367
|
+
"registrar",
|
|
368
|
+
"registrant",
|
|
369
|
+
"admin_c",
|
|
370
|
+
"tech_c",
|
|
371
|
+
"billing_c",
|
|
372
|
+
name=_("Domain Registration"),
|
|
373
|
+
),
|
|
374
|
+
FieldSet(
|
|
375
|
+
"tenant_group",
|
|
376
|
+
"tenant",
|
|
377
|
+
name=_("Tenancy"),
|
|
378
|
+
),
|
|
379
|
+
)
|
|
380
|
+
|
|
381
|
+
nullable_fields = (
|
|
382
|
+
"description",
|
|
383
|
+
"nameservers",
|
|
384
|
+
"soa_mname",
|
|
385
|
+
"soa_rname",
|
|
386
|
+
"record_templates",
|
|
387
|
+
"dnssec_policy",
|
|
388
|
+
"registrar",
|
|
389
|
+
"registrant",
|
|
390
|
+
"admin_c",
|
|
391
|
+
"tech_c",
|
|
392
|
+
"billing_c",
|
|
393
|
+
"tenant",
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
nameservers = DynamicModelMultipleChoiceField(
|
|
397
|
+
queryset=NameServer.objects.all(),
|
|
398
|
+
required=False,
|
|
399
|
+
label=_("Nameservers"),
|
|
400
|
+
)
|
|
401
|
+
soa_mname = DynamicModelChoiceField(
|
|
402
|
+
queryset=NameServer.objects.all(),
|
|
403
|
+
required=False,
|
|
404
|
+
label=_("MName"),
|
|
405
|
+
)
|
|
406
|
+
soa_rname = forms.CharField(
|
|
407
|
+
max_length=255,
|
|
408
|
+
required=False,
|
|
409
|
+
label=_("RName"),
|
|
410
|
+
)
|
|
411
|
+
record_templates = DynamicModelMultipleChoiceField(
|
|
412
|
+
queryset=RecordTemplate.objects.all(),
|
|
413
|
+
required=False,
|
|
414
|
+
label=_("Record Templates"),
|
|
415
|
+
)
|
|
416
|
+
description = forms.CharField(
|
|
417
|
+
max_length=200, required=False, label=_("Description")
|
|
418
|
+
)
|
|
419
|
+
dnssec_policy = DynamicModelChoiceField(
|
|
420
|
+
queryset=DNSSECPolicy.objects.all(),
|
|
421
|
+
required=False,
|
|
422
|
+
label=_("DNSSEC Policy"),
|
|
423
|
+
)
|
|
424
|
+
parental_agents = SimpleArrayField(
|
|
425
|
+
required=False,
|
|
426
|
+
base_field=forms.GenericIPAddressField(),
|
|
427
|
+
label=_("Parental Agents"),
|
|
428
|
+
)
|
|
429
|
+
registrar = DynamicModelChoiceField(
|
|
430
|
+
queryset=Registrar.objects.all(),
|
|
431
|
+
required=False,
|
|
432
|
+
label=_("Registrar"),
|
|
433
|
+
)
|
|
434
|
+
registrant = DynamicModelChoiceField(
|
|
435
|
+
queryset=RegistrationContact.objects.all(),
|
|
436
|
+
required=False,
|
|
437
|
+
label=_("Registrant"),
|
|
438
|
+
)
|
|
439
|
+
admin_c = DynamicModelChoiceField(
|
|
440
|
+
queryset=RegistrationContact.objects.all(),
|
|
441
|
+
required=False,
|
|
442
|
+
label=_("Administrative Contact"),
|
|
443
|
+
)
|
|
444
|
+
tech_c = DynamicModelChoiceField(
|
|
445
|
+
queryset=RegistrationContact.objects.all(),
|
|
446
|
+
required=False,
|
|
447
|
+
label=_("Technical Contact"),
|
|
448
|
+
)
|
|
449
|
+
billing_c = DynamicModelChoiceField(
|
|
450
|
+
queryset=RegistrationContact.objects.all(),
|
|
451
|
+
required=False,
|
|
452
|
+
label=_("Billing Contact"),
|
|
453
|
+
)
|
|
454
|
+
tenant_group = DynamicModelChoiceField(
|
|
455
|
+
queryset=TenantGroup.objects.all(),
|
|
456
|
+
required=False,
|
|
457
|
+
label=_("Tenant Group"),
|
|
458
|
+
)
|
|
459
|
+
tenant = DynamicModelChoiceField(
|
|
460
|
+
queryset=Tenant.objects.all(),
|
|
461
|
+
required=False,
|
|
462
|
+
label=_("Tenant"),
|
|
463
|
+
)
|
netbox_dns/graphql/__init__.py
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
from .schema import (
|
|
2
|
+
NetBoxDNSNameServerQuery,
|
|
3
|
+
NetBoxDNSViewQuery,
|
|
4
|
+
NetBoxDNSZoneQuery,
|
|
5
|
+
NetBoxDNSRecordQuery,
|
|
6
|
+
NetBoxDNSDNSSECKeyTemplateQuery,
|
|
7
|
+
NetBoxDNSDNSSECPolicyQuery,
|
|
8
|
+
NetBoxDNSRegistrationContactQuery,
|
|
9
|
+
NetBoxDNSRegistrarQuery,
|
|
10
|
+
NetBoxDNSZoneTemplateQuery,
|
|
11
|
+
NetBoxDNSRecordTemplateQuery,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
schema = [
|
|
15
|
+
NetBoxDNSNameServerQuery,
|
|
16
|
+
NetBoxDNSViewQuery,
|
|
17
|
+
NetBoxDNSZoneQuery,
|
|
18
|
+
NetBoxDNSRecordQuery,
|
|
19
|
+
NetBoxDNSDNSSECKeyTemplateQuery,
|
|
20
|
+
NetBoxDNSDNSSECPolicyQuery,
|
|
21
|
+
NetBoxDNSRegistrationContactQuery,
|
|
22
|
+
NetBoxDNSRegistrarQuery,
|
|
23
|
+
NetBoxDNSZoneTemplateQuery,
|
|
24
|
+
NetBoxDNSRecordTemplateQuery,
|
|
25
|
+
]
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import strawberry
|
|
2
|
+
|
|
3
|
+
from netbox_dns.choices import (
|
|
4
|
+
RecordTypeChoices,
|
|
5
|
+
RecordClassChoices,
|
|
6
|
+
RecordStatusChoices,
|
|
7
|
+
ZoneStatusChoices,
|
|
8
|
+
DNSSECPolicyDigestChoices,
|
|
9
|
+
DNSSECPolicyStatusChoices,
|
|
10
|
+
DNSSECKeyTemplateTypeChoices,
|
|
11
|
+
DNSSECKeyTemplateAlgorithmChoices,
|
|
12
|
+
DNSSECKeyTemplateKeySizeChoices,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
__all__ = (
|
|
16
|
+
"NetBoxDNSRecordTypeEnum",
|
|
17
|
+
"NetBoxDNSRecordClassEnum",
|
|
18
|
+
"NetBoxDNSRecordStatusEnum",
|
|
19
|
+
"NetBoxDNSZoneStatusEnum",
|
|
20
|
+
"NetBoxDNSDNSSECPolicyDigestEnum",
|
|
21
|
+
"NetBoxDNSDNSSECPolicyStatusEnum",
|
|
22
|
+
"NetBoxDNSDNSSECKeyTemplateTypeEnum",
|
|
23
|
+
"NetBoxDNSDNSSECKeyTemplateAlgorithmEnum",
|
|
24
|
+
"NetBoxDNSDNSSECKeyTemplateKeySizeEnum",
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
NetBoxDNSRecordTypeEnum = strawberry.enum(RecordTypeChoices.as_enum())
|
|
28
|
+
NetBoxDNSRecordClassEnum = strawberry.enum(RecordClassChoices.as_enum())
|
|
29
|
+
NetBoxDNSRecordStatusEnum = strawberry.enum(RecordStatusChoices.as_enum())
|
|
30
|
+
NetBoxDNSZoneStatusEnum = strawberry.enum(ZoneStatusChoices.as_enum())
|
|
31
|
+
NetBoxDNSDNSSECPolicyDigestEnum = strawberry.enum(DNSSECPolicyDigestChoices.as_enum())
|
|
32
|
+
NetBoxDNSDNSSECPolicyStatusEnum = strawberry.enum(DNSSECPolicyStatusChoices.as_enum())
|
|
33
|
+
NetBoxDNSDNSSECKeyTemplateTypeEnum = strawberry.enum(
|
|
34
|
+
DNSSECKeyTemplateTypeChoices.as_enum()
|
|
35
|
+
)
|
|
36
|
+
NetBoxDNSDNSSECKeyTemplateAlgorithmEnum = strawberry.enum(
|
|
37
|
+
DNSSECKeyTemplateAlgorithmChoices.as_enum()
|
|
38
|
+
)
|
|
39
|
+
NetBoxDNSDNSSECKeyTemplateKeySizeEnum = strawberry.enum(
|
|
40
|
+
DNSSECKeyTemplateKeySizeChoices.as_enum()
|
|
41
|
+
)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import strawberry
|
|
2
|
+
|
|
3
|
+
from netbox.graphql.filter_lookups import ArrayLookup
|
|
4
|
+
|
|
5
|
+
from netbox_dns.graphql.enums import NetBoxDNSDNSSECPolicyDigestEnum
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@strawberry.input(
|
|
9
|
+
one_of=True,
|
|
10
|
+
description="Lookup for Array fields. Only one of the lookup fields can be set.",
|
|
11
|
+
)
|
|
12
|
+
class PolicyDigestArrayLookup(ArrayLookup[NetBoxDNSDNSSECPolicyDigestEnum]):
|
|
13
|
+
pass
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from .view import *
|
|
2
|
+
from .zone import *
|
|
3
|
+
from .nameserver import *
|
|
4
|
+
from .record import *
|
|
5
|
+
from .registration_contact import *
|
|
6
|
+
from .registrar import *
|
|
7
|
+
|
|
8
|
+
from .zone_template import *
|
|
9
|
+
from .record_template import *
|
|
10
|
+
|
|
11
|
+
from .dnssec_key_template import *
|
|
12
|
+
from .dnssec_policy import *
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
from typing import Annotated, TYPE_CHECKING
|
|
2
|
+
|
|
3
|
+
import strawberry
|
|
4
|
+
import strawberry_django
|
|
5
|
+
from strawberry.scalars import ID
|
|
6
|
+
from strawberry_django import FilterLookup
|
|
7
|
+
|
|
8
|
+
from netbox.graphql.filter_mixins import NetBoxModelFilterMixin
|
|
9
|
+
from tenancy.graphql.filter_mixins import ContactFilterMixin, TenancyFilterMixin
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from netbox.graphql.filter_lookups import IntegerLookup
|
|
13
|
+
from .enums import (
|
|
14
|
+
NetBoxDNSDNSSECKeyTemplateTypeEnum,
|
|
15
|
+
NetBoxDNSDNSSECKeyTemplateAlgorithmEnum,
|
|
16
|
+
NetBoxDNSDNSSECKeyTemplateKeySizeEnum,
|
|
17
|
+
)
|
|
18
|
+
from .dnssec_policy import NetBoxDNSDNSSECPolicyFilter
|
|
19
|
+
|
|
20
|
+
from netbox_dns.models import DNSSECKeyTemplate
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
__all__ = ("NetBoxDNSDNSSECKeyTemplateFilter",)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@strawberry_django.filter_type(DNSSECKeyTemplate, lookups=True)
|
|
27
|
+
class NetBoxDNSDNSSECKeyTemplateFilter(
|
|
28
|
+
ContactFilterMixin, TenancyFilterMixin, NetBoxModelFilterMixin
|
|
29
|
+
):
|
|
30
|
+
name: FilterLookup[str] | None = strawberry_django.filter_field()
|
|
31
|
+
description: FilterLookup[str] | None = strawberry_django.filter_field()
|
|
32
|
+
type: (
|
|
33
|
+
Annotated[
|
|
34
|
+
"NetBoxDNSDNSSECKeyTemplateTypeEnum",
|
|
35
|
+
strawberry.lazy("netbox_dns.graphql.enums"),
|
|
36
|
+
]
|
|
37
|
+
| None
|
|
38
|
+
) = strawberry_django.filter_field()
|
|
39
|
+
algorithm: (
|
|
40
|
+
Annotated[
|
|
41
|
+
"NetBoxDNSDNSSECKeyTemplateAlgorithmEnum",
|
|
42
|
+
strawberry.lazy("netbox_dns.graphql.enums"),
|
|
43
|
+
]
|
|
44
|
+
| None
|
|
45
|
+
) = strawberry_django.filter_field()
|
|
46
|
+
lifetime: (
|
|
47
|
+
Annotated["IntegerLookup", strawberry.lazy("netbox.graphql.filter_lookups")]
|
|
48
|
+
| None
|
|
49
|
+
) = strawberry_django.filter_field()
|
|
50
|
+
key_size: (
|
|
51
|
+
Annotated[
|
|
52
|
+
"NetBoxDNSDNSSECKeyTemplateKeySizeEnum",
|
|
53
|
+
strawberry.lazy("netbox_dns.graphql.enums"),
|
|
54
|
+
]
|
|
55
|
+
| None
|
|
56
|
+
) = strawberry_django.filter_field()
|
|
57
|
+
policy: (
|
|
58
|
+
Annotated[
|
|
59
|
+
"NetBoxDNSDNSSECPolicyFilter", strawberry.lazy("netbox_dns.graphql.filters")
|
|
60
|
+
]
|
|
61
|
+
| None
|
|
62
|
+
) = strawberry_django.filter_field()
|
|
63
|
+
policy_id: ID | None = strawberry_django.filter_field()
|