netbox-plugin-dns 1.0.5__py3-none-any.whl → 1.0.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.
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 +18 -17
- netbox_dns/api/serializers_/contact.py +1 -1
- netbox_dns/api/serializers_/nameserver.py +1 -1
- netbox_dns/api/serializers_/record.py +2 -1
- netbox_dns/api/serializers_/record_template.py +2 -1
- netbox_dns/api/serializers_/registrar.py +1 -1
- netbox_dns/api/serializers_/view.py +1 -1
- netbox_dns/api/serializers_/zone.py +2 -1
- netbox_dns/api/serializers_/zone_template.py +2 -1
- netbox_dns/api/views.py +0 -28
- netbox_dns/choices/record.py +1 -1
- netbox_dns/choices/zone.py +1 -1
- netbox_dns/fields/address.py +1 -1
- netbox_dns/fields/network.py +1 -1
- netbox_dns/fields/rfc2317.py +4 -1
- netbox_dns/filtersets/contact.py +1 -1
- netbox_dns/filtersets/nameserver.py +1 -1
- netbox_dns/filtersets/record.py +2 -2
- netbox_dns/filtersets/record_template.py +1 -1
- netbox_dns/filtersets/registrar.py +1 -1
- netbox_dns/filtersets/view.py +1 -1
- netbox_dns/filtersets/zone.py +1 -1
- netbox_dns/filtersets/zone_template.py +1 -1
- netbox_dns/forms/contact.py +1 -1
- netbox_dns/forms/nameserver.py +14 -3
- netbox_dns/forms/record.py +2 -2
- netbox_dns/forms/record_template.py +1 -1
- netbox_dns/forms/registrar.py +1 -1
- netbox_dns/forms/view.py +1 -1
- netbox_dns/forms/zone.py +17 -6
- netbox_dns/forms/zone_template.py +1 -1
- netbox_dns/graphql/schema.py +16 -40
- netbox_dns/migrations/0007_alter_ordering_options.py +25 -0
- netbox_dns/mixins/object_modification.py +3 -1
- netbox_dns/models/contact.py +10 -4
- netbox_dns/models/nameserver.py +9 -4
- netbox_dns/models/record.py +19 -5
- netbox_dns/models/record_template.py +5 -2
- netbox_dns/models/registrar.py +8 -2
- netbox_dns/models/view.py +10 -3
- netbox_dns/models/zone.py +19 -13
- netbox_dns/models/zone_template.py +10 -6
- netbox_dns/tables/contact.py +1 -2
- netbox_dns/tables/nameserver.py +2 -8
- netbox_dns/tables/record.py +11 -31
- netbox_dns/tables/record_template.py +1 -18
- netbox_dns/tables/registrar.py +1 -3
- netbox_dns/tables/view.py +2 -9
- netbox_dns/tables/zone.py +1 -16
- netbox_dns/tables/zone_template.py +3 -17
- netbox_dns/urls/contact.py +10 -32
- 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/view.py +8 -22
- netbox_dns/urls/zone.py +8 -46
- netbox_dns/urls/zone_template.py +16 -26
- netbox_dns/validators/dns_name.py +10 -1
- netbox_dns/validators/dns_value.py +1 -1
- netbox_dns/validators/rfc2317.py +1 -1
- netbox_dns/views/contact.py +2 -2
- netbox_dns/views/nameserver.py +9 -4
- netbox_dns/views/record.py +10 -3
- netbox_dns/views/record_template.py +2 -2
- netbox_dns/views/registrar.py +1 -2
- netbox_dns/views/view.py +7 -2
- netbox_dns/views/zone.py +8 -7
- netbox_dns/views/zone_template.py +3 -3
- {netbox_plugin_dns-1.0.5.dist-info → netbox_plugin_dns-1.0.7.dist-info}/METADATA +1 -1
- netbox_plugin_dns-1.0.7.dist-info/RECORD +137 -0
- netbox_plugin_dns-1.0.5.dist-info/RECORD +0 -136
- {netbox_plugin_dns-1.0.5.dist-info → netbox_plugin_dns-1.0.7.dist-info}/LICENSE +0 -0
- {netbox_plugin_dns-1.0.5.dist-info → netbox_plugin_dns-1.0.7.dist-info}/WHEEL +0 -0
netbox_dns/urls/contact.py
CHANGED
|
@@ -1,51 +1,29 @@
|
|
|
1
|
-
from django.urls import path
|
|
1
|
+
from django.urls import include, path
|
|
2
2
|
|
|
3
|
-
from
|
|
3
|
+
from utilities.urls import get_model_urls
|
|
4
4
|
|
|
5
|
-
from netbox_dns.models import Contact
|
|
6
5
|
from netbox_dns.views import (
|
|
7
|
-
ContactListView,
|
|
8
6
|
ContactView,
|
|
9
|
-
|
|
7
|
+
ContactListView,
|
|
10
8
|
ContactEditView,
|
|
9
|
+
ContactDeleteView,
|
|
11
10
|
ContactBulkImportView,
|
|
12
11
|
ContactBulkEditView,
|
|
13
12
|
ContactBulkDeleteView,
|
|
14
|
-
ContactZoneListView,
|
|
15
13
|
)
|
|
16
14
|
|
|
17
15
|
contact_urlpatterns = [
|
|
16
|
+
path("contacts/<int:pk>/", ContactView.as_view(), name="contact"),
|
|
18
17
|
path("contacts/", ContactListView.as_view(), name="contact_list"),
|
|
19
18
|
path("contacts/add/", ContactEditView.as_view(), name="contact_add"),
|
|
20
|
-
path("contacts/import/", ContactBulkImportView.as_view(), name="contact_import"),
|
|
21
|
-
path("contacts/edit/", ContactBulkEditView.as_view(), name="contact_bulk_edit"),
|
|
22
|
-
path(
|
|
23
|
-
"contacts/delete/",
|
|
24
|
-
ContactBulkDeleteView.as_view(),
|
|
25
|
-
name="contact_bulk_delete",
|
|
26
|
-
),
|
|
27
|
-
path("contacts/<int:pk>/", ContactView.as_view(), name="contact"),
|
|
28
19
|
path("contacts/<int:pk>/edit/", ContactEditView.as_view(), name="contact_edit"),
|
|
29
20
|
path(
|
|
30
|
-
"contacts/<int:pk>/delete/",
|
|
31
|
-
ContactDeleteView.as_view(),
|
|
32
|
-
name="contact_delete",
|
|
33
|
-
),
|
|
34
|
-
path(
|
|
35
|
-
"contacts/<int:pk>/zones/",
|
|
36
|
-
ContactZoneListView.as_view(),
|
|
37
|
-
name="contact_zones",
|
|
38
|
-
),
|
|
39
|
-
path(
|
|
40
|
-
"contacts/<int:pk>/journal/",
|
|
41
|
-
ObjectJournalView.as_view(),
|
|
42
|
-
name="contact_journal",
|
|
43
|
-
kwargs={"model": Contact},
|
|
21
|
+
"contacts/<int:pk>/delete/", ContactDeleteView.as_view(), name="contact_delete"
|
|
44
22
|
),
|
|
23
|
+
path("contacts/import/", ContactBulkImportView.as_view(), name="contact_import"),
|
|
24
|
+
path("contacts/edit/", ContactBulkEditView.as_view(), name="contact_bulk_edit"),
|
|
45
25
|
path(
|
|
46
|
-
"contacts
|
|
47
|
-
ObjectChangeLogView.as_view(),
|
|
48
|
-
name="contact_changelog",
|
|
49
|
-
kwargs={"model": Contact},
|
|
26
|
+
"contacts/delete/", ContactBulkDeleteView.as_view(), name="contact_bulk_delete"
|
|
50
27
|
),
|
|
28
|
+
path("contacts/<int:pk>/", include(get_model_urls("netbox_dns", "contact"))),
|
|
51
29
|
]
|
netbox_dns/urls/nameserver.py
CHANGED
|
@@ -1,39 +1,21 @@
|
|
|
1
|
-
from django.urls import path
|
|
1
|
+
from django.urls import include, path
|
|
2
2
|
|
|
3
|
-
from
|
|
3
|
+
from utilities.urls import get_model_urls
|
|
4
4
|
|
|
5
|
-
from netbox_dns.models import NameServer
|
|
6
5
|
from netbox_dns.views import (
|
|
7
|
-
NameServerListView,
|
|
8
6
|
NameServerView,
|
|
7
|
+
NameServerListView,
|
|
9
8
|
NameServerEditView,
|
|
10
9
|
NameServerDeleteView,
|
|
11
10
|
NameServerBulkImportView,
|
|
12
11
|
NameServerBulkEditView,
|
|
13
12
|
NameServerBulkDeleteView,
|
|
14
|
-
NameServerZoneListView,
|
|
15
|
-
NameServerSOAZoneListView,
|
|
16
13
|
)
|
|
17
14
|
|
|
18
15
|
nameserver_urlpatterns = [
|
|
16
|
+
path("nameservers/<int:pk>/", NameServerView.as_view(), name="nameserver"),
|
|
19
17
|
path("nameservers/", NameServerListView.as_view(), name="nameserver_list"),
|
|
20
18
|
path("nameservers/add/", NameServerEditView.as_view(), name="nameserver_add"),
|
|
21
|
-
path(
|
|
22
|
-
"nameservers/import/",
|
|
23
|
-
NameServerBulkImportView.as_view(),
|
|
24
|
-
name="nameserver_import",
|
|
25
|
-
),
|
|
26
|
-
path(
|
|
27
|
-
"nameservers/edit/",
|
|
28
|
-
NameServerBulkEditView.as_view(),
|
|
29
|
-
name="nameserver_bulk_edit",
|
|
30
|
-
),
|
|
31
|
-
path(
|
|
32
|
-
"nameservers/delete/",
|
|
33
|
-
NameServerBulkDeleteView.as_view(),
|
|
34
|
-
name="nameserver_bulk_delete",
|
|
35
|
-
),
|
|
36
|
-
path("nameservers/<int:pk>/", NameServerView.as_view(), name="nameserver"),
|
|
37
19
|
path(
|
|
38
20
|
"nameservers/<int:pk>/edit",
|
|
39
21
|
NameServerEditView.as_view(),
|
|
@@ -45,25 +27,19 @@ nameserver_urlpatterns = [
|
|
|
45
27
|
name="nameserver_delete",
|
|
46
28
|
),
|
|
47
29
|
path(
|
|
48
|
-
"nameservers
|
|
49
|
-
|
|
50
|
-
name="
|
|
51
|
-
kwargs={"model": NameServer},
|
|
52
|
-
),
|
|
53
|
-
path(
|
|
54
|
-
"nameservers/<int:pk>/changelog/",
|
|
55
|
-
ObjectChangeLogView.as_view(),
|
|
56
|
-
name="nameserver_changelog",
|
|
57
|
-
kwargs={"model": NameServer},
|
|
30
|
+
"nameservers/import/",
|
|
31
|
+
NameServerBulkImportView.as_view(),
|
|
32
|
+
name="nameserver_import",
|
|
58
33
|
),
|
|
59
34
|
path(
|
|
60
|
-
"nameservers
|
|
61
|
-
|
|
62
|
-
name="
|
|
35
|
+
"nameservers/edit/",
|
|
36
|
+
NameServerBulkEditView.as_view(),
|
|
37
|
+
name="nameserver_bulk_edit",
|
|
63
38
|
),
|
|
64
39
|
path(
|
|
65
|
-
"nameservers
|
|
66
|
-
|
|
67
|
-
name="
|
|
40
|
+
"nameservers/delete/",
|
|
41
|
+
NameServerBulkDeleteView.as_view(),
|
|
42
|
+
name="nameserver_bulk_delete",
|
|
68
43
|
),
|
|
44
|
+
path("nameservers/<int:pk>/", include(get_model_urls("netbox_dns", "nameserver"))),
|
|
69
45
|
]
|
netbox_dns/urls/record.py
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
from django.urls import path
|
|
1
|
+
from django.urls import include, path
|
|
2
2
|
|
|
3
|
-
from
|
|
3
|
+
from utilities.urls import get_model_urls
|
|
4
4
|
|
|
5
|
-
from netbox_dns.models import Record
|
|
6
5
|
from netbox_dns.views import (
|
|
7
|
-
RecordListView,
|
|
8
6
|
RecordView,
|
|
7
|
+
RecordListView,
|
|
9
8
|
RecordEditView,
|
|
10
9
|
RecordDeleteView,
|
|
11
10
|
RecordBulkImportView,
|
|
@@ -15,26 +14,15 @@ from netbox_dns.views import (
|
|
|
15
14
|
)
|
|
16
15
|
|
|
17
16
|
record_urlpatterns = [
|
|
17
|
+
path("records/<int:pk>/", RecordView.as_view(), name="record"),
|
|
18
18
|
path("records/", RecordListView.as_view(), name="record_list"),
|
|
19
19
|
path("records/add/", RecordEditView.as_view(), name="record_add"),
|
|
20
|
+
path("records/<int:pk>/edit/", RecordEditView.as_view(), name="record_edit"),
|
|
21
|
+
path("records/<int:pk>/delete/", RecordDeleteView.as_view(), name="record_delete"),
|
|
20
22
|
path("records/import/", RecordBulkImportView.as_view(), name="record_import"),
|
|
21
23
|
path("records/edit/", RecordBulkEditView.as_view(), name="record_bulk_edit"),
|
|
22
24
|
path("records/delete/", RecordBulkDeleteView.as_view(), name="record_bulk_delete"),
|
|
23
|
-
path("records/<int:pk>/",
|
|
24
|
-
path("records/<int:pk>/edit/", RecordEditView.as_view(), name="record_edit"),
|
|
25
|
-
path("records/<int:pk>/delete/", RecordDeleteView.as_view(), name="record_delete"),
|
|
26
|
-
path(
|
|
27
|
-
"records/<int:pk>/journal/",
|
|
28
|
-
ObjectJournalView.as_view(),
|
|
29
|
-
name="record_journal",
|
|
30
|
-
kwargs={"model": Record},
|
|
31
|
-
),
|
|
32
|
-
path(
|
|
33
|
-
"records/<int:pk>/changelog/",
|
|
34
|
-
ObjectChangeLogView.as_view(),
|
|
35
|
-
name="record_changelog",
|
|
36
|
-
kwargs={"model": Record},
|
|
37
|
-
),
|
|
25
|
+
path("records/<int:pk>/", include(get_model_urls("netbox_dns", "record"))),
|
|
38
26
|
path(
|
|
39
27
|
"managedrecords/", ManagedRecordListView.as_view(), name="managed_record_list"
|
|
40
28
|
),
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
from django.urls import path
|
|
1
|
+
from django.urls import include, path
|
|
2
2
|
|
|
3
|
-
from
|
|
3
|
+
from utilities.urls import get_model_urls
|
|
4
4
|
|
|
5
|
-
from netbox_dns.models import RecordTemplate
|
|
6
5
|
from netbox_dns.views import (
|
|
7
|
-
RecordTemplateListView,
|
|
8
6
|
RecordTemplateView,
|
|
7
|
+
RecordTemplateListView,
|
|
9
8
|
RecordTemplateEditView,
|
|
10
9
|
RecordTemplateDeleteView,
|
|
11
10
|
RecordTemplateBulkImportView,
|
|
@@ -14,6 +13,9 @@ from netbox_dns.views import (
|
|
|
14
13
|
)
|
|
15
14
|
|
|
16
15
|
recordtemplate_urlpatterns = [
|
|
16
|
+
path(
|
|
17
|
+
"recordtemplates/<int:pk>/", RecordTemplateView.as_view(), name="recordtemplate"
|
|
18
|
+
),
|
|
17
19
|
path(
|
|
18
20
|
"recordtemplates/", RecordTemplateListView.as_view(), name="recordtemplate_list"
|
|
19
21
|
),
|
|
@@ -22,6 +24,16 @@ recordtemplate_urlpatterns = [
|
|
|
22
24
|
RecordTemplateEditView.as_view(),
|
|
23
25
|
name="recordtemplate_add",
|
|
24
26
|
),
|
|
27
|
+
path(
|
|
28
|
+
"recordtemplates/<int:pk>/edit/",
|
|
29
|
+
RecordTemplateEditView.as_view(),
|
|
30
|
+
name="recordtemplate_edit",
|
|
31
|
+
),
|
|
32
|
+
path(
|
|
33
|
+
"recordtemplates/<int:pk>/delete/",
|
|
34
|
+
RecordTemplateDeleteView.as_view(),
|
|
35
|
+
name="recordtemplate_delete",
|
|
36
|
+
),
|
|
25
37
|
path(
|
|
26
38
|
"recordtemplates/import/",
|
|
27
39
|
RecordTemplateBulkImportView.as_view(),
|
|
@@ -38,28 +50,7 @@ recordtemplate_urlpatterns = [
|
|
|
38
50
|
name="recordtemplate_bulk_delete",
|
|
39
51
|
),
|
|
40
52
|
path(
|
|
41
|
-
"recordtemplates/<int:pk>/",
|
|
42
|
-
|
|
43
|
-
path(
|
|
44
|
-
"recordtemplates/<int:pk>/edit/",
|
|
45
|
-
RecordTemplateEditView.as_view(),
|
|
46
|
-
name="recordtemplate_edit",
|
|
47
|
-
),
|
|
48
|
-
path(
|
|
49
|
-
"recordtemplates/<int:pk>/delete/",
|
|
50
|
-
RecordTemplateDeleteView.as_view(),
|
|
51
|
-
name="recordtemplate_delete",
|
|
52
|
-
),
|
|
53
|
-
path(
|
|
54
|
-
"recordtemplates/<int:pk>/journal/",
|
|
55
|
-
ObjectJournalView.as_view(),
|
|
56
|
-
name="recordtemplate_journal",
|
|
57
|
-
kwargs={"model": RecordTemplate},
|
|
58
|
-
),
|
|
59
|
-
path(
|
|
60
|
-
"recordtemplates/<int:pk>/changelog/",
|
|
61
|
-
ObjectChangeLogView.as_view(),
|
|
62
|
-
name="recordtemplate_changelog",
|
|
63
|
-
kwargs={"model": RecordTemplate},
|
|
53
|
+
"recordtemplates/<int:pk>/",
|
|
54
|
+
include(get_model_urls("netbox_dns", "recordtemplate")),
|
|
64
55
|
),
|
|
65
56
|
]
|
netbox_dns/urls/registrar.py
CHANGED
|
@@ -1,63 +1,39 @@
|
|
|
1
|
-
from django.urls import path
|
|
1
|
+
from django.urls import include, path
|
|
2
2
|
|
|
3
|
-
from
|
|
3
|
+
from utilities.urls import get_model_urls
|
|
4
4
|
|
|
5
|
-
from netbox_dns.models import Registrar
|
|
6
5
|
from netbox_dns.views import (
|
|
7
|
-
RegistrarListView,
|
|
8
6
|
RegistrarView,
|
|
9
|
-
|
|
7
|
+
RegistrarListView,
|
|
10
8
|
RegistrarEditView,
|
|
9
|
+
RegistrarDeleteView,
|
|
11
10
|
RegistrarBulkImportView,
|
|
12
11
|
RegistrarBulkEditView,
|
|
13
12
|
RegistrarBulkDeleteView,
|
|
14
|
-
RegistrarZoneListView,
|
|
15
13
|
)
|
|
16
14
|
|
|
17
15
|
registrar_urlpatterns = [
|
|
16
|
+
path("registrars/<int:pk>/", RegistrarView.as_view(), name="registrar"),
|
|
18
17
|
path("registrars/", RegistrarListView.as_view(), name="registrar_list"),
|
|
19
18
|
path("registrars/add/", RegistrarEditView.as_view(), name="registrar_add"),
|
|
20
19
|
path(
|
|
21
|
-
"registrars/
|
|
22
|
-
RegistrarBulkImportView.as_view(),
|
|
23
|
-
name="registrar_import",
|
|
24
|
-
),
|
|
25
|
-
path(
|
|
26
|
-
"registrars/edit/",
|
|
27
|
-
RegistrarBulkEditView.as_view(),
|
|
28
|
-
name="registrar_bulk_edit",
|
|
20
|
+
"registrars/<int:pk>/edit/", RegistrarEditView.as_view(), name="registrar_edit"
|
|
29
21
|
),
|
|
30
22
|
path(
|
|
31
23
|
"registrars/delete/",
|
|
32
24
|
RegistrarBulkDeleteView.as_view(),
|
|
33
25
|
name="registrar_bulk_delete",
|
|
34
26
|
),
|
|
35
|
-
path("registrars/<int:pk>/", RegistrarView.as_view(), name="registrar"),
|
|
36
27
|
path(
|
|
37
|
-
"registrars
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
"registrars/import/", RegistrarBulkImportView.as_view(), name="registrar_import"
|
|
29
|
+
),
|
|
30
|
+
path(
|
|
31
|
+
"registrars/edit/", RegistrarBulkEditView.as_view(), name="registrar_bulk_edit"
|
|
40
32
|
),
|
|
41
33
|
path(
|
|
42
34
|
"registrars/<int:pk>/delete/",
|
|
43
35
|
RegistrarDeleteView.as_view(),
|
|
44
36
|
name="registrar_delete",
|
|
45
37
|
),
|
|
46
|
-
path(
|
|
47
|
-
"registrars/<int:pk>/zones/",
|
|
48
|
-
RegistrarZoneListView.as_view(),
|
|
49
|
-
name="registrar_zones",
|
|
50
|
-
),
|
|
51
|
-
path(
|
|
52
|
-
"registrars/<int:pk>/journal/",
|
|
53
|
-
ObjectJournalView.as_view(),
|
|
54
|
-
name="registrar_journal",
|
|
55
|
-
kwargs={"model": Registrar},
|
|
56
|
-
),
|
|
57
|
-
path(
|
|
58
|
-
"registrars/<int:pk>/changelog/",
|
|
59
|
-
ObjectChangeLogView.as_view(),
|
|
60
|
-
name="registrar_changelog",
|
|
61
|
-
kwargs={"model": Registrar},
|
|
62
|
-
),
|
|
38
|
+
path("registrars/<int:pk>/", include(get_model_urls("netbox_dns", "registrar"))),
|
|
63
39
|
]
|
netbox_dns/urls/view.py
CHANGED
|
@@ -1,39 +1,25 @@
|
|
|
1
|
-
from django.urls import path
|
|
1
|
+
from django.urls import include, path
|
|
2
2
|
|
|
3
|
-
from
|
|
3
|
+
from utilities.urls import get_model_urls
|
|
4
4
|
|
|
5
|
-
from netbox_dns.models import View
|
|
6
5
|
from netbox_dns.views import (
|
|
7
|
-
ViewListView,
|
|
8
6
|
ViewView,
|
|
9
|
-
|
|
7
|
+
ViewListView,
|
|
10
8
|
ViewEditView,
|
|
9
|
+
ViewDeleteView,
|
|
11
10
|
ViewBulkImportView,
|
|
12
11
|
ViewBulkEditView,
|
|
13
12
|
ViewBulkDeleteView,
|
|
14
|
-
ViewZoneListView,
|
|
15
13
|
)
|
|
16
14
|
|
|
17
15
|
view_urlpatterns = [
|
|
16
|
+
path("views/<int:pk>/", ViewView.as_view(), name="view"),
|
|
18
17
|
path("views/", ViewListView.as_view(), name="view_list"),
|
|
19
18
|
path("views/add/", ViewEditView.as_view(), name="view_add"),
|
|
19
|
+
path("views/<int:pk>/edit/", ViewEditView.as_view(), name="view_edit"),
|
|
20
|
+
path("views/<int:pk>/delete/", ViewDeleteView.as_view(), name="view_delete"),
|
|
20
21
|
path("views/import/", ViewBulkImportView.as_view(), name="view_import"),
|
|
21
22
|
path("views/edit/", ViewBulkEditView.as_view(), name="view_bulk_edit"),
|
|
22
23
|
path("views/delete/", ViewBulkDeleteView.as_view(), name="view_bulk_delete"),
|
|
23
|
-
path("views/<int:pk>/",
|
|
24
|
-
path("views/<int:pk>/edit/", ViewEditView.as_view(), name="view_edit"),
|
|
25
|
-
path("views/<int:pk>/delete/", ViewDeleteView.as_view(), name="view_delete"),
|
|
26
|
-
path("views/<int:pk>/zones/", ViewZoneListView.as_view(), name="view_zones"),
|
|
27
|
-
path(
|
|
28
|
-
"views/<int:pk>/journal/",
|
|
29
|
-
ObjectJournalView.as_view(),
|
|
30
|
-
name="view_journal",
|
|
31
|
-
kwargs={"model": View},
|
|
32
|
-
),
|
|
33
|
-
path(
|
|
34
|
-
"views/<int:pk>/changelog/",
|
|
35
|
-
ObjectChangeLogView.as_view(),
|
|
36
|
-
name="view_changelog",
|
|
37
|
-
kwargs={"model": View},
|
|
38
|
-
),
|
|
24
|
+
path("views/<int:pk>/", include(get_model_urls("netbox_dns", "view"))),
|
|
39
25
|
]
|
netbox_dns/urls/zone.py
CHANGED
|
@@ -1,63 +1,25 @@
|
|
|
1
|
-
from django.urls import path
|
|
1
|
+
from django.urls import include, path
|
|
2
2
|
|
|
3
|
-
from
|
|
3
|
+
from utilities.urls import get_model_urls
|
|
4
4
|
|
|
5
|
-
from netbox_dns.models import Zone
|
|
6
5
|
from netbox_dns.views import (
|
|
7
|
-
ZoneListView,
|
|
8
6
|
ZoneView,
|
|
9
|
-
|
|
7
|
+
ZoneListView,
|
|
10
8
|
ZoneEditView,
|
|
9
|
+
ZoneDeleteView,
|
|
11
10
|
ZoneBulkImportView,
|
|
12
11
|
ZoneBulkEditView,
|
|
13
12
|
ZoneBulkDeleteView,
|
|
14
|
-
ZoneRecordListView,
|
|
15
|
-
ZoneManagedRecordListView,
|
|
16
|
-
ZoneRegistrationView,
|
|
17
|
-
ZoneRFC2317ChildZoneListView,
|
|
18
|
-
ZoneChildZoneListView,
|
|
19
13
|
)
|
|
20
14
|
|
|
21
15
|
zone_urlpatterns = [
|
|
16
|
+
path("zones/<int:pk>/", ZoneView.as_view(), name="zone"),
|
|
22
17
|
path("zones/", ZoneListView.as_view(), name="zone_list"),
|
|
23
18
|
path("zones/add/", ZoneEditView.as_view(), name="zone_add"),
|
|
19
|
+
path("zones/<int:pk>/edit/", ZoneEditView.as_view(), name="zone_edit"),
|
|
20
|
+
path("zones/<int:pk>/delete/", ZoneDeleteView.as_view(), name="zone_delete"),
|
|
24
21
|
path("zones/import/", ZoneBulkImportView.as_view(), name="zone_import"),
|
|
25
22
|
path("zones/edit/", ZoneBulkEditView.as_view(), name="zone_bulk_edit"),
|
|
26
23
|
path("zones/delete/", ZoneBulkDeleteView.as_view(), name="zone_bulk_delete"),
|
|
27
|
-
path("zones/<int:pk>/",
|
|
28
|
-
path("zones/<int:pk>/delete/", ZoneDeleteView.as_view(), name="zone_delete"),
|
|
29
|
-
path("zones/<int:pk>/edit/", ZoneEditView.as_view(), name="zone_edit"),
|
|
30
|
-
path("zones/<int:pk>/records/", ZoneRecordListView.as_view(), name="zone_records"),
|
|
31
|
-
path(
|
|
32
|
-
"zones/<int:pk>/managedrecords/",
|
|
33
|
-
ZoneManagedRecordListView.as_view(),
|
|
34
|
-
name="zone_managed_records",
|
|
35
|
-
),
|
|
36
|
-
path(
|
|
37
|
-
"zones/<int:pk>/rfc2317childzones/",
|
|
38
|
-
ZoneRFC2317ChildZoneListView.as_view(),
|
|
39
|
-
name="zone_rfc2317_child_zones",
|
|
40
|
-
),
|
|
41
|
-
path(
|
|
42
|
-
"zones/<int:pk>/childzones/",
|
|
43
|
-
ZoneChildZoneListView.as_view(),
|
|
44
|
-
name="zone_child_zones",
|
|
45
|
-
),
|
|
46
|
-
path(
|
|
47
|
-
"zones/<int:pk>/registration/",
|
|
48
|
-
ZoneRegistrationView.as_view(),
|
|
49
|
-
name="zone_registration",
|
|
50
|
-
),
|
|
51
|
-
path(
|
|
52
|
-
"zones/<int:pk>/journal/",
|
|
53
|
-
ObjectJournalView.as_view(),
|
|
54
|
-
name="zone_journal",
|
|
55
|
-
kwargs={"model": Zone},
|
|
56
|
-
),
|
|
57
|
-
path(
|
|
58
|
-
"zones/<int:pk>/changelog/",
|
|
59
|
-
ObjectChangeLogView.as_view(),
|
|
60
|
-
name="zone_changelog",
|
|
61
|
-
kwargs={"model": Zone},
|
|
62
|
-
),
|
|
24
|
+
path("zones/<int:pk>/", include(get_model_urls("netbox_dns", "zone"))),
|
|
63
25
|
]
|
netbox_dns/urls/zone_template.py
CHANGED
|
@@ -1,21 +1,31 @@
|
|
|
1
|
-
from django.urls import path
|
|
1
|
+
from django.urls import include, path
|
|
2
2
|
|
|
3
|
-
from
|
|
3
|
+
from utilities.urls import get_model_urls
|
|
4
4
|
|
|
5
|
-
from netbox_dns.models import ZoneTemplate
|
|
6
5
|
from netbox_dns.views import (
|
|
7
|
-
ZoneTemplateListView,
|
|
8
6
|
ZoneTemplateView,
|
|
9
|
-
|
|
7
|
+
ZoneTemplateListView,
|
|
10
8
|
ZoneTemplateEditView,
|
|
9
|
+
ZoneTemplateDeleteView,
|
|
11
10
|
ZoneTemplateBulkImportView,
|
|
12
11
|
ZoneTemplateBulkEditView,
|
|
13
12
|
ZoneTemplateBulkDeleteView,
|
|
14
13
|
)
|
|
15
14
|
|
|
16
15
|
zonetemplate_urlpatterns = [
|
|
16
|
+
path("zonetemplates/<int:pk>/", ZoneTemplateView.as_view(), name="zonetemplate"),
|
|
17
17
|
path("zonetemplates/", ZoneTemplateListView.as_view(), name="zonetemplate_list"),
|
|
18
18
|
path("zonetemplates/add/", ZoneTemplateEditView.as_view(), name="zonetemplate_add"),
|
|
19
|
+
path(
|
|
20
|
+
"zonetemplates/<int:pk>/edit/",
|
|
21
|
+
ZoneTemplateEditView.as_view(),
|
|
22
|
+
name="zonetemplate_edit",
|
|
23
|
+
),
|
|
24
|
+
path(
|
|
25
|
+
"zonetemplates/<int:pk>/delete/",
|
|
26
|
+
ZoneTemplateDeleteView.as_view(),
|
|
27
|
+
name="zonetemplate_delete",
|
|
28
|
+
),
|
|
19
29
|
path(
|
|
20
30
|
"zonetemplates/import/",
|
|
21
31
|
ZoneTemplateBulkImportView.as_view(),
|
|
@@ -31,27 +41,7 @@ zonetemplate_urlpatterns = [
|
|
|
31
41
|
ZoneTemplateBulkDeleteView.as_view(),
|
|
32
42
|
name="zonetemplate_bulk_delete",
|
|
33
43
|
),
|
|
34
|
-
path("zonetemplates/<int:pk>/", ZoneTemplateView.as_view(), name="zonetemplate"),
|
|
35
|
-
path(
|
|
36
|
-
"zonetemplates/<int:pk>/delete/",
|
|
37
|
-
ZoneTemplateDeleteView.as_view(),
|
|
38
|
-
name="zonetemplate_delete",
|
|
39
|
-
),
|
|
40
|
-
path(
|
|
41
|
-
"zonetemplates/<int:pk>/edit/",
|
|
42
|
-
ZoneTemplateEditView.as_view(),
|
|
43
|
-
name="zonetemplate_edit",
|
|
44
|
-
),
|
|
45
|
-
path(
|
|
46
|
-
"zonetemplates/<int:pk>/journal/",
|
|
47
|
-
ObjectJournalView.as_view(),
|
|
48
|
-
name="zonetemplate_journal",
|
|
49
|
-
kwargs={"model": ZoneTemplate},
|
|
50
|
-
),
|
|
51
44
|
path(
|
|
52
|
-
"zonetemplates/<int:pk>/
|
|
53
|
-
ObjectChangeLogView.as_view(),
|
|
54
|
-
name="zonetemplate_changelog",
|
|
55
|
-
kwargs={"model": ZoneTemplate},
|
|
45
|
+
"zonetemplates/<int:pk>/", include(get_model_urls("netbox_dns", "zonetemplate"))
|
|
56
46
|
),
|
|
57
47
|
]
|
|
@@ -5,8 +5,9 @@ from django.core.exceptions import ValidationError
|
|
|
5
5
|
from netbox.plugins.utils import get_plugin_config
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
__all__ = (
|
|
9
9
|
"validate_fqdn",
|
|
10
|
+
"validate_rname",
|
|
10
11
|
"validate_generic_name",
|
|
11
12
|
"validate_domain_name",
|
|
12
13
|
)
|
|
@@ -57,6 +58,14 @@ def validate_fqdn(name, always_tolerant=False):
|
|
|
57
58
|
raise ValidationError(f"{name} is not a valid fully qualified DNS host name")
|
|
58
59
|
|
|
59
60
|
|
|
61
|
+
def validate_rname(name, always_tolerant=False):
|
|
62
|
+
label, zone_label = _get_label(always_tolerant=always_tolerant)
|
|
63
|
+
regex = rf"^(\*|{label})(\\\.{label})*(\.{zone_label}){{2,}}\.?$"
|
|
64
|
+
|
|
65
|
+
if not re.match(regex, name, flags=re.IGNORECASE) or _has_invalid_double_dash(name):
|
|
66
|
+
raise ValidationError(f"{name} is not a valid RNAME")
|
|
67
|
+
|
|
68
|
+
|
|
60
69
|
def validate_generic_name(
|
|
61
70
|
name, tolerate_leading_underscores=False, always_tolerant=False
|
|
62
71
|
):
|
netbox_dns/validators/rfc2317.py
CHANGED
netbox_dns/views/contact.py
CHANGED
|
@@ -15,14 +15,14 @@ from netbox_dns.forms import (
|
|
|
15
15
|
from netbox_dns.tables import ContactTable, ZoneTable
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
__all__ = (
|
|
19
19
|
"ContactView",
|
|
20
|
+
"ContactEditView",
|
|
20
21
|
"ContactListView",
|
|
21
22
|
"ContactDeleteView",
|
|
22
23
|
"ContactBulkImportView",
|
|
23
24
|
"ContactBulkEditView",
|
|
24
25
|
"ContactBulkDeleteView",
|
|
25
|
-
"ContactZoneListView",
|
|
26
26
|
)
|
|
27
27
|
|
|
28
28
|
|
netbox_dns/views/nameserver.py
CHANGED
|
@@ -2,6 +2,7 @@ from dns import name as dns_name
|
|
|
2
2
|
|
|
3
3
|
from netbox.views import generic
|
|
4
4
|
from utilities.views import ViewTab, register_model_view
|
|
5
|
+
from tenancy.views import ObjectContactsView
|
|
5
6
|
|
|
6
7
|
from netbox_dns.filtersets import NameServerFilterSet, ZoneFilterSet
|
|
7
8
|
from netbox_dns.forms import (
|
|
@@ -14,15 +15,14 @@ from netbox_dns.models import Zone, NameServer
|
|
|
14
15
|
from netbox_dns.tables import NameServerTable, ZoneTable
|
|
15
16
|
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
"NameServerListView",
|
|
18
|
+
__all__ = (
|
|
19
19
|
"NameServerView",
|
|
20
|
+
"NameServerListView",
|
|
20
21
|
"NameServerEditView",
|
|
21
22
|
"NameServerDeleteView",
|
|
22
23
|
"NameServerBulkEditView",
|
|
24
|
+
"NameServerBulkImportView",
|
|
23
25
|
"NameServerBulkDeleteView",
|
|
24
|
-
"NameServerZoneListView",
|
|
25
|
-
"NameServerSOAZoneListView",
|
|
26
26
|
)
|
|
27
27
|
|
|
28
28
|
|
|
@@ -76,6 +76,11 @@ class NameServerBulkDeleteView(generic.BulkDeleteView):
|
|
|
76
76
|
table = NameServerTable
|
|
77
77
|
|
|
78
78
|
|
|
79
|
+
@register_model_view(NameServer, "contacts")
|
|
80
|
+
class NameServerContactsView(ObjectContactsView):
|
|
81
|
+
queryset = NameServer.objects.all()
|
|
82
|
+
|
|
83
|
+
|
|
79
84
|
@register_model_view(NameServer, "zones")
|
|
80
85
|
class NameServerZoneListView(generic.ObjectChildrenView):
|
|
81
86
|
queryset = NameServer.objects.all().prefetch_related("zones")
|
netbox_dns/views/record.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
from dns import name as dns_name
|
|
2
2
|
|
|
3
3
|
from netbox.views import generic
|
|
4
|
+
from utilities.views import register_model_view
|
|
5
|
+
from tenancy.views import ObjectContactsView
|
|
4
6
|
|
|
5
7
|
from netbox_dns.filtersets import RecordFilterSet
|
|
6
8
|
from netbox_dns.forms import (
|
|
@@ -15,15 +17,15 @@ from netbox_dns.tables import RecordTable, ManagedRecordTable, RelatedRecordTabl
|
|
|
15
17
|
from netbox_dns.utilities import value_to_unicode
|
|
16
18
|
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
"RecordListView",
|
|
20
|
-
"ManagedRecordListView",
|
|
20
|
+
__all__ = (
|
|
21
21
|
"RecordView",
|
|
22
|
+
"RecordListView",
|
|
22
23
|
"RecordEditView",
|
|
23
24
|
"RecordDeleteView",
|
|
24
25
|
"RecordBulkImportView",
|
|
25
26
|
"RecordBulkEditView",
|
|
26
27
|
"RecordBulkDeleteView",
|
|
28
|
+
"ManagedRecordListView",
|
|
27
29
|
)
|
|
28
30
|
|
|
29
31
|
|
|
@@ -155,3 +157,8 @@ class RecordBulkEditView(generic.BulkEditView):
|
|
|
155
157
|
class RecordBulkDeleteView(generic.BulkDeleteView):
|
|
156
158
|
queryset = Record.objects.filter(managed=False)
|
|
157
159
|
table = RecordTable
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
@register_model_view(Record, "contacts")
|
|
163
|
+
class RecordContactsView(ObjectContactsView):
|
|
164
|
+
queryset = Record.objects.all()
|
|
@@ -14,9 +14,9 @@ from netbox_dns.tables import RecordTemplateTable, ZoneTemplateDisplayTable
|
|
|
14
14
|
from netbox_dns.utilities import value_to_unicode
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
"RecordTemplateListView",
|
|
17
|
+
__all__ = (
|
|
19
18
|
"RecordTemplateView",
|
|
19
|
+
"RecordTemplateListView",
|
|
20
20
|
"RecordTemplateEditView",
|
|
21
21
|
"RecordTemplateDeleteView",
|
|
22
22
|
"RecordTemplateBulkImportView",
|