netbox-plugin-dns 1.1.0b7__py3-none-any.whl → 1.1.1__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 +1 -1
- netbox_dns/api/nested_serializers.py +17 -16
- netbox_dns/api/serializers.py +1 -1
- netbox_dns/api/serializers_/record.py +1 -0
- netbox_dns/api/serializers_/{contact.py → registration_contact.py} +5 -5
- netbox_dns/api/serializers_/zone.py +5 -5
- netbox_dns/api/serializers_/zone_template.py +5 -5
- netbox_dns/api/urls.py +2 -2
- netbox_dns/api/views.py +7 -35
- netbox_dns/filtersets/__init__.py +1 -1
- netbox_dns/filtersets/nameserver.py +0 -0
- netbox_dns/filtersets/record.py +0 -0
- netbox_dns/filtersets/record_template.py +0 -0
- netbox_dns/filtersets/{contact.py → registration_contact.py} +4 -4
- netbox_dns/filtersets/zone.py +15 -15
- netbox_dns/filtersets/zone_template.py +15 -15
- netbox_dns/forms/__init__.py +1 -1
- netbox_dns/forms/nameserver.py +0 -0
- netbox_dns/forms/record.py +0 -0
- netbox_dns/forms/record_template.py +0 -0
- netbox_dns/forms/{contact.py → registration_contact.py} +16 -16
- netbox_dns/forms/zone.py +13 -13
- netbox_dns/forms/zone_template.py +13 -13
- netbox_dns/graphql/__init__.py +2 -2
- netbox_dns/graphql/filters.py +5 -5
- netbox_dns/graphql/schema.py +24 -44
- netbox_dns/graphql/types.py +38 -12
- netbox_dns/migrations/0007_alter_ordering_options.py +25 -0
- netbox_dns/migrations/{0007_view_prefixes.py → 0008_view_prefixes.py} +1 -1
- netbox_dns/migrations/0009_rename_contact_registrationcontact.py +36 -0
- netbox_dns/models/__init__.py +1 -1
- netbox_dns/models/nameserver.py +8 -3
- netbox_dns/models/record.py +15 -4
- netbox_dns/models/record_template.py +4 -1
- netbox_dns/models/registrar.py +7 -1
- netbox_dns/models/{contact.py → registration_contact.py} +15 -9
- netbox_dns/models/view.py +9 -2
- netbox_dns/models/zone.py +13 -12
- netbox_dns/models/zone_template.py +12 -9
- netbox_dns/navigation.py +7 -7
- netbox_dns/tables/__init__.py +1 -1
- netbox_dns/tables/nameserver.py +1 -7
- netbox_dns/tables/record.py +10 -35
- netbox_dns/tables/record_template.py +0 -17
- netbox_dns/tables/registrar.py +0 -2
- netbox_dns/tables/{contact.py → registration_contact.py} +5 -6
- netbox_dns/tables/view.py +1 -8
- netbox_dns/tables/zone.py +0 -15
- netbox_dns/tables/zone_template.py +2 -16
- netbox_dns/templates/netbox_dns/{contact.html → registrationcontact.html} +1 -1
- netbox_dns/urls/__init__.py +2 -2
- netbox_dns/urls/nameserver.py +14 -38
- netbox_dns/urls/record.py +7 -19
- netbox_dns/urls/record_template.py +18 -27
- netbox_dns/urls/registrar.py +11 -35
- netbox_dns/urls/registration_contact.py +60 -0
- netbox_dns/urls/view.py +8 -22
- netbox_dns/urls/zone.py +8 -46
- netbox_dns/urls/zone_template.py +16 -26
- netbox_dns/utilities/ipam_dnssync.py +1 -1
- netbox_dns/views/__init__.py +1 -1
- netbox_dns/views/nameserver.py +7 -3
- netbox_dns/views/record.py +12 -3
- netbox_dns/views/record_template.py +1 -1
- netbox_dns/views/registrar.py +0 -1
- netbox_dns/views/registration_contact.py +94 -0
- netbox_dns/views/view.py +6 -1
- netbox_dns/views/zone.py +7 -6
- netbox_dns/views/zone_template.py +2 -2
- {netbox_plugin_dns-1.1.0b7.dist-info → netbox_plugin_dns-1.1.1.dist-info}/METADATA +14 -14
- {netbox_plugin_dns-1.1.0b7.dist-info → netbox_plugin_dns-1.1.1.dist-info}/RECORD +75 -72
- {netbox_plugin_dns-1.1.0b7.dist-info → netbox_plugin_dns-1.1.1.dist-info}/WHEEL +2 -1
- netbox_plugin_dns-1.1.1.dist-info/top_level.txt +1 -0
- netbox_dns/urls/contact.py +0 -51
- netbox_dns/views/contact.py +0 -95
- {netbox_plugin_dns-1.1.0b7.dist-info → netbox_plugin_dns-1.1.1.dist-info}/LICENSE +0 -0
netbox_dns/forms/zone.py
CHANGED
|
@@ -30,7 +30,7 @@ from netbox_dns.models import (
|
|
|
30
30
|
Zone,
|
|
31
31
|
NameServer,
|
|
32
32
|
Registrar,
|
|
33
|
-
|
|
33
|
+
RegistrationContact,
|
|
34
34
|
ZoneTemplate,
|
|
35
35
|
)
|
|
36
36
|
from netbox_dns.choices import ZoneStatusChoices
|
|
@@ -421,22 +421,22 @@ class ZoneFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
421
421
|
label="Registry Domain ID",
|
|
422
422
|
)
|
|
423
423
|
registrant_id = DynamicModelMultipleChoiceField(
|
|
424
|
-
queryset=
|
|
424
|
+
queryset=RegistrationContact.objects.all(),
|
|
425
425
|
required=False,
|
|
426
426
|
label="Registrant",
|
|
427
427
|
)
|
|
428
428
|
admin_c_id = DynamicModelMultipleChoiceField(
|
|
429
|
-
queryset=
|
|
429
|
+
queryset=RegistrationContact.objects.all(),
|
|
430
430
|
required=False,
|
|
431
431
|
label="Admin-C",
|
|
432
432
|
)
|
|
433
433
|
tech_c_id = DynamicModelMultipleChoiceField(
|
|
434
|
-
queryset=
|
|
434
|
+
queryset=RegistrationContact.objects.all(),
|
|
435
435
|
required=False,
|
|
436
436
|
label="Tech-C",
|
|
437
437
|
)
|
|
438
438
|
billing_c_id = DynamicModelMultipleChoiceField(
|
|
439
|
-
queryset=
|
|
439
|
+
queryset=RegistrationContact.objects.all(),
|
|
440
440
|
required=False,
|
|
441
441
|
label="Billing-C",
|
|
442
442
|
)
|
|
@@ -532,7 +532,7 @@ class ZoneImportForm(ZoneTemplateUpdateMixin, NetBoxModelImportForm):
|
|
|
532
532
|
help_text="Domain ID assigned by the registry",
|
|
533
533
|
)
|
|
534
534
|
registrant = CSVModelChoiceField(
|
|
535
|
-
queryset=
|
|
535
|
+
queryset=RegistrationContact.objects.all(),
|
|
536
536
|
required=False,
|
|
537
537
|
to_field_name="contact_id",
|
|
538
538
|
help_text="Owner of the domain",
|
|
@@ -541,7 +541,7 @@ class ZoneImportForm(ZoneTemplateUpdateMixin, NetBoxModelImportForm):
|
|
|
541
541
|
},
|
|
542
542
|
)
|
|
543
543
|
admin_c = CSVModelChoiceField(
|
|
544
|
-
queryset=
|
|
544
|
+
queryset=RegistrationContact.objects.all(),
|
|
545
545
|
required=False,
|
|
546
546
|
to_field_name="contact_id",
|
|
547
547
|
help_text="Administrative contact for the domain",
|
|
@@ -550,7 +550,7 @@ class ZoneImportForm(ZoneTemplateUpdateMixin, NetBoxModelImportForm):
|
|
|
550
550
|
},
|
|
551
551
|
)
|
|
552
552
|
tech_c = CSVModelChoiceField(
|
|
553
|
-
queryset=
|
|
553
|
+
queryset=RegistrationContact.objects.all(),
|
|
554
554
|
required=False,
|
|
555
555
|
to_field_name="contact_id",
|
|
556
556
|
help_text="Technical contact for the domain",
|
|
@@ -559,7 +559,7 @@ class ZoneImportForm(ZoneTemplateUpdateMixin, NetBoxModelImportForm):
|
|
|
559
559
|
},
|
|
560
560
|
)
|
|
561
561
|
billing_c = CSVModelChoiceField(
|
|
562
|
-
queryset=
|
|
562
|
+
queryset=RegistrationContact.objects.all(),
|
|
563
563
|
required=False,
|
|
564
564
|
to_field_name="contact_id",
|
|
565
565
|
help_text="Billing contact for the domain",
|
|
@@ -719,21 +719,21 @@ class ZoneBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
719
719
|
label="Registry Domain ID",
|
|
720
720
|
)
|
|
721
721
|
registrant = DynamicModelChoiceField(
|
|
722
|
-
queryset=
|
|
722
|
+
queryset=RegistrationContact.objects.all(),
|
|
723
723
|
required=False,
|
|
724
724
|
)
|
|
725
725
|
admin_c = DynamicModelChoiceField(
|
|
726
|
-
queryset=
|
|
726
|
+
queryset=RegistrationContact.objects.all(),
|
|
727
727
|
required=False,
|
|
728
728
|
label="Administrative Contact",
|
|
729
729
|
)
|
|
730
730
|
tech_c = DynamicModelChoiceField(
|
|
731
|
-
queryset=
|
|
731
|
+
queryset=RegistrationContact.objects.all(),
|
|
732
732
|
required=False,
|
|
733
733
|
label="Technical Contact",
|
|
734
734
|
)
|
|
735
735
|
billing_c = DynamicModelChoiceField(
|
|
736
|
-
queryset=
|
|
736
|
+
queryset=RegistrationContact.objects.all(),
|
|
737
737
|
required=False,
|
|
738
738
|
label="Billing Contact",
|
|
739
739
|
)
|
|
@@ -22,7 +22,7 @@ from netbox_dns.models import (
|
|
|
22
22
|
RecordTemplate,
|
|
23
23
|
NameServer,
|
|
24
24
|
Registrar,
|
|
25
|
-
|
|
25
|
+
RegistrationContact,
|
|
26
26
|
)
|
|
27
27
|
|
|
28
28
|
|
|
@@ -117,22 +117,22 @@ class ZoneTemplateFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
117
117
|
label="Registrar",
|
|
118
118
|
)
|
|
119
119
|
registrant_id = DynamicModelMultipleChoiceField(
|
|
120
|
-
queryset=
|
|
120
|
+
queryset=RegistrationContact.objects.all(),
|
|
121
121
|
required=False,
|
|
122
122
|
label="Registrant",
|
|
123
123
|
)
|
|
124
124
|
admin_c_id = DynamicModelMultipleChoiceField(
|
|
125
|
-
queryset=
|
|
125
|
+
queryset=RegistrationContact.objects.all(),
|
|
126
126
|
required=False,
|
|
127
127
|
label="Admin-C",
|
|
128
128
|
)
|
|
129
129
|
tech_c_id = DynamicModelMultipleChoiceField(
|
|
130
|
-
queryset=
|
|
130
|
+
queryset=RegistrationContact.objects.all(),
|
|
131
131
|
required=False,
|
|
132
132
|
label="Tech-C",
|
|
133
133
|
)
|
|
134
134
|
billing_c_id = DynamicModelMultipleChoiceField(
|
|
135
|
-
queryset=
|
|
135
|
+
queryset=RegistrationContact.objects.all(),
|
|
136
136
|
required=False,
|
|
137
137
|
label="Billing-C",
|
|
138
138
|
)
|
|
@@ -162,7 +162,7 @@ class ZoneTemplateImportForm(NetBoxModelImportForm):
|
|
|
162
162
|
},
|
|
163
163
|
)
|
|
164
164
|
registrant = CSVModelChoiceField(
|
|
165
|
-
queryset=
|
|
165
|
+
queryset=RegistrationContact.objects.all(),
|
|
166
166
|
required=False,
|
|
167
167
|
to_field_name="contact_id",
|
|
168
168
|
help_text="Owner of the domain",
|
|
@@ -171,7 +171,7 @@ class ZoneTemplateImportForm(NetBoxModelImportForm):
|
|
|
171
171
|
},
|
|
172
172
|
)
|
|
173
173
|
admin_c = CSVModelChoiceField(
|
|
174
|
-
queryset=
|
|
174
|
+
queryset=RegistrationContact.objects.all(),
|
|
175
175
|
required=False,
|
|
176
176
|
to_field_name="contact_id",
|
|
177
177
|
help_text="Administrative contact for the domain",
|
|
@@ -180,7 +180,7 @@ class ZoneTemplateImportForm(NetBoxModelImportForm):
|
|
|
180
180
|
},
|
|
181
181
|
)
|
|
182
182
|
tech_c = CSVModelChoiceField(
|
|
183
|
-
queryset=
|
|
183
|
+
queryset=RegistrationContact.objects.all(),
|
|
184
184
|
required=False,
|
|
185
185
|
to_field_name="contact_id",
|
|
186
186
|
help_text="Technical contact for the domain",
|
|
@@ -189,7 +189,7 @@ class ZoneTemplateImportForm(NetBoxModelImportForm):
|
|
|
189
189
|
},
|
|
190
190
|
)
|
|
191
191
|
billing_c = CSVModelChoiceField(
|
|
192
|
-
queryset=
|
|
192
|
+
queryset=RegistrationContact.objects.all(),
|
|
193
193
|
required=False,
|
|
194
194
|
to_field_name="contact_id",
|
|
195
195
|
help_text="Billing contact for the domain",
|
|
@@ -237,21 +237,21 @@ class ZoneTemplateBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
237
237
|
required=False,
|
|
238
238
|
)
|
|
239
239
|
registrant = DynamicModelChoiceField(
|
|
240
|
-
queryset=
|
|
240
|
+
queryset=RegistrationContact.objects.all(),
|
|
241
241
|
required=False,
|
|
242
242
|
)
|
|
243
243
|
admin_c = DynamicModelChoiceField(
|
|
244
|
-
queryset=
|
|
244
|
+
queryset=RegistrationContact.objects.all(),
|
|
245
245
|
required=False,
|
|
246
246
|
label="Administrative Contact",
|
|
247
247
|
)
|
|
248
248
|
tech_c = DynamicModelChoiceField(
|
|
249
|
-
queryset=
|
|
249
|
+
queryset=RegistrationContact.objects.all(),
|
|
250
250
|
required=False,
|
|
251
251
|
label="Technical Contact",
|
|
252
252
|
)
|
|
253
253
|
billing_c = DynamicModelChoiceField(
|
|
254
|
-
queryset=
|
|
254
|
+
queryset=RegistrationContact.objects.all(),
|
|
255
255
|
required=False,
|
|
256
256
|
label="Billing Contact",
|
|
257
257
|
)
|
netbox_dns/graphql/__init__.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from .schema import (
|
|
2
2
|
NetBoxDNSViewQuery,
|
|
3
3
|
NetBoxDNSNameServerQuery,
|
|
4
|
-
|
|
4
|
+
NetBoxDNSRegistrationContactQuery,
|
|
5
5
|
NetBoxDNSRegistrarQuery,
|
|
6
6
|
NetBoxDNSZoneQuery,
|
|
7
7
|
NetBoxDNSRecordQuery,
|
|
@@ -14,7 +14,7 @@ schema = [
|
|
|
14
14
|
NetBoxDNSViewQuery,
|
|
15
15
|
NetBoxDNSZoneQuery,
|
|
16
16
|
NetBoxDNSRecordQuery,
|
|
17
|
-
|
|
17
|
+
NetBoxDNSRegistrationContactQuery,
|
|
18
18
|
NetBoxDNSRegistrarQuery,
|
|
19
19
|
NetBoxDNSZoneTemplateQuery,
|
|
20
20
|
NetBoxDNSRecordTemplateQuery,
|
netbox_dns/graphql/filters.py
CHANGED
|
@@ -7,7 +7,7 @@ from netbox_dns.models import (
|
|
|
7
7
|
View,
|
|
8
8
|
Zone,
|
|
9
9
|
Record,
|
|
10
|
-
|
|
10
|
+
RegistrationContact,
|
|
11
11
|
Registrar,
|
|
12
12
|
ZoneTemplate,
|
|
13
13
|
RecordTemplate,
|
|
@@ -17,7 +17,7 @@ from netbox_dns.filtersets import (
|
|
|
17
17
|
ViewFilterSet,
|
|
18
18
|
ZoneFilterSet,
|
|
19
19
|
RecordFilterSet,
|
|
20
|
-
|
|
20
|
+
RegistrationContactFilterSet,
|
|
21
21
|
RegistrarFilterSet,
|
|
22
22
|
ZoneTemplateFilterSet,
|
|
23
23
|
RecordTemplateFilterSet,
|
|
@@ -60,9 +60,9 @@ class NetBoxDNSRecordTemplateFilter(BaseFilterMixin):
|
|
|
60
60
|
pass
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
@strawberry_django.filter(
|
|
64
|
-
@autotype_decorator(
|
|
65
|
-
class
|
|
63
|
+
@strawberry_django.filter(RegistrationContact, lookups=True)
|
|
64
|
+
@autotype_decorator(RegistrationContactFilterSet)
|
|
65
|
+
class NetBoxDNSRegistrationContactFilter(BaseFilterMixin):
|
|
66
66
|
pass
|
|
67
67
|
|
|
68
68
|
|
netbox_dns/graphql/schema.py
CHANGED
|
@@ -8,7 +8,7 @@ from netbox_dns.models import (
|
|
|
8
8
|
View,
|
|
9
9
|
Zone,
|
|
10
10
|
Record,
|
|
11
|
-
|
|
11
|
+
RegistrationContact,
|
|
12
12
|
Registrar,
|
|
13
13
|
ZoneTemplate,
|
|
14
14
|
RecordTemplate,
|
|
@@ -18,86 +18,66 @@ from .types import (
|
|
|
18
18
|
NetBoxDNSViewType,
|
|
19
19
|
NetBoxDNSZoneType,
|
|
20
20
|
NetBoxDNSRecordType,
|
|
21
|
-
|
|
21
|
+
NetBoxDNSRegistrationContactType,
|
|
22
22
|
NetBoxDNSRegistrarType,
|
|
23
23
|
NetBoxDNSZoneTemplateType,
|
|
24
24
|
NetBoxDNSRecordTemplateType,
|
|
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
|
|
67
|
-
class
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
54
|
+
@strawberry.type(name="Query")
|
|
55
|
+
class NetBoxDNSRegistrationContactQuery:
|
|
56
|
+
netbox_dns_registration_contact: NetBoxDNSRegistrationContactType = (
|
|
57
|
+
strawberry_django.field()
|
|
58
|
+
)
|
|
59
|
+
netbox_dns_registration_contact_list: List[NetBoxDNSRegistrationContactType] = (
|
|
60
|
+
strawberry_django.field()
|
|
61
|
+
)
|
|
73
62
|
|
|
74
63
|
|
|
75
|
-
@strawberry.type
|
|
64
|
+
@strawberry.type(name="Query")
|
|
76
65
|
class NetBoxDNSRegistrarQuery:
|
|
77
|
-
|
|
78
|
-
def netbox_dns_registrar(self, id: int) -> NetBoxDNSRegistrarType:
|
|
79
|
-
return Registrar.objects.get(pk=id)
|
|
80
|
-
|
|
66
|
+
netbox_dns_registrar: NetBoxDNSRegistrarType = strawberry_django.field()
|
|
81
67
|
netbox_dns_registrar_list: List[NetBoxDNSRegistrarType] = strawberry_django.field()
|
|
82
68
|
|
|
83
69
|
|
|
84
|
-
@strawberry.type
|
|
70
|
+
@strawberry.type(name="Query")
|
|
85
71
|
class NetBoxDNSZoneTemplateQuery:
|
|
86
|
-
|
|
87
|
-
def netbox_dns_zone_template(self, id: int) -> NetBoxDNSZoneTemplateType:
|
|
88
|
-
return ZoneTemplate.objects.get(pk=id)
|
|
89
|
-
|
|
72
|
+
netbox_dns_zone_template: NetBoxDNSZoneTemplateType = strawberry_django.field()
|
|
90
73
|
netbox_dns_zone_template_list: List[NetBoxDNSZoneTemplateType] = (
|
|
91
74
|
strawberry_django.field()
|
|
92
75
|
)
|
|
93
76
|
|
|
94
77
|
|
|
95
|
-
@strawberry.type
|
|
78
|
+
@strawberry.type(name="Query")
|
|
96
79
|
class NetBoxDNSRecordTemplateQuery:
|
|
97
|
-
|
|
98
|
-
def netbox_dns_record_template(self, id: int) -> NetBoxDNSRecordTemplateType:
|
|
99
|
-
return RecordTemplate.objects.get(pk=id)
|
|
100
|
-
|
|
80
|
+
netbox_dns_record_template: NetBoxDNSRecordTemplateType = strawberry_django.field()
|
|
101
81
|
netbox_dns_record_template_list: List[NetBoxDNSRecordTemplateType] = (
|
|
102
82
|
strawberry_django.field()
|
|
103
83
|
)
|
netbox_dns/graphql/types.py
CHANGED
|
@@ -13,7 +13,7 @@ from netbox_dns.models import (
|
|
|
13
13
|
View,
|
|
14
14
|
Zone,
|
|
15
15
|
Record,
|
|
16
|
-
|
|
16
|
+
RegistrationContact,
|
|
17
17
|
Registrar,
|
|
18
18
|
ZoneTemplate,
|
|
19
19
|
RecordTemplate,
|
|
@@ -23,7 +23,7 @@ from .filters import (
|
|
|
23
23
|
NetBoxDNSViewFilter,
|
|
24
24
|
NetBoxDNSZoneFilter,
|
|
25
25
|
NetBoxDNSRecordFilter,
|
|
26
|
-
|
|
26
|
+
NetBoxDNSRegistrationContactFilter,
|
|
27
27
|
NetBoxDNSRegistrarFilter,
|
|
28
28
|
NetBoxDNSZoneTemplateFilter,
|
|
29
29
|
NetBoxDNSRecordTemplateFilter,
|
|
@@ -77,19 +77,31 @@ class NetBoxDNSZoneType(NetBoxObjectType):
|
|
|
77
77
|
)
|
|
78
78
|
registry_domain_id: str | None
|
|
79
79
|
registrant: (
|
|
80
|
-
Annotated[
|
|
80
|
+
Annotated[
|
|
81
|
+
"NetBoxDNSRegistrationContactType",
|
|
82
|
+
strawberry.lazy("netbox_dns.graphql.types"),
|
|
83
|
+
]
|
|
81
84
|
| None
|
|
82
85
|
)
|
|
83
86
|
admin_c: (
|
|
84
|
-
Annotated[
|
|
87
|
+
Annotated[
|
|
88
|
+
"NetBoxDNSRegistrationContactType",
|
|
89
|
+
strawberry.lazy("netbox_dns.graphql.types"),
|
|
90
|
+
]
|
|
85
91
|
| None
|
|
86
92
|
)
|
|
87
93
|
tech_c: (
|
|
88
|
-
Annotated[
|
|
94
|
+
Annotated[
|
|
95
|
+
"NetBoxDNSRegistrationContactType",
|
|
96
|
+
strawberry.lazy("netbox_dns.graphql.types"),
|
|
97
|
+
]
|
|
89
98
|
| None
|
|
90
99
|
)
|
|
91
100
|
billing_c: (
|
|
92
|
-
Annotated[
|
|
101
|
+
Annotated[
|
|
102
|
+
"NetBoxDNSRegistrationContactType",
|
|
103
|
+
strawberry.lazy("netbox_dns.graphql.types"),
|
|
104
|
+
]
|
|
93
105
|
| None
|
|
94
106
|
)
|
|
95
107
|
rfc2317_prefix: str | None
|
|
@@ -126,8 +138,10 @@ class NetBoxDNSRecordType(NetBoxObjectType):
|
|
|
126
138
|
)
|
|
127
139
|
|
|
128
140
|
|
|
129
|
-
@strawberry_django.type(
|
|
130
|
-
|
|
141
|
+
@strawberry_django.type(
|
|
142
|
+
RegistrationContact, fields="__all__", filters=NetBoxDNSRegistrationContactFilter
|
|
143
|
+
)
|
|
144
|
+
class NetBoxDNSRegistrationContactType(NetBoxObjectType):
|
|
131
145
|
name: str
|
|
132
146
|
contact_id: str
|
|
133
147
|
description: str
|
|
@@ -178,19 +192,31 @@ class NetBoxDNSZoneTemplateType(NetBoxObjectType):
|
|
|
178
192
|
| None
|
|
179
193
|
)
|
|
180
194
|
registrant: (
|
|
181
|
-
Annotated[
|
|
195
|
+
Annotated[
|
|
196
|
+
"NetBoxDNSRegistrationContactType",
|
|
197
|
+
strawberry.lazy("netbox_dns.graphql.types"),
|
|
198
|
+
]
|
|
182
199
|
| None
|
|
183
200
|
)
|
|
184
201
|
admin_c: (
|
|
185
|
-
Annotated[
|
|
202
|
+
Annotated[
|
|
203
|
+
"NetBoxDNSRegistrationContactType",
|
|
204
|
+
strawberry.lazy("netbox_dns.graphql.types"),
|
|
205
|
+
]
|
|
186
206
|
| None
|
|
187
207
|
)
|
|
188
208
|
tech_c: (
|
|
189
|
-
Annotated[
|
|
209
|
+
Annotated[
|
|
210
|
+
"NetBoxDNSRegistrationContactType",
|
|
211
|
+
strawberry.lazy("netbox_dns.graphql.types"),
|
|
212
|
+
]
|
|
190
213
|
| None
|
|
191
214
|
)
|
|
192
215
|
billing_c: (
|
|
193
|
-
Annotated[
|
|
216
|
+
Annotated[
|
|
217
|
+
"NetBoxDNSRegistrationContactType",
|
|
218
|
+
strawberry.lazy("netbox_dns.graphql.types"),
|
|
219
|
+
]
|
|
194
220
|
| None
|
|
195
221
|
)
|
|
196
222
|
|
|
@@ -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
|
+
]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from django.db import migrations, connection
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def remove_object_changes(apps, schema_editor):
|
|
5
|
+
if "objectchange" in apps.all_models.get("core"):
|
|
6
|
+
with connection.cursor() as cursor:
|
|
7
|
+
cursor.execute(
|
|
8
|
+
"DELETE FROM core_objectchange WHERE changed_object_type_id in (SELECT id FROM django_content_type WHERE app_label='netbox_dns' AND model='contact')"
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Migration(migrations.Migration):
|
|
13
|
+
|
|
14
|
+
dependencies = [
|
|
15
|
+
("netbox_dns", "0008_view_prefixes"),
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
operations = [
|
|
19
|
+
migrations.RenameModel(
|
|
20
|
+
old_name="Contact",
|
|
21
|
+
new_name="RegistrationContact",
|
|
22
|
+
),
|
|
23
|
+
migrations.RunSQL(
|
|
24
|
+
"ALTER TABLE netbox_dns_contact_id_seq RENAME TO netbox_dns_registrationcontact_id_seq"
|
|
25
|
+
),
|
|
26
|
+
migrations.RunSQL(
|
|
27
|
+
"ALTER INDEX netbox_dns_contact_pkey RENAME TO netbox_dns_registrationcontact_pkey"
|
|
28
|
+
),
|
|
29
|
+
migrations.RunSQL(
|
|
30
|
+
"ALTER INDEX netbox_dns_contact_contact_id_50e9d89d_like RENAME TO netbox_dns_registrationcontact_contact_id_6ff98464_like"
|
|
31
|
+
),
|
|
32
|
+
migrations.RunSQL(
|
|
33
|
+
"ALTER INDEX netbox_dns_contact_contact_id_key RENAME TO netbox_dns_contact_registrationcontact_id_key"
|
|
34
|
+
),
|
|
35
|
+
migrations.RunPython(remove_object_changes),
|
|
36
|
+
]
|
netbox_dns/models/__init__.py
CHANGED
netbox_dns/models/nameserver.py
CHANGED
|
@@ -7,6 +7,7 @@ from django.urls import reverse
|
|
|
7
7
|
|
|
8
8
|
from netbox.models import NetBoxModel
|
|
9
9
|
from netbox.search import SearchIndex, register_search
|
|
10
|
+
from netbox.models.features import ContactsMixin
|
|
10
11
|
|
|
11
12
|
from netbox_dns.utilities import (
|
|
12
13
|
name_to_unicode,
|
|
@@ -26,7 +27,7 @@ __all__ = (
|
|
|
26
27
|
)
|
|
27
28
|
|
|
28
29
|
|
|
29
|
-
class NameServer(ObjectModificationMixin, NetBoxModel):
|
|
30
|
+
class NameServer(ObjectModificationMixin, ContactsMixin, NetBoxModel):
|
|
30
31
|
name = models.CharField(
|
|
31
32
|
unique=True,
|
|
32
33
|
max_length=255,
|
|
@@ -43,13 +44,17 @@ class NameServer(ObjectModificationMixin, NetBoxModel):
|
|
|
43
44
|
null=True,
|
|
44
45
|
)
|
|
45
46
|
|
|
46
|
-
clone_fields =
|
|
47
|
+
clone_fields = (
|
|
48
|
+
"name",
|
|
49
|
+
"description",
|
|
50
|
+
)
|
|
47
51
|
|
|
48
52
|
class Meta:
|
|
49
|
-
ordering = ("name",)
|
|
50
53
|
verbose_name = "Nameserver"
|
|
51
54
|
verbose_name_plural = "Nameservers"
|
|
52
55
|
|
|
56
|
+
ordering = ("name",)
|
|
57
|
+
|
|
53
58
|
def __str__(self):
|
|
54
59
|
try:
|
|
55
60
|
return dns_name.from_text(self.name, origin=None).to_unicode()
|
netbox_dns/models/record.py
CHANGED
|
@@ -10,6 +10,7 @@ from django.urls import reverse
|
|
|
10
10
|
from django.conf import settings
|
|
11
11
|
|
|
12
12
|
from netbox.models import NetBoxModel
|
|
13
|
+
from netbox.models.features import ContactsMixin
|
|
13
14
|
from netbox.search import SearchIndex, register_search
|
|
14
15
|
from netbox.plugins.utils import get_plugin_config
|
|
15
16
|
from utilities.querysets import RestrictedQuerySet
|
|
@@ -100,7 +101,7 @@ class RecordManager(models.Manager.from_queryset(RestrictedQuerySet)):
|
|
|
100
101
|
)
|
|
101
102
|
|
|
102
103
|
|
|
103
|
-
class Record(ObjectModificationMixin, NetBoxModel):
|
|
104
|
+
class Record(ObjectModificationMixin, ContactsMixin, NetBoxModel):
|
|
104
105
|
ACTIVE_STATUS_LIST = (RecordStatusChoices.STATUS_ACTIVE,)
|
|
105
106
|
|
|
106
107
|
unique_ptr_qs = Q(
|
|
@@ -193,7 +194,7 @@ class Record(ObjectModificationMixin, NetBoxModel):
|
|
|
193
194
|
objects = RecordManager()
|
|
194
195
|
raw_objects = RestrictedQuerySet.as_manager()
|
|
195
196
|
|
|
196
|
-
clone_fields =
|
|
197
|
+
clone_fields = (
|
|
197
198
|
"zone",
|
|
198
199
|
"type",
|
|
199
200
|
"name",
|
|
@@ -202,10 +203,20 @@ class Record(ObjectModificationMixin, NetBoxModel):
|
|
|
202
203
|
"ttl",
|
|
203
204
|
"disable_ptr",
|
|
204
205
|
"description",
|
|
205
|
-
|
|
206
|
+
)
|
|
206
207
|
|
|
207
208
|
class Meta:
|
|
208
|
-
|
|
209
|
+
verbose_name = "Record"
|
|
210
|
+
verbose_name_plural = "Records"
|
|
211
|
+
|
|
212
|
+
ordering = (
|
|
213
|
+
"fqdn",
|
|
214
|
+
"zone",
|
|
215
|
+
"name",
|
|
216
|
+
"type",
|
|
217
|
+
"value",
|
|
218
|
+
"status",
|
|
219
|
+
)
|
|
209
220
|
|
|
210
221
|
def __str__(self):
|
|
211
222
|
try:
|
netbox_dns/models/registrar.py
CHANGED
|
@@ -59,7 +59,13 @@ class Registrar(NetBoxModel):
|
|
|
59
59
|
return str(self.name)
|
|
60
60
|
|
|
61
61
|
class Meta:
|
|
62
|
-
|
|
62
|
+
verbose_name = "Registrar"
|
|
63
|
+
verbose_name_plural = "Registrars"
|
|
64
|
+
|
|
65
|
+
ordering = (
|
|
66
|
+
"name",
|
|
67
|
+
"iana_id",
|
|
68
|
+
)
|
|
63
69
|
|
|
64
70
|
|
|
65
71
|
@register_search
|