netbox-plugin-dns 1.1b3__tar.gz → 1.1.0b5__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.1b3 → netbox_plugin_dns-1.1.0b5}/PKG-INFO +1 -1
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/__init__.py +7 -6
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/views.py +2 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/fields/ipam.py +0 -3
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/filtersets/record.py +1 -1
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/forms/view.py +3 -4
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/forms/zone.py +2 -5
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/graphql/types.py +2 -0
- netbox_plugin_dns-1.1b3/netbox_dns/management/commands/setup_autodns.py → netbox_plugin_dns-1.1.0b5/netbox_dns/management/commands/setup_dnssync.py +14 -14
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/models/record.py +4 -4
- netbox_plugin_dns-1.1b3/netbox_dns/signals/ipam_autodns.py → netbox_plugin_dns-1.1.0b5/netbox_dns/signals/ipam_dnssync.py +12 -13
- netbox_plugin_dns-1.1.0b5/netbox_dns/tables/ipam_dnssync.py +11 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/tables/record.py +36 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/template_content.py +2 -2
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/view.html +1 -1
- netbox_plugin_dns-1.1.0b5/netbox_dns/utilities/__init__.py +2 -0
- netbox_plugin_dns-1.1b3/netbox_dns/utilities/ipam_autodns.py → netbox_plugin_dns-1.1.0b5/netbox_dns/utilities/ipam_dnssync.py +2 -1
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/views/record.py +7 -5
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/pyproject.toml +1 -1
- netbox_plugin_dns-1.1b3/netbox_dns/utilities/__init__.py +0 -2
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/LICENSE +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/README.md +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/nested_serializers.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/serializers.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/serializers_/__init__.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/serializers_/contact.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/serializers_/nameserver.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/serializers_/prefix.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/serializers_/record.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/serializers_/record_template.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/serializers_/registrar.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/serializers_/view.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/serializers_/zone.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/serializers_/zone_template.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/urls.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/apps.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/choices/__init__.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/choices/record.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/choices/zone.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/fields/__init__.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/fields/address.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/fields/network.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/fields/rfc2317.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/filtersets/__init__.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/filtersets/contact.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/filtersets/nameserver.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/filtersets/record_template.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/filtersets/registrar.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/filtersets/view.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/filtersets/zone.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/filtersets/zone_template.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/forms/__init__.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/forms/contact.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/forms/nameserver.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/forms/record.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/forms/record_template.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/forms/registrar.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/forms/zone_template.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/graphql/__init__.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/graphql/filters.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/graphql/schema.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/management/commands/cleanup_database.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/management/commands/cleanup_rrset_ttl.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/management/commands/update_soa.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0001_squashed_netbox_dns_0_15.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0001_squashed_netbox_dns_0_22.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0002_contact_description_registrar_description.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0003_default_view.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0004_create_and_assign_default_view.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0005_alter_zone_view_not_null.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0006_templating.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0007_view_prefixes.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0020_netbox_3_4.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0021_record_ip_address.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0022_search.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0023_alter_record_value.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0024_tenancy.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0025_ipam_coupling_cf.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0026_domain_registration.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0027_alter_registrar_iana_id.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0028_rfc2317_fields.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0029_record_fqdn.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/__init__.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/mixins/__init__.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/mixins/object_modification.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/models/__init__.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/models/contact.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/models/nameserver.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/models/record_template.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/models/registrar.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/models/view.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/models/zone.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/models/zone_template.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/navigation.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/signals/__init__.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/tables/__init__.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/tables/contact.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/tables/nameserver.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/tables/record_template.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/tables/registrar.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/tables/view.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/tables/zone.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/tables/zone_template.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/contact.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/nameserver.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/record/managed.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/record/related.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/record.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/recordtemplate.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/registrar.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/view/button.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/view/prefix.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/view/related.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/zone/base.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/zone/child.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/zone/child_zone.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/zone/managed_record.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/zone/record.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/zone/registration.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/zone/rfc2317_child_zone.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/zone.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/zonetemplate.html +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/urls/__init__.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/urls/contact.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/urls/nameserver.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/urls/record.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/urls/record_template.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/urls/registrar.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/urls/view.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/urls/zone.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/urls/zone_template.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/utilities/conversions.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/validators/__init__.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/validators/dns_name.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/validators/dns_value.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/validators/rfc2317.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/views/__init__.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/views/contact.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/views/nameserver.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/views/record_template.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/views/registrar.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/views/view.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/views/zone.py +0 -0
- {netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/views/zone_template.py +0 -0
|
@@ -5,7 +5,7 @@ from ipam.choices import IPAddressStatusChoices
|
|
|
5
5
|
|
|
6
6
|
from netbox_dns.choices import RecordTypeChoices
|
|
7
7
|
|
|
8
|
-
__version__ = "1.
|
|
8
|
+
__version__ = "1.1.0b5"
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class DNSConfig(PluginConfig):
|
|
@@ -25,13 +25,13 @@ class DNSConfig(PluginConfig):
|
|
|
25
25
|
"zone_soa_retry": 7200,
|
|
26
26
|
"zone_soa_expire": 2419200,
|
|
27
27
|
"zone_soa_minimum": 3600,
|
|
28
|
-
"
|
|
29
|
-
"
|
|
28
|
+
"dnssync_disabled": False,
|
|
29
|
+
"dnssync_ipaddress_active_status": [
|
|
30
30
|
IPAddressStatusChoices.STATUS_ACTIVE,
|
|
31
31
|
IPAddressStatusChoices.STATUS_DHCP,
|
|
32
32
|
IPAddressStatusChoices.STATUS_SLAAC,
|
|
33
33
|
],
|
|
34
|
-
"
|
|
34
|
+
"dnssync_conflict_deactivate": False,
|
|
35
35
|
"tolerate_characters_in_zone_labels": "",
|
|
36
36
|
"tolerate_underscores_in_labels": False,
|
|
37
37
|
"tolerate_underscores_in_hostnames": False, # Deprecated, will be removed in 1.2.0
|
|
@@ -51,8 +51,9 @@ class DNSConfig(PluginConfig):
|
|
|
51
51
|
def ready(self):
|
|
52
52
|
super().ready()
|
|
53
53
|
|
|
54
|
-
if not settings.PLUGINS_CONFIG["netbox_dns"].get("
|
|
55
|
-
|
|
54
|
+
if not settings.PLUGINS_CONFIG["netbox_dns"].get("dnssync_disabled"):
|
|
55
|
+
import netbox_dns.signals.ipam_dnssync
|
|
56
|
+
import netbox_dns.tables.ipam_dnssync
|
|
56
57
|
|
|
57
58
|
|
|
58
59
|
#
|
|
@@ -4,6 +4,7 @@ from rest_framework.response import Response
|
|
|
4
4
|
from rest_framework.routers import APIRootView
|
|
5
5
|
|
|
6
6
|
from ipam.models import Prefix
|
|
7
|
+
from ipam.filtersets import PrefixFilterSet
|
|
7
8
|
|
|
8
9
|
from netbox.api.viewsets import NetBoxModelViewSet
|
|
9
10
|
|
|
@@ -160,3 +161,4 @@ class RecordTemplateViewSet(NetBoxModelViewSet):
|
|
|
160
161
|
class PrefixViewSet(NetBoxModelViewSet):
|
|
161
162
|
queryset = Prefix.objects.all()
|
|
162
163
|
serializer_class = PrefixSerializer
|
|
164
|
+
filterset_class = PrefixFilterSet
|
|
@@ -6,9 +6,6 @@ __all__ = ("PrefixDynamicModelMultipleChoiceField",)
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class PrefixDynamicModelMultipleChoiceField(DynamicModelMultipleChoiceField):
|
|
9
|
-
def __init__(self, *args, **kwargs):
|
|
10
|
-
super().__init__(*args, **kwargs)
|
|
11
|
-
|
|
12
9
|
widget = APISelectMultiple(api_url="/api/plugins/netbox-dns/prefixes")
|
|
13
10
|
|
|
14
11
|
def label_from_instance(self, obj):
|
|
@@ -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
|
)
|
|
@@ -27,7 +27,6 @@ from netbox_dns.models import View
|
|
|
27
27
|
from netbox_dns.fields import PrefixDynamicModelMultipleChoiceField
|
|
28
28
|
from netbox_dns.utilities import (
|
|
29
29
|
check_dns_records,
|
|
30
|
-
update_dns_records,
|
|
31
30
|
get_ip_addresses_by_prefix,
|
|
32
31
|
get_views_by_prefix,
|
|
33
32
|
)
|
|
@@ -96,7 +95,7 @@ class ViewForm(ViewPrefixUpdateMixin, TenancyForm, NetBoxModelForm):
|
|
|
96
95
|
def __init__(self, *args, **kwargs):
|
|
97
96
|
super().__init__(*args, **kwargs)
|
|
98
97
|
|
|
99
|
-
if settings.PLUGINS_CONFIG["netbox_dns"].get("
|
|
98
|
+
if settings.PLUGINS_CONFIG["netbox_dns"].get("dnssync_disabled"):
|
|
100
99
|
del self.fields["prefixes"]
|
|
101
100
|
|
|
102
101
|
if request := current_request.get():
|
|
@@ -145,7 +144,7 @@ class ViewFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
145
144
|
def __init__(self, *args, **kwargs):
|
|
146
145
|
super().__init__(*args, **kwargs)
|
|
147
146
|
|
|
148
|
-
if settings.PLUGINS_CONFIG["netbox_dns"].get("
|
|
147
|
+
if settings.PLUGINS_CONFIG["netbox_dns"].get("dnssync_disabled"):
|
|
149
148
|
del self.fields["prefix_id"]
|
|
150
149
|
|
|
151
150
|
model = View
|
|
@@ -181,7 +180,7 @@ class ViewImportForm(ViewPrefixUpdateMixin, NetBoxModelImportForm):
|
|
|
181
180
|
def __init__(self, *args, **kwargs):
|
|
182
181
|
super().__init__(*args, **kwargs)
|
|
183
182
|
|
|
184
|
-
if settings.PLUGINS_CONFIG["netbox_dns"].get("
|
|
183
|
+
if settings.PLUGINS_CONFIG["netbox_dns"].get("dnssync_disabled"):
|
|
185
184
|
del self.fields["prefixes"]
|
|
186
185
|
|
|
187
186
|
prefixes = CSVModelMultipleChoiceField(
|
|
@@ -81,7 +81,7 @@ class ZoneTemplateUpdateMixin:
|
|
|
81
81
|
else:
|
|
82
82
|
zone_data = self.cleaned_data.copy()
|
|
83
83
|
|
|
84
|
-
custom_fields =
|
|
84
|
+
custom_fields = {}
|
|
85
85
|
for key, value in zone_data.copy().items():
|
|
86
86
|
if key.startswith("cf_"):
|
|
87
87
|
custom_fields[key[3:]] = value
|
|
@@ -105,10 +105,7 @@ class ZoneTemplateUpdateMixin:
|
|
|
105
105
|
raise RollbackTransaction
|
|
106
106
|
|
|
107
107
|
except ValidationError as exc:
|
|
108
|
-
|
|
109
|
-
template_error = item.value()
|
|
110
|
-
else:
|
|
111
|
-
template_error = [exc]
|
|
108
|
+
self.add_error("template", exc.messages)
|
|
112
109
|
except RollbackTransaction:
|
|
113
110
|
pass
|
|
114
111
|
|
|
@@ -4,6 +4,8 @@ import strawberry
|
|
|
4
4
|
import strawberry_django
|
|
5
5
|
|
|
6
6
|
from netbox.graphql.types import NetBoxObjectType
|
|
7
|
+
from tenancy.graphql.types import TenantType
|
|
8
|
+
from ipam.graphql.types import IPAddressType, PrefixType
|
|
7
9
|
from netbox.graphql.scalars import BigInt
|
|
8
10
|
|
|
9
11
|
from netbox_dns.models import (
|
|
@@ -7,7 +7,7 @@ from ipam.models import IPAddress
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class Command(BaseCommand):
|
|
10
|
-
help = "Setup IPAddress custom fields for IPAM
|
|
10
|
+
help = "Setup IPAddress custom fields for IPAM DNSsync"
|
|
11
11
|
|
|
12
12
|
def add_arguments(self, parser):
|
|
13
13
|
parser.add_argument(
|
|
@@ -19,7 +19,7 @@ class Command(BaseCommand):
|
|
|
19
19
|
|
|
20
20
|
if options.get("remove"):
|
|
21
21
|
if options.get("verbosity"):
|
|
22
|
-
self.stdout.write(
|
|
22
|
+
self.stdout.write("Trying to remove IPAM DNSsync custom fields")
|
|
23
23
|
for cf in (
|
|
24
24
|
"ipaddress_dns_disabled",
|
|
25
25
|
"ipaddress_dns_record_ttl",
|
|
@@ -39,7 +39,7 @@ class Command(BaseCommand):
|
|
|
39
39
|
# Remove pre-existing IPAM Coupling custom fields
|
|
40
40
|
# -
|
|
41
41
|
if options.get("verbosity") >= 2:
|
|
42
|
-
self.stdout.write(
|
|
42
|
+
self.stdout.write("Trying to remove obsolete IPAM Coupling custom fields")
|
|
43
43
|
for cf in (
|
|
44
44
|
"ipaddress_dns_record_name",
|
|
45
45
|
"ipaddress_dns_zone_id",
|
|
@@ -54,25 +54,25 @@ class Command(BaseCommand):
|
|
|
54
54
|
pass
|
|
55
55
|
|
|
56
56
|
if options.get("verbosity") >= 2:
|
|
57
|
-
self.stdout.write(
|
|
57
|
+
self.stdout.write("Creating IPAM DNSsync custom fields")
|
|
58
58
|
|
|
59
59
|
if not CustomField.objects.filter(
|
|
60
60
|
name="ipaddress_dns_disabled",
|
|
61
61
|
type=CustomFieldTypeChoices.TYPE_BOOLEAN,
|
|
62
62
|
object_types=ipaddress_object_type,
|
|
63
63
|
).exists():
|
|
64
|
-
|
|
64
|
+
cf_dnssync_disabled = CustomField.objects.create(
|
|
65
65
|
name="ipaddress_dns_disabled",
|
|
66
|
-
label="Disable
|
|
66
|
+
label="Disable DNSsync",
|
|
67
67
|
description="Disable DNS address and pointer record generation for this address",
|
|
68
68
|
type=CustomFieldTypeChoices.TYPE_BOOLEAN,
|
|
69
69
|
required=False,
|
|
70
70
|
default=False,
|
|
71
|
-
group_name="
|
|
71
|
+
group_name="DNSsync",
|
|
72
72
|
is_cloneable=True,
|
|
73
73
|
weight=100,
|
|
74
74
|
)
|
|
75
|
-
|
|
75
|
+
cf_dnssync_disabled.object_types.set([ipaddress_object_type])
|
|
76
76
|
if options.get("verbosity"):
|
|
77
77
|
self.stdout.write("Created custom field 'ipaddress_dns_disabled'")
|
|
78
78
|
|
|
@@ -82,8 +82,8 @@ class Command(BaseCommand):
|
|
|
82
82
|
type=CustomFieldTypeChoices.TYPE_INTEGER,
|
|
83
83
|
object_types=ipaddress_object_type,
|
|
84
84
|
)
|
|
85
|
-
if cf_ttl.group_name != "
|
|
86
|
-
cf_ttl.group_name = "
|
|
85
|
+
if cf_ttl.group_name != "DNSsync":
|
|
86
|
+
cf_ttl.group_name = "DNSsync"
|
|
87
87
|
cf_ttl.description = ("TTL for DNS records created for this address",)
|
|
88
88
|
cf_ttl.save()
|
|
89
89
|
if options.get("verbosity"):
|
|
@@ -97,7 +97,7 @@ class Command(BaseCommand):
|
|
|
97
97
|
validation_minimum=0,
|
|
98
98
|
validation_maximum=2147483647,
|
|
99
99
|
required=False,
|
|
100
|
-
group_name="
|
|
100
|
+
group_name="DNSsync",
|
|
101
101
|
is_cloneable=True,
|
|
102
102
|
weight=200,
|
|
103
103
|
)
|
|
@@ -111,8 +111,8 @@ class Command(BaseCommand):
|
|
|
111
111
|
type=CustomFieldTypeChoices.TYPE_BOOLEAN,
|
|
112
112
|
object_types=ipaddress_object_type,
|
|
113
113
|
)
|
|
114
|
-
if cf_disable_ptr.group_name != "
|
|
115
|
-
cf_disable_ptr.group_name = "
|
|
114
|
+
if cf_disable_ptr.group_name != "DNSsync":
|
|
115
|
+
cf_disable_ptr.group_name = "DNSsync"
|
|
116
116
|
cf_disable_ptr.description = (
|
|
117
117
|
"Disable DNS PTR record generation for this address",
|
|
118
118
|
)
|
|
@@ -129,7 +129,7 @@ class Command(BaseCommand):
|
|
|
129
129
|
type=CustomFieldTypeChoices.TYPE_BOOLEAN,
|
|
130
130
|
required=False,
|
|
131
131
|
default=False,
|
|
132
|
-
group_name="
|
|
132
|
+
group_name="DNSsync",
|
|
133
133
|
is_cloneable=True,
|
|
134
134
|
weight=300,
|
|
135
135
|
)
|
|
@@ -58,7 +58,7 @@ def record_data_from_ip_address(ip_address, zone):
|
|
|
58
58
|
RecordStatusChoices.STATUS_ACTIVE
|
|
59
59
|
if ip_address.status
|
|
60
60
|
in settings.PLUGINS_CONFIG["netbox_dns"].get(
|
|
61
|
-
"
|
|
61
|
+
"dnssync_ipaddress_active_status", []
|
|
62
62
|
)
|
|
63
63
|
else RecordStatusChoices.STATUS_INACTIVE
|
|
64
64
|
),
|
|
@@ -576,7 +576,7 @@ class Record(ObjectModificationMixin, NetBoxModel):
|
|
|
576
576
|
if not records.filter(
|
|
577
577
|
ipam_ip_address__isnull=True
|
|
578
578
|
).exists() or get_plugin_config(
|
|
579
|
-
"netbox_dns", "
|
|
579
|
+
"netbox_dns", "dnssync_conflict_deactivate", False
|
|
580
580
|
):
|
|
581
581
|
return
|
|
582
582
|
|
|
@@ -590,7 +590,7 @@ class Record(ObjectModificationMixin, NetBoxModel):
|
|
|
590
590
|
if self.ipam_ip_address is None or not self.is_active:
|
|
591
591
|
return
|
|
592
592
|
|
|
593
|
-
if not get_plugin_config("netbox_dns", "
|
|
593
|
+
if not get_plugin_config("netbox_dns", "dnssync_conflict_deactivate", False):
|
|
594
594
|
return
|
|
595
595
|
|
|
596
596
|
records = Record.objects.filter(
|
|
@@ -633,7 +633,7 @@ class Record(ObjectModificationMixin, NetBoxModel):
|
|
|
633
633
|
if not records.exists():
|
|
634
634
|
return
|
|
635
635
|
|
|
636
|
-
conflicting_ttls = ", ".join(
|
|
636
|
+
conflicting_ttls = ", ".join({str(record.ttl) for record in records})
|
|
637
637
|
raise ValidationError(
|
|
638
638
|
{
|
|
639
639
|
"ttl": f"There is at least one active {self.type} record for name {self.name} in zone {self.zone} and TTL is different ({conflicting_ttls})."
|
|
@@ -18,23 +18,22 @@ from netbox_dns.utilities import (
|
|
|
18
18
|
delete_dns_records,
|
|
19
19
|
get_views_by_prefix,
|
|
20
20
|
get_ip_addresses_by_prefix,
|
|
21
|
-
get_ip_addresses_by_view,
|
|
22
21
|
)
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
DNSSYNC_CUSTOM_FIELDS = {
|
|
25
24
|
"ipaddress_dns_disabled": False,
|
|
26
25
|
"ipaddress_dns_record_ttl": None,
|
|
27
26
|
"ipaddress_dns_record_disable_ptr": False,
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
IPADDRESS_ACTIVE_STATUS = settings.PLUGINS_CONFIG["netbox_dns"][
|
|
31
|
-
"
|
|
30
|
+
"dnssync_ipaddress_active_status"
|
|
32
31
|
]
|
|
33
32
|
ENFORCE_UNIQUE_RECORDS = settings.PLUGINS_CONFIG["netbox_dns"]["enforce_unique_records"]
|
|
34
33
|
|
|
35
34
|
|
|
36
35
|
@receiver(post_clean, sender=IPAddress)
|
|
37
|
-
def
|
|
36
|
+
def ipam_dnssync_ipaddress_post_clean(instance, **kwargs):
|
|
38
37
|
if not isinstance(instance.address, IPNetwork):
|
|
39
38
|
return
|
|
40
39
|
|
|
@@ -82,7 +81,7 @@ def ipam_autodns_ipaddress_post_clean(instance, **kwargs):
|
|
|
82
81
|
!= IPAddress.objects.get(pk=instance.pk).custom_field_data.get(
|
|
83
82
|
cf, cf_default
|
|
84
83
|
)
|
|
85
|
-
for cf, cf_default in
|
|
84
|
+
for cf, cf_default in DNSSYNC_CUSTOM_FIELDS.items()
|
|
86
85
|
)
|
|
87
86
|
)
|
|
88
87
|
and not check_record_permission()
|
|
@@ -91,13 +90,13 @@ def ipam_autodns_ipaddress_post_clean(instance, **kwargs):
|
|
|
91
90
|
and any(
|
|
92
91
|
(
|
|
93
92
|
cf_data.get(cf, cf_default) != cf_default
|
|
94
|
-
for cf, cf_default in
|
|
93
|
+
for cf, cf_default in DNSSYNC_CUSTOM_FIELDS.items()
|
|
95
94
|
)
|
|
96
95
|
)
|
|
97
96
|
and not check_record_permission(change=False, delete=False)
|
|
98
97
|
):
|
|
99
98
|
raise ValidationError(
|
|
100
|
-
f"User '{request.user}' is not allowed to alter
|
|
99
|
+
f"User '{request.user}' is not allowed to alter DNSsync custom fields"
|
|
101
100
|
)
|
|
102
101
|
|
|
103
102
|
try:
|
|
@@ -107,22 +106,22 @@ def ipam_autodns_ipaddress_post_clean(instance, **kwargs):
|
|
|
107
106
|
|
|
108
107
|
|
|
109
108
|
@receiver(pre_delete, sender=IPAddress)
|
|
110
|
-
def
|
|
109
|
+
def ipam_dnssync_ipaddress_pre_delete(instance, **kwargs):
|
|
111
110
|
delete_dns_records(instance)
|
|
112
111
|
|
|
113
112
|
|
|
114
113
|
@receiver(pre_save, sender=IPAddress)
|
|
115
|
-
def
|
|
114
|
+
def ipam_dnssync_ipaddress_pre_save(instance, **kwargs):
|
|
116
115
|
check_dns_records(instance)
|
|
117
116
|
|
|
118
117
|
|
|
119
118
|
@receiver(post_save, sender=IPAddress)
|
|
120
|
-
def
|
|
119
|
+
def ipam_dnssync_ipaddress_post_save(instance, **kwargs):
|
|
121
120
|
update_dns_records(instance)
|
|
122
121
|
|
|
123
122
|
|
|
124
123
|
@receiver(pre_save, sender=Prefix)
|
|
125
|
-
def
|
|
124
|
+
def ipam_dnssync_prefix_pre_save(instance, **kwargs):
|
|
126
125
|
"""
|
|
127
126
|
Changes that modify the prefix hierarchy cannot be validated properly before
|
|
128
127
|
commiting them. So the solution in this case is to ask the user to deassign
|
|
@@ -151,7 +150,7 @@ def ipam_autodns_prefix_pre_save(instance, **kwargs):
|
|
|
151
150
|
|
|
152
151
|
|
|
153
152
|
@receiver(pre_delete, sender=Prefix)
|
|
154
|
-
def
|
|
153
|
+
def ipam_dnssync_prefix_pre_delete(instance, **kwargs):
|
|
155
154
|
parent = instance.get_parents().last()
|
|
156
155
|
request = current_request.get()
|
|
157
156
|
|
|
@@ -195,7 +194,7 @@ def ipam_autodns_prefix_pre_delete(instance, **kwargs):
|
|
|
195
194
|
|
|
196
195
|
|
|
197
196
|
@receiver(m2m_changed, sender=_view.View.prefixes.through)
|
|
198
|
-
def
|
|
197
|
+
def ipam_dnssync_view_prefix_changed(**kwargs):
|
|
199
198
|
action = kwargs.get("action")
|
|
200
199
|
request = current_request.get()
|
|
201
200
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import django_tables2 as tables
|
|
2
|
+
|
|
3
|
+
from ipam.tables import PrefixTable
|
|
4
|
+
from utilities.tables import register_table_column
|
|
5
|
+
|
|
6
|
+
views = tables.ManyToManyColumn(
|
|
7
|
+
verbose_name="DNS Views",
|
|
8
|
+
linkify_item=True,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
register_table_column(views, "netbox_dns_views", PrefixTable)
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import django_tables2 as tables
|
|
2
|
+
from django_tables2.utils import Accessor
|
|
3
|
+
from django.utils.html import format_html
|
|
4
|
+
|
|
2
5
|
|
|
3
6
|
from netbox.tables import (
|
|
4
7
|
NetBoxTable,
|
|
@@ -6,11 +9,16 @@ from netbox.tables import (
|
|
|
6
9
|
TagColumn,
|
|
7
10
|
ActionsColumn,
|
|
8
11
|
)
|
|
12
|
+
from ipam.lookups import Host, Inet
|
|
9
13
|
from tenancy.tables import TenancyColumnsMixin
|
|
10
14
|
|
|
11
15
|
from netbox_dns.models import Record
|
|
12
16
|
from netbox_dns.utilities import value_to_unicode
|
|
13
17
|
|
|
18
|
+
import logging
|
|
19
|
+
|
|
20
|
+
logger = logging.getLogger("netbox_dns")
|
|
21
|
+
|
|
14
22
|
|
|
15
23
|
__all__ = (
|
|
16
24
|
"RecordTable",
|
|
@@ -100,6 +108,11 @@ class ManagedRecordTable(RecordBaseTable):
|
|
|
100
108
|
verbose_name="IPAM IP Address",
|
|
101
109
|
linkify=True,
|
|
102
110
|
)
|
|
111
|
+
related_ip_address = tables.Column(
|
|
112
|
+
verbose_name="Related IP Address",
|
|
113
|
+
empty_values=(),
|
|
114
|
+
orderable=False,
|
|
115
|
+
)
|
|
103
116
|
actions = ActionsColumn(actions=("changelog",))
|
|
104
117
|
|
|
105
118
|
class Meta(NetBoxTable.Meta):
|
|
@@ -113,6 +126,7 @@ class ManagedRecordTable(RecordBaseTable):
|
|
|
113
126
|
"unicode_value",
|
|
114
127
|
"address_record",
|
|
115
128
|
"ipam_ip_address",
|
|
129
|
+
"related_ip_address",
|
|
116
130
|
"active",
|
|
117
131
|
)
|
|
118
132
|
default_columns = (
|
|
@@ -124,6 +138,28 @@ class ManagedRecordTable(RecordBaseTable):
|
|
|
124
138
|
"active",
|
|
125
139
|
)
|
|
126
140
|
|
|
141
|
+
def render_related_ip_address(self, record):
|
|
142
|
+
if record.ipam_ip_address is not None:
|
|
143
|
+
address = record.ipam_ip_address
|
|
144
|
+
elif (
|
|
145
|
+
hasattr(record, "address_record")
|
|
146
|
+
and record.address_record.ipam_ip_address is not None
|
|
147
|
+
):
|
|
148
|
+
address = record.address_record.ipam_ip_address
|
|
149
|
+
else:
|
|
150
|
+
return format_html("—")
|
|
151
|
+
|
|
152
|
+
return format_html(f"<a href='{address.get_absolute_url()}'>{address}</a>")
|
|
153
|
+
|
|
154
|
+
def value_related_ip_address(self, record):
|
|
155
|
+
if record.ipam_ip_address is not None:
|
|
156
|
+
return record.ipam_ip_address
|
|
157
|
+
elif (
|
|
158
|
+
hasattr(record, "address_record")
|
|
159
|
+
and record.address_record.ipam_ip_address is not None
|
|
160
|
+
):
|
|
161
|
+
return record.address_record.ipam_ip_address
|
|
162
|
+
|
|
127
163
|
|
|
128
164
|
class RelatedRecordTable(RecordBaseTable):
|
|
129
165
|
actions = ActionsColumn(actions=())
|
|
@@ -4,7 +4,7 @@ from django.urls import reverse
|
|
|
4
4
|
from netbox.plugins.utils import get_plugin_config
|
|
5
5
|
from netbox.plugins import PluginTemplateExtension
|
|
6
6
|
|
|
7
|
-
from netbox_dns.models import Record
|
|
7
|
+
from netbox_dns.models import Record
|
|
8
8
|
from netbox_dns.choices import RecordTypeChoices
|
|
9
9
|
from netbox_dns.tables import RelatedRecordTable, RelatedViewTable
|
|
10
10
|
from netbox_dns.utilities import get_views_by_prefix
|
|
@@ -114,7 +114,7 @@ class IPRelatedDNSRecords(PluginTemplateExtension):
|
|
|
114
114
|
)
|
|
115
115
|
|
|
116
116
|
|
|
117
|
-
if not settings.PLUGINS_CONFIG["netbox_dns"].get("
|
|
117
|
+
if not settings.PLUGINS_CONFIG["netbox_dns"].get("dnssync_disabled"):
|
|
118
118
|
template_extensions = [RelatedDNSRecords, RelatedDNSViews]
|
|
119
119
|
else:
|
|
120
120
|
template_extensions = []
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/view.html
RENAMED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
</div>
|
|
36
36
|
<div class="col col-md-6">
|
|
37
37
|
{% include 'inc/panels/tags.html' %}
|
|
38
|
-
{% if not settings.PLUGINS_CONFIG.netbox_dns.
|
|
38
|
+
{% if not settings.PLUGINS_CONFIG.netbox_dns.dnssync_disabled %}
|
|
39
39
|
<div class="card">
|
|
40
40
|
<h5 class="card-header">
|
|
41
41
|
IPAM Prefixes
|
|
@@ -13,6 +13,7 @@ from ipam.models import IPAddress, Prefix
|
|
|
13
13
|
from netbox_dns.models import zone as _zone
|
|
14
14
|
from netbox_dns.models import record as _record
|
|
15
15
|
from netbox_dns.models import view as _view
|
|
16
|
+
from netbox_dns.choices import RecordStatusChoices
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
__all__ = (
|
|
@@ -46,7 +47,7 @@ def _get_record_status(ip_address):
|
|
|
46
47
|
RecordStatusChoices.STATE_ACTIVE
|
|
47
48
|
if ip_address.status
|
|
48
49
|
in settings.PLUGINS_CONFIG["netbox_dns"].get(
|
|
49
|
-
"
|
|
50
|
+
"dnssync_ipaddress_active_status", []
|
|
50
51
|
)
|
|
51
52
|
else RecordStatusChoices.STATUS_INACTIVE
|
|
52
53
|
)
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
from dns import name as dns_name
|
|
2
2
|
|
|
3
|
+
from django.db.models import F, Q, Case, When, OuterRef, Subquery
|
|
4
|
+
|
|
3
5
|
from netbox.views import generic
|
|
6
|
+
from ipam.fields import IPAddressField
|
|
7
|
+
from ipam.models import IPAddress
|
|
4
8
|
|
|
5
9
|
from netbox_dns.filtersets import RecordFilterSet
|
|
6
10
|
from netbox_dns.forms import (
|
|
@@ -37,9 +41,7 @@ class RecordListView(generic.ObjectListView):
|
|
|
37
41
|
|
|
38
42
|
|
|
39
43
|
class ManagedRecordListView(generic.ObjectListView):
|
|
40
|
-
queryset = Record.objects.
|
|
41
|
-
"zone", "address_record"
|
|
42
|
-
)
|
|
44
|
+
queryset = Record.objects.prefetch_related("ipam_ip_address", "address_record")
|
|
43
45
|
filterset = RecordFilterSet
|
|
44
46
|
filterset_form = RecordFilterForm
|
|
45
47
|
table = ManagedRecordTable
|
|
@@ -90,11 +92,11 @@ class RecordView(generic.ObjectView):
|
|
|
90
92
|
zone=parent_zone,
|
|
91
93
|
)
|
|
92
94
|
cname_records = cname_records.union(
|
|
93
|
-
|
|
95
|
+
{
|
|
94
96
|
record
|
|
95
97
|
for record in parent_cname_records
|
|
96
98
|
if record.value_fqdn == instance.fqdn
|
|
97
|
-
|
|
99
|
+
}
|
|
98
100
|
)
|
|
99
101
|
|
|
100
102
|
if cname_records:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/serializers_/__init__.py
RENAMED
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/serializers_/contact.py
RENAMED
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/serializers_/nameserver.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/serializers_/record_template.py
RENAMED
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/serializers_/registrar.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/api/serializers_/zone_template.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/filtersets/record_template.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/filtersets/zone_template.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/management/commands/update_soa.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0003_default_view.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0006_templating.py
RENAMED
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0007_view_prefixes.py
RENAMED
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0020_netbox_3_4.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0025_ipam_coupling_cf.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0028_rfc2317_fields.py
RENAMED
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/migrations/0029_record_fqdn.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/mixins/object_modification.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/contact.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/record.html
RENAMED
|
File without changes
|
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/registrar.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/zone/base.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_plugin_dns-1.1b3 → netbox_plugin_dns-1.1.0b5}/netbox_dns/templates/netbox_dns/zone.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|