netbox-plugin-dns 1.0.6__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of netbox-plugin-dns might be problematic. Click here for more details.
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/PKG-INFO +2 -1
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/README.md +1 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/__init__.py +23 -4
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/api/nested_serializers.py +17 -16
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/api/serializers.py +2 -1
- netbox_plugin_dns-1.1.0/netbox_dns/api/serializers_/prefix.py +18 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/api/serializers_/record.py +1 -0
- netbox_plugin_dns-1.0.6/netbox_dns/api/serializers_/contact.py → netbox_plugin_dns-1.1.0/netbox_dns/api/serializers_/registration_contact.py +5 -5
- netbox_plugin_dns-1.1.0/netbox_dns/api/serializers_/view.py +69 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/api/serializers_/zone.py +5 -5
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/api/serializers_/zone_template.py +5 -5
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/api/urls.py +5 -2
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/api/views.py +17 -35
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/fields/__init__.py +1 -0
- netbox_plugin_dns-1.1.0/netbox_dns/fields/ipam.py +15 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/filtersets/__init__.py +1 -1
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/filtersets/record.py +1 -1
- netbox_plugin_dns-1.0.6/netbox_dns/filtersets/contact.py → netbox_plugin_dns-1.1.0/netbox_dns/filtersets/registration_contact.py +4 -4
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/filtersets/view.py +16 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/filtersets/zone.py +15 -15
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/filtersets/zone_template.py +15 -15
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/forms/__init__.py +1 -1
- netbox_plugin_dns-1.0.6/netbox_dns/forms/contact.py → netbox_plugin_dns-1.1.0/netbox_dns/forms/registration_contact.py +16 -16
- netbox_plugin_dns-1.1.0/netbox_dns/forms/view.py +290 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/forms/zone.py +15 -18
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/forms/zone_template.py +13 -13
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/graphql/__init__.py +2 -2
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/graphql/filters.py +5 -5
- netbox_plugin_dns-1.1.0/netbox_dns/graphql/schema.py +83 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/graphql/types.py +41 -12
- netbox_plugin_dns-1.1.0/netbox_dns/management/commands/rebuild_dnssync.py +18 -0
- netbox_plugin_dns-1.1.0/netbox_dns/management/commands/setup_dnssync.py +140 -0
- netbox_plugin_dns-1.1.0/netbox_dns/migrations/0007_alter_ordering_options.py +25 -0
- netbox_plugin_dns-1.1.0/netbox_dns/migrations/0008_view_prefixes.py +18 -0
- netbox_plugin_dns-1.1.0/netbox_dns/migrations/0009_rename_contact_registrationcontact.py +27 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/models/__init__.py +1 -3
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/models/nameserver.py +8 -3
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/models/record.py +154 -24
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/models/record_template.py +4 -1
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/models/registrar.py +7 -1
- netbox_plugin_dns-1.0.6/netbox_dns/models/contact.py → netbox_plugin_dns-1.1.0/netbox_dns/models/registration_contact.py +15 -9
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/models/view.py +14 -2
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/models/zone.py +76 -35
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/models/zone_template.py +12 -9
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/navigation.py +7 -7
- netbox_plugin_dns-1.1.0/netbox_dns/signals/ipam_dnssync.py +224 -0
- {netbox_plugin_dns-1.0.6/netbox_dns/views → netbox_plugin_dns-1.1.0/netbox_dns/tables}/__init__.py +1 -1
- netbox_plugin_dns-1.1.0/netbox_dns/tables/ipam_dnssync.py +11 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/tables/nameserver.py +1 -7
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/tables/record.py +43 -30
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/tables/record_template.py +0 -17
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/tables/registrar.py +0 -2
- netbox_plugin_dns-1.0.6/netbox_dns/tables/contact.py → netbox_plugin_dns-1.1.0/netbox_dns/tables/registration_contact.py +5 -6
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/tables/view.py +19 -4
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/tables/zone.py +0 -15
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/tables/zone_template.py +2 -16
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/template_content.py +41 -40
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/templates/netbox_dns/record.html +6 -6
- netbox_plugin_dns-1.0.6/netbox_dns/templates/netbox_dns/contact.html → netbox_plugin_dns-1.1.0/netbox_dns/templates/netbox_dns/registrationcontact.html +1 -1
- netbox_plugin_dns-1.1.0/netbox_dns/templates/netbox_dns/view/button.html +9 -0
- netbox_plugin_dns-1.1.0/netbox_dns/templates/netbox_dns/view/prefix.html +41 -0
- netbox_plugin_dns-1.1.0/netbox_dns/templates/netbox_dns/view/related.html +17 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/templates/netbox_dns/view.html +25 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/urls/__init__.py +2 -2
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/urls/nameserver.py +14 -38
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/urls/record.py +7 -19
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/urls/record_template.py +18 -27
- netbox_plugin_dns-1.1.0/netbox_dns/urls/registrar.py +39 -0
- netbox_plugin_dns-1.1.0/netbox_dns/urls/registration_contact.py +60 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/urls/view.py +12 -20
- netbox_plugin_dns-1.1.0/netbox_dns/urls/zone.py +25 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/urls/zone_template.py +16 -26
- netbox_plugin_dns-1.1.0/netbox_dns/utilities/__init__.py +2 -0
- netbox_plugin_dns-1.0.6/netbox_dns/utilities/__init__.py → netbox_plugin_dns-1.1.0/netbox_dns/utilities/conversions.py +9 -0
- netbox_plugin_dns-1.1.0/netbox_dns/utilities/ipam_dnssync.py +295 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/validators/dns_name.py +9 -0
- {netbox_plugin_dns-1.0.6/netbox_dns/tables → netbox_plugin_dns-1.1.0/netbox_dns/views}/__init__.py +1 -1
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/views/nameserver.py +7 -3
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/views/record.py +12 -7
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/views/registrar.py +0 -1
- netbox_plugin_dns-1.1.0/netbox_dns/views/registration_contact.py +94 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/views/view.py +32 -2
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/views/zone.py +7 -6
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/pyproject.toml +1 -1
- netbox_plugin_dns-1.0.6/netbox_dns/api/serializers_/view.py +0 -37
- netbox_plugin_dns-1.0.6/netbox_dns/forms/view.py +0 -90
- netbox_plugin_dns-1.0.6/netbox_dns/graphql/schema.py +0 -103
- netbox_plugin_dns-1.0.6/netbox_dns/management/commands/setup_coupling.py +0 -109
- netbox_plugin_dns-1.0.6/netbox_dns/signals/ipam_coupling.py +0 -168
- netbox_plugin_dns-1.0.6/netbox_dns/templates/netbox_dns/related_dns_objects.html +0 -21
- netbox_plugin_dns-1.0.6/netbox_dns/urls/contact.py +0 -51
- netbox_plugin_dns-1.0.6/netbox_dns/urls/registrar.py +0 -63
- netbox_plugin_dns-1.0.6/netbox_dns/urls/zone.py +0 -63
- netbox_plugin_dns-1.0.6/netbox_dns/utilities/ipam_coupling.py +0 -112
- netbox_plugin_dns-1.0.6/netbox_dns/views/contact.py +0 -95
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/LICENSE +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/api/serializers_/__init__.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/api/serializers_/nameserver.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/api/serializers_/record_template.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/api/serializers_/registrar.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/apps.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/choices/__init__.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/choices/record.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/choices/zone.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/fields/address.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/fields/network.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/fields/rfc2317.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/filtersets/nameserver.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/filtersets/record_template.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/filtersets/registrar.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/forms/nameserver.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/forms/record.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/forms/record_template.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/forms/registrar.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/management/commands/cleanup_database.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/management/commands/cleanup_rrset_ttl.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/management/commands/update_soa.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/migrations/0001_squashed_netbox_dns_0_15.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/migrations/0001_squashed_netbox_dns_0_22.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/migrations/0002_contact_description_registrar_description.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/migrations/0003_default_view.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/migrations/0004_create_and_assign_default_view.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/migrations/0005_alter_zone_view_not_null.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/migrations/0006_templating.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/migrations/0020_netbox_3_4.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/migrations/0021_record_ip_address.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/migrations/0022_search.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/migrations/0023_alter_record_value.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/migrations/0024_tenancy.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/migrations/0025_ipam_coupling_cf.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/migrations/0026_domain_registration.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/migrations/0027_alter_registrar_iana_id.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/migrations/0028_rfc2317_fields.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/migrations/0029_record_fqdn.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/migrations/__init__.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/mixins/__init__.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/mixins/object_modification.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/signals/__init__.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/templates/netbox_dns/nameserver.html +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/templates/netbox_dns/record/managed.html +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/templates/netbox_dns/record/related.html +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/templates/netbox_dns/recordtemplate.html +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/templates/netbox_dns/registrar.html +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/templates/netbox_dns/zone/base.html +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/templates/netbox_dns/zone/child.html +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/templates/netbox_dns/zone/child_zone.html +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/templates/netbox_dns/zone/managed_record.html +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/templates/netbox_dns/zone/record.html +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/templates/netbox_dns/zone/registration.html +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/templates/netbox_dns/zone/rfc2317_child_zone.html +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/templates/netbox_dns/zone.html +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/templates/netbox_dns/zonetemplate.html +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/validators/__init__.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/validators/dns_value.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/validators/rfc2317.py +0 -0
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/views/record_template.py +1 -1
- {netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/views/zone_template.py +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: netbox-plugin-dns
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: NetBox DNS is a NetBox plugin for managing DNS data.
|
|
5
5
|
Home-page: https://github.com/peteeckel/netbox-plugin-dns
|
|
6
6
|
License: MIT
|
|
@@ -48,6 +48,7 @@ The main focus of the plugin is to ensure the quality of the data stored in it.
|
|
|
48
48
|
* Validation of record types such as CNAME and singletons, to ensure DNS zone validity
|
|
49
49
|
* Support for [RFC 2317](https://datatracker.ietf.org/doc/html/rfc2317) delegation of PTR zones for IPv4 subnets longer than 24 bits
|
|
50
50
|
* Templating for zones and records enables faster creations of zones with given boilerplate object relations, such as name servers, tags, tenants or registration information, or records like standard SPF or MX records that are the same for a subset of zones
|
|
51
|
+
* IPAM DNSsync can be used to automatically create address and pointer records for IP addresses by assigning prefixes to DNS views. When an IP address has a DNS name assigned and there are zones with matching names in the DNS views linked to the IP address' prefix, a matching DNS record will be created in these zones
|
|
51
52
|
|
|
52
53
|
Other main features include:
|
|
53
54
|
|
|
@@ -28,6 +28,7 @@ The main focus of the plugin is to ensure the quality of the data stored in it.
|
|
|
28
28
|
* Validation of record types such as CNAME and singletons, to ensure DNS zone validity
|
|
29
29
|
* Support for [RFC 2317](https://datatracker.ietf.org/doc/html/rfc2317) delegation of PTR zones for IPv4 subnets longer than 24 bits
|
|
30
30
|
* Templating for zones and records enables faster creations of zones with given boilerplate object relations, such as name servers, tags, tenants or registration information, or records like standard SPF or MX records that are the same for a subset of zones
|
|
31
|
+
* IPAM DNSsync can be used to automatically create address and pointer records for IP addresses by assigning prefixes to DNS views. When an IP address has a DNS name assigned and there are zones with matching names in the DNS views linked to the IP address' prefix, a matching DNS record will be created in these zones
|
|
31
32
|
|
|
32
33
|
Other main features include:
|
|
33
34
|
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
from django.conf import settings
|
|
2
|
+
|
|
1
3
|
from netbox.plugins import PluginConfig
|
|
4
|
+
from ipam.choices import IPAddressStatusChoices
|
|
5
|
+
|
|
6
|
+
from netbox_dns.choices import RecordTypeChoices
|
|
2
7
|
|
|
3
|
-
__version__ = "1.0
|
|
8
|
+
__version__ = "1.1.0"
|
|
4
9
|
|
|
5
10
|
|
|
6
11
|
class DNSConfig(PluginConfig):
|
|
@@ -20,13 +25,20 @@ class DNSConfig(PluginConfig):
|
|
|
20
25
|
"zone_soa_retry": 7200,
|
|
21
26
|
"zone_soa_expire": 2419200,
|
|
22
27
|
"zone_soa_minimum": 3600,
|
|
23
|
-
"
|
|
28
|
+
"dnssync_disabled": False,
|
|
29
|
+
"dnssync_ipaddress_active_status": [
|
|
30
|
+
IPAddressStatusChoices.STATUS_ACTIVE,
|
|
31
|
+
IPAddressStatusChoices.STATUS_DHCP,
|
|
32
|
+
IPAddressStatusChoices.STATUS_SLAAC,
|
|
33
|
+
],
|
|
34
|
+
"dnssync_conflict_deactivate": False,
|
|
35
|
+
"dnssync_minimum_zone_labels": 2,
|
|
24
36
|
"tolerate_characters_in_zone_labels": "",
|
|
25
37
|
"tolerate_underscores_in_labels": False,
|
|
26
38
|
"tolerate_underscores_in_hostnames": False, # Deprecated, will be removed in 1.2.0
|
|
27
39
|
"tolerate_leading_underscore_types": [
|
|
28
|
-
|
|
29
|
-
|
|
40
|
+
RecordTypeChoices.TXT,
|
|
41
|
+
RecordTypeChoices.SRV,
|
|
30
42
|
],
|
|
31
43
|
"tolerate_non_rfc1035_types": [],
|
|
32
44
|
"enable_root_zones": False,
|
|
@@ -37,6 +49,13 @@ class DNSConfig(PluginConfig):
|
|
|
37
49
|
}
|
|
38
50
|
base_url = "netbox-dns"
|
|
39
51
|
|
|
52
|
+
def ready(self):
|
|
53
|
+
super().ready()
|
|
54
|
+
|
|
55
|
+
if not settings.PLUGINS_CONFIG["netbox_dns"].get("dnssync_disabled"):
|
|
56
|
+
import netbox_dns.signals.ipam_dnssync
|
|
57
|
+
import netbox_dns.tables.ipam_dnssync
|
|
58
|
+
|
|
40
59
|
|
|
41
60
|
#
|
|
42
61
|
# Initialize plugin config
|
|
@@ -59,6 +59,22 @@ class NestedZoneSerializer(WritableNestedSerializer):
|
|
|
59
59
|
]
|
|
60
60
|
|
|
61
61
|
|
|
62
|
+
class NestedZoneTemplateSerializer(WritableNestedSerializer):
|
|
63
|
+
url = serializers.HyperlinkedIdentityField(
|
|
64
|
+
view_name="plugins-api:netbox_dns-api:zonetemplate-detail"
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
class Meta:
|
|
68
|
+
model = ZoneTemplate
|
|
69
|
+
fields = (
|
|
70
|
+
"id",
|
|
71
|
+
"url",
|
|
72
|
+
"name",
|
|
73
|
+
"display",
|
|
74
|
+
"description",
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
|
|
62
78
|
class NestedRecordSerializer(WritableNestedSerializer):
|
|
63
79
|
url = serializers.HyperlinkedIdentityField(
|
|
64
80
|
view_name="plugins-api:netbox_dns-api:record-detail"
|
|
@@ -86,6 +102,7 @@ class NestedRecordSerializer(WritableNestedSerializer):
|
|
|
86
102
|
"status",
|
|
87
103
|
"ttl",
|
|
88
104
|
"zone",
|
|
105
|
+
"managed",
|
|
89
106
|
"active",
|
|
90
107
|
]
|
|
91
108
|
|
|
@@ -109,19 +126,3 @@ class NestedRecordTemplateSerializer(WritableNestedSerializer):
|
|
|
109
126
|
"ttl",
|
|
110
127
|
"description",
|
|
111
128
|
)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
class NestedZoneTemplateSerializer(WritableNestedSerializer):
|
|
115
|
-
url = serializers.HyperlinkedIdentityField(
|
|
116
|
-
view_name="plugins-api:netbox_dns-api:zonetemplate-detail"
|
|
117
|
-
)
|
|
118
|
-
|
|
119
|
-
class Meta:
|
|
120
|
-
model = ZoneTemplate
|
|
121
|
-
fields = (
|
|
122
|
-
"id",
|
|
123
|
-
"url",
|
|
124
|
-
"name",
|
|
125
|
-
"display",
|
|
126
|
-
"description",
|
|
127
|
-
)
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
from .serializers_.contact import *
|
|
2
1
|
from .serializers_.nameserver import *
|
|
3
2
|
from .serializers_.record import *
|
|
4
3
|
from .serializers_.registrar import *
|
|
4
|
+
from .serializers_.registration_contact import *
|
|
5
5
|
from .serializers_.view import *
|
|
6
6
|
from .serializers_.zone import *
|
|
7
7
|
from .serializers_.zone_template import *
|
|
8
8
|
from .serializers_.record_template import *
|
|
9
|
+
from .serializers_.prefix import *
|
|
9
10
|
|
|
10
11
|
from .nested_serializers import *
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from rest_framework.serializers import HyperlinkedIdentityField
|
|
2
|
+
|
|
3
|
+
from ipam.api.serializers import PrefixSerializer as IPAMPrefixSerializer
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
__all__ = ("PrefixSerializer",)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class PrefixSerializer(IPAMPrefixSerializer):
|
|
10
|
+
url = HyperlinkedIdentityField(view_name="plugins-api:netbox_dns-api:prefix-detail")
|
|
11
|
+
|
|
12
|
+
def to_representation(self, instance):
|
|
13
|
+
representation = super().to_representation(instance)
|
|
14
|
+
|
|
15
|
+
if instance.vrf is not None:
|
|
16
|
+
representation["display"] += f" [{instance.vrf.name}]"
|
|
17
|
+
|
|
18
|
+
return representation
|
|
@@ -2,19 +2,19 @@ from rest_framework import serializers
|
|
|
2
2
|
|
|
3
3
|
from netbox.api.serializers import NetBoxModelSerializer
|
|
4
4
|
|
|
5
|
-
from netbox_dns.models import
|
|
5
|
+
from netbox_dns.models import RegistrationContact
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
__all__ = ("
|
|
8
|
+
__all__ = ("RegistrationContactSerializer",)
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class
|
|
11
|
+
class RegistrationContactSerializer(NetBoxModelSerializer):
|
|
12
12
|
url = serializers.HyperlinkedIdentityField(
|
|
13
|
-
view_name="plugins-api:netbox_dns-api:
|
|
13
|
+
view_name="plugins-api:netbox_dns-api:registrationcontact-detail"
|
|
14
14
|
)
|
|
15
15
|
|
|
16
16
|
class Meta:
|
|
17
|
-
model =
|
|
17
|
+
model = RegistrationContact
|
|
18
18
|
fields = (
|
|
19
19
|
"id",
|
|
20
20
|
"url",
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
from rest_framework import serializers
|
|
2
|
+
|
|
3
|
+
from netbox.api.serializers import NetBoxModelSerializer
|
|
4
|
+
from tenancy.api.serializers import TenantSerializer
|
|
5
|
+
from ipam.api.serializers import PrefixSerializer
|
|
6
|
+
|
|
7
|
+
from netbox_dns.models import View
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
__all__ = ("ViewSerializer",)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ViewSerializer(NetBoxModelSerializer):
|
|
14
|
+
url = serializers.HyperlinkedIdentityField(
|
|
15
|
+
view_name="plugins-api:netbox_dns-api:view-detail"
|
|
16
|
+
)
|
|
17
|
+
default_view = serializers.BooleanField(
|
|
18
|
+
read_only=True,
|
|
19
|
+
)
|
|
20
|
+
prefixes = PrefixSerializer(
|
|
21
|
+
many=True,
|
|
22
|
+
nested=True,
|
|
23
|
+
read_only=False,
|
|
24
|
+
required=False,
|
|
25
|
+
help_text="IPAM Prefixes assigned to the View",
|
|
26
|
+
)
|
|
27
|
+
tenant = TenantSerializer(
|
|
28
|
+
nested=True,
|
|
29
|
+
required=False,
|
|
30
|
+
allow_null=True,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
def create(self, validated_data):
|
|
34
|
+
prefixes = validated_data.pop("prefixes", None)
|
|
35
|
+
|
|
36
|
+
view = super().create(validated_data)
|
|
37
|
+
|
|
38
|
+
if prefixes is not None:
|
|
39
|
+
view.prefixes.set(prefixes)
|
|
40
|
+
|
|
41
|
+
return view
|
|
42
|
+
|
|
43
|
+
def update(self, instance, validated_data):
|
|
44
|
+
prefixes = validated_data.pop("prefixes", None)
|
|
45
|
+
|
|
46
|
+
view = super().update(instance, validated_data)
|
|
47
|
+
|
|
48
|
+
if prefixes is not None:
|
|
49
|
+
view.prefixes.set(prefixes)
|
|
50
|
+
|
|
51
|
+
return view
|
|
52
|
+
|
|
53
|
+
class Meta:
|
|
54
|
+
model = View
|
|
55
|
+
fields = (
|
|
56
|
+
"id",
|
|
57
|
+
"url",
|
|
58
|
+
"display",
|
|
59
|
+
"name",
|
|
60
|
+
"default_view",
|
|
61
|
+
"tags",
|
|
62
|
+
"description",
|
|
63
|
+
"created",
|
|
64
|
+
"last_updated",
|
|
65
|
+
"custom_fields",
|
|
66
|
+
"tenant",
|
|
67
|
+
"prefixes",
|
|
68
|
+
)
|
|
69
|
+
brief_fields = ("id", "url", "display", "name", "default_view", "description")
|
|
@@ -6,7 +6,7 @@ from tenancy.api.serializers import TenantSerializer
|
|
|
6
6
|
from .view import ViewSerializer
|
|
7
7
|
from .nameserver import NameServerSerializer
|
|
8
8
|
from .registrar import RegistrarSerializer
|
|
9
|
-
from .
|
|
9
|
+
from .registration_contact import RegistrationContactSerializer
|
|
10
10
|
from .zone_template import ZoneTemplateSerializer
|
|
11
11
|
|
|
12
12
|
from ..nested_serializers import NestedZoneSerializer
|
|
@@ -62,28 +62,28 @@ class ZoneSerializer(NetBoxModelSerializer):
|
|
|
62
62
|
required=False,
|
|
63
63
|
help_text="The registrar the domain is registered with",
|
|
64
64
|
)
|
|
65
|
-
registrant =
|
|
65
|
+
registrant = RegistrationContactSerializer(
|
|
66
66
|
nested=True,
|
|
67
67
|
many=False,
|
|
68
68
|
read_only=False,
|
|
69
69
|
required=False,
|
|
70
70
|
help_text="The owner of the domain",
|
|
71
71
|
)
|
|
72
|
-
admin_c =
|
|
72
|
+
admin_c = RegistrationContactSerializer(
|
|
73
73
|
nested=True,
|
|
74
74
|
many=False,
|
|
75
75
|
read_only=False,
|
|
76
76
|
required=False,
|
|
77
77
|
help_text="The administrative contact for the domain",
|
|
78
78
|
)
|
|
79
|
-
tech_c =
|
|
79
|
+
tech_c = RegistrationContactSerializer(
|
|
80
80
|
nested=True,
|
|
81
81
|
many=False,
|
|
82
82
|
read_only=False,
|
|
83
83
|
required=False,
|
|
84
84
|
help_text="The technical contact for the domain",
|
|
85
85
|
)
|
|
86
|
-
billing_c =
|
|
86
|
+
billing_c = RegistrationContactSerializer(
|
|
87
87
|
nested=True,
|
|
88
88
|
many=False,
|
|
89
89
|
read_only=False,
|
{netbox_plugin_dns-1.0.6 → netbox_plugin_dns-1.1.0}/netbox_dns/api/serializers_/zone_template.py
RENAMED
|
@@ -8,7 +8,7 @@ from netbox_dns.api.nested_serializers import NestedRecordTemplateSerializer
|
|
|
8
8
|
|
|
9
9
|
from .nameserver import NameServerSerializer
|
|
10
10
|
from .registrar import RegistrarSerializer
|
|
11
|
-
from .
|
|
11
|
+
from .registration_contact import RegistrationContactSerializer
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
__all__ = ("ZoneTemplateSerializer",)
|
|
@@ -38,28 +38,28 @@ class ZoneTemplateSerializer(NetBoxModelSerializer):
|
|
|
38
38
|
required=False,
|
|
39
39
|
help_text="The registrar the domain is registered with",
|
|
40
40
|
)
|
|
41
|
-
registrant =
|
|
41
|
+
registrant = RegistrationContactSerializer(
|
|
42
42
|
nested=True,
|
|
43
43
|
many=False,
|
|
44
44
|
read_only=False,
|
|
45
45
|
required=False,
|
|
46
46
|
help_text="The owner of the domain",
|
|
47
47
|
)
|
|
48
|
-
admin_c =
|
|
48
|
+
admin_c = RegistrationContactSerializer(
|
|
49
49
|
nested=True,
|
|
50
50
|
many=False,
|
|
51
51
|
read_only=False,
|
|
52
52
|
required=False,
|
|
53
53
|
help_text="The administrative contact for the domain",
|
|
54
54
|
)
|
|
55
|
-
tech_c =
|
|
55
|
+
tech_c = RegistrationContactSerializer(
|
|
56
56
|
nested=True,
|
|
57
57
|
many=False,
|
|
58
58
|
read_only=False,
|
|
59
59
|
required=False,
|
|
60
60
|
help_text="The technical contact for the domain",
|
|
61
61
|
)
|
|
62
|
-
billing_c =
|
|
62
|
+
billing_c = RegistrationContactSerializer(
|
|
63
63
|
nested=True,
|
|
64
64
|
many=False,
|
|
65
65
|
read_only=False,
|
|
@@ -7,9 +7,10 @@ from netbox_dns.api.views import (
|
|
|
7
7
|
NameServerViewSet,
|
|
8
8
|
RecordViewSet,
|
|
9
9
|
RegistrarViewSet,
|
|
10
|
-
|
|
10
|
+
RegistrationContactViewSet,
|
|
11
11
|
ZoneTemplateViewSet,
|
|
12
12
|
RecordTemplateViewSet,
|
|
13
|
+
PrefixViewSet,
|
|
13
14
|
)
|
|
14
15
|
|
|
15
16
|
router = NetBoxRouter()
|
|
@@ -20,8 +21,10 @@ router.register("zones", ZoneViewSet)
|
|
|
20
21
|
router.register("nameservers", NameServerViewSet)
|
|
21
22
|
router.register("records", RecordViewSet)
|
|
22
23
|
router.register("registrars", RegistrarViewSet)
|
|
23
|
-
router.register("contacts",
|
|
24
|
+
router.register("contacts", RegistrationContactViewSet)
|
|
24
25
|
router.register("zonetemplates", ZoneTemplateViewSet)
|
|
25
26
|
router.register("recordtemplates", RecordTemplateViewSet)
|
|
26
27
|
|
|
28
|
+
router.register("prefixes", PrefixViewSet)
|
|
29
|
+
|
|
27
30
|
urlpatterns = router.urls
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
from rest_framework import serializers
|
|
2
|
-
from rest_framework.decorators import action
|
|
3
|
-
from rest_framework.response import Response
|
|
4
2
|
from rest_framework.routers import APIRootView
|
|
5
3
|
|
|
4
|
+
from ipam.models import Prefix
|
|
5
|
+
from ipam.filtersets import PrefixFilterSet
|
|
6
|
+
|
|
6
7
|
from netbox.api.viewsets import NetBoxModelViewSet
|
|
7
8
|
|
|
8
9
|
from netbox_dns.api.serializers import (
|
|
@@ -11,9 +12,10 @@ from netbox_dns.api.serializers import (
|
|
|
11
12
|
NameServerSerializer,
|
|
12
13
|
RecordSerializer,
|
|
13
14
|
RegistrarSerializer,
|
|
14
|
-
|
|
15
|
+
RegistrationContactSerializer,
|
|
15
16
|
ZoneTemplateSerializer,
|
|
16
17
|
RecordTemplateSerializer,
|
|
18
|
+
PrefixSerializer,
|
|
17
19
|
)
|
|
18
20
|
from netbox_dns.filtersets import (
|
|
19
21
|
ViewFilterSet,
|
|
@@ -21,7 +23,7 @@ from netbox_dns.filtersets import (
|
|
|
21
23
|
NameServerFilterSet,
|
|
22
24
|
RecordFilterSet,
|
|
23
25
|
RegistrarFilterSet,
|
|
24
|
-
|
|
26
|
+
RegistrationContactFilterSet,
|
|
25
27
|
ZoneTemplateFilterSet,
|
|
26
28
|
RecordTemplateFilterSet,
|
|
27
29
|
)
|
|
@@ -31,7 +33,7 @@ from netbox_dns.models import (
|
|
|
31
33
|
NameServer,
|
|
32
34
|
Record,
|
|
33
35
|
Registrar,
|
|
34
|
-
|
|
36
|
+
RegistrationContact,
|
|
35
37
|
ZoneTemplate,
|
|
36
38
|
RecordTemplate,
|
|
37
39
|
)
|
|
@@ -47,12 +49,6 @@ class ViewViewSet(NetBoxModelViewSet):
|
|
|
47
49
|
serializer_class = ViewSerializer
|
|
48
50
|
filterset_class = ViewFilterSet
|
|
49
51
|
|
|
50
|
-
@action(detail=True, methods=["get"])
|
|
51
|
-
def views(self, request, pk=None):
|
|
52
|
-
views = View.objects.filter(zone=pk)
|
|
53
|
-
serializer = ViewSerializer(views, many=True, context={"request": request})
|
|
54
|
-
return Response(serializer.data)
|
|
55
|
-
|
|
56
52
|
|
|
57
53
|
class ZoneViewSet(NetBoxModelViewSet):
|
|
58
54
|
queryset = Zone.objects.prefetch_related(
|
|
@@ -66,32 +62,12 @@ class ZoneViewSet(NetBoxModelViewSet):
|
|
|
66
62
|
serializer_class = ZoneSerializer
|
|
67
63
|
filterset_class = ZoneFilterSet
|
|
68
64
|
|
|
69
|
-
@action(detail=True, methods=["get"])
|
|
70
|
-
def records(self, request, pk=None):
|
|
71
|
-
records = Record.objects.filter(zone=pk)
|
|
72
|
-
serializer = RecordSerializer(records, many=True, context={"request": request})
|
|
73
|
-
return Response(serializer.data)
|
|
74
|
-
|
|
75
|
-
@action(detail=True, methods=["get"])
|
|
76
|
-
def nameservers(self, request, pk=None):
|
|
77
|
-
nameservers = NameServer.objects.filter(zones__id=pk)
|
|
78
|
-
serializer = NameServerSerializer(
|
|
79
|
-
nameservers, many=True, context={"request": request}
|
|
80
|
-
)
|
|
81
|
-
return Response(serializer.data)
|
|
82
|
-
|
|
83
65
|
|
|
84
66
|
class NameServerViewSet(NetBoxModelViewSet):
|
|
85
67
|
queryset = NameServer.objects.prefetch_related("zones", "tenant")
|
|
86
68
|
serializer_class = NameServerSerializer
|
|
87
69
|
filterset_class = NameServerFilterSet
|
|
88
70
|
|
|
89
|
-
@action(detail=True, methods=["get"])
|
|
90
|
-
def zones(self, request, pk=None):
|
|
91
|
-
zones = Zone.objects.filter(nameservers__id=pk)
|
|
92
|
-
serializer = ZoneSerializer(zones, many=True, context={"request": request})
|
|
93
|
-
return Response(serializer.data)
|
|
94
|
-
|
|
95
71
|
|
|
96
72
|
class RecordViewSet(NetBoxModelViewSet):
|
|
97
73
|
queryset = Record.objects.all().prefetch_related("zone", "zone__view", "tenant")
|
|
@@ -136,10 +112,10 @@ class RegistrarViewSet(NetBoxModelViewSet):
|
|
|
136
112
|
filterset_class = RegistrarFilterSet
|
|
137
113
|
|
|
138
114
|
|
|
139
|
-
class
|
|
140
|
-
queryset =
|
|
141
|
-
serializer_class =
|
|
142
|
-
filterset_class =
|
|
115
|
+
class RegistrationContactViewSet(NetBoxModelViewSet):
|
|
116
|
+
queryset = RegistrationContact.objects.all()
|
|
117
|
+
serializer_class = RegistrationContactSerializer
|
|
118
|
+
filterset_class = RegistrationContactFilterSet
|
|
143
119
|
|
|
144
120
|
|
|
145
121
|
class ZoneTemplateViewSet(NetBoxModelViewSet):
|
|
@@ -152,3 +128,9 @@ class RecordTemplateViewSet(NetBoxModelViewSet):
|
|
|
152
128
|
queryset = RecordTemplate.objects.all()
|
|
153
129
|
serializer_class = RecordTemplateSerializer
|
|
154
130
|
filterset_class = RecordTemplateFilterSet
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
class PrefixViewSet(NetBoxModelViewSet):
|
|
134
|
+
queryset = Prefix.objects.all()
|
|
135
|
+
serializer_class = PrefixSerializer
|
|
136
|
+
filterset_class = PrefixFilterSet
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from utilities.forms.fields import DynamicModelMultipleChoiceField
|
|
2
|
+
from utilities.forms.widgets import APISelectMultiple
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
__all__ = ("PrefixDynamicModelMultipleChoiceField",)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class PrefixDynamicModelMultipleChoiceField(DynamicModelMultipleChoiceField):
|
|
9
|
+
widget = APISelectMultiple(api_url="/api/plugins/netbox-dns/prefixes")
|
|
10
|
+
|
|
11
|
+
def label_from_instance(self, obj):
|
|
12
|
+
if obj.vrf:
|
|
13
|
+
return f"{str(obj.prefix)} [{obj.vrf.name}]"
|
|
14
|
+
|
|
15
|
+
return str(obj.prefix)
|
|
@@ -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
|
)
|
|
@@ -2,15 +2,15 @@ from django.db.models import Q
|
|
|
2
2
|
|
|
3
3
|
from netbox.filtersets import NetBoxModelFilterSet
|
|
4
4
|
|
|
5
|
-
from netbox_dns.models import
|
|
5
|
+
from netbox_dns.models import RegistrationContact
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
__all__ = ("
|
|
8
|
+
__all__ = ("RegistrationContactFilterSet",)
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class
|
|
11
|
+
class RegistrationContactFilterSet(NetBoxModelFilterSet):
|
|
12
12
|
class Meta:
|
|
13
|
-
model =
|
|
13
|
+
model = RegistrationContact
|
|
14
14
|
fields = (
|
|
15
15
|
"id",
|
|
16
16
|
"name",
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import django_filters
|
|
2
|
+
|
|
1
3
|
from django.db.models import Q
|
|
2
4
|
|
|
3
5
|
from netbox.filtersets import NetBoxModelFilterSet
|
|
4
6
|
from tenancy.filtersets import TenancyFilterSet
|
|
7
|
+
from ipam.models import Prefix
|
|
5
8
|
|
|
6
9
|
from netbox_dns.models import View
|
|
7
10
|
|
|
@@ -10,6 +13,19 @@ __all__ = ("ViewFilterSet",)
|
|
|
10
13
|
|
|
11
14
|
|
|
12
15
|
class ViewFilterSet(NetBoxModelFilterSet, TenancyFilterSet):
|
|
16
|
+
prefix_id = django_filters.ModelMultipleChoiceFilter(
|
|
17
|
+
queryset=Prefix.objects.all(),
|
|
18
|
+
field_name="prefixes",
|
|
19
|
+
to_field_name="id",
|
|
20
|
+
label="Prefixes ID",
|
|
21
|
+
)
|
|
22
|
+
prefix = django_filters.ModelMultipleChoiceFilter(
|
|
23
|
+
queryset=Prefix.objects.all(),
|
|
24
|
+
field_name="prefixes__prefix",
|
|
25
|
+
to_field_name="prefix",
|
|
26
|
+
label="Prefix",
|
|
27
|
+
)
|
|
28
|
+
|
|
13
29
|
class Meta:
|
|
14
30
|
model = View
|
|
15
31
|
fields = ("id", "name", "default_view", "description")
|
|
@@ -7,7 +7,7 @@ from netbox.filtersets import NetBoxModelFilterSet
|
|
|
7
7
|
from tenancy.filtersets import TenancyFilterSet
|
|
8
8
|
from utilities.filters import MultiValueCharFilter
|
|
9
9
|
|
|
10
|
-
from netbox_dns.models import View, Zone, Registrar,
|
|
10
|
+
from netbox_dns.models import View, Zone, Registrar, RegistrationContact, NameServer
|
|
11
11
|
from netbox_dns.choices import ZoneStatusChoices
|
|
12
12
|
|
|
13
13
|
|
|
@@ -95,44 +95,44 @@ class ZoneFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
|
|
|
95
95
|
label="Registrar",
|
|
96
96
|
)
|
|
97
97
|
registrant_id = django_filters.ModelMultipleChoiceFilter(
|
|
98
|
-
queryset=
|
|
98
|
+
queryset=RegistrationContact.objects.all(),
|
|
99
99
|
label="Registrant ID",
|
|
100
100
|
)
|
|
101
101
|
registrant = django_filters.ModelMultipleChoiceFilter(
|
|
102
|
-
queryset=
|
|
102
|
+
queryset=RegistrationContact.objects.all(),
|
|
103
103
|
field_name="registrant__contact_id",
|
|
104
104
|
to_field_name="contact_id",
|
|
105
105
|
label="Registrant",
|
|
106
106
|
)
|
|
107
107
|
admin_c_id = django_filters.ModelMultipleChoiceFilter(
|
|
108
|
-
queryset=
|
|
109
|
-
label="Administrative
|
|
108
|
+
queryset=RegistrationContact.objects.all(),
|
|
109
|
+
label="Administrative RegistrationContact ID",
|
|
110
110
|
)
|
|
111
111
|
admin_c = django_filters.ModelMultipleChoiceFilter(
|
|
112
|
-
queryset=
|
|
112
|
+
queryset=RegistrationContact.objects.all(),
|
|
113
113
|
field_name="admin_c__contact_id",
|
|
114
114
|
to_field_name="contact_id",
|
|
115
|
-
label="Administrative
|
|
115
|
+
label="Administrative RegistrationContact",
|
|
116
116
|
)
|
|
117
117
|
tech_c_id = django_filters.ModelMultipleChoiceFilter(
|
|
118
|
-
queryset=
|
|
119
|
-
label="Technical
|
|
118
|
+
queryset=RegistrationContact.objects.all(),
|
|
119
|
+
label="Technical RegistrationContact ID",
|
|
120
120
|
)
|
|
121
121
|
tech_c = django_filters.ModelMultipleChoiceFilter(
|
|
122
|
-
queryset=
|
|
122
|
+
queryset=RegistrationContact.objects.all(),
|
|
123
123
|
field_name="tech_c__contact_id",
|
|
124
124
|
to_field_name="contact_id",
|
|
125
|
-
label="Technical
|
|
125
|
+
label="Technical RegistrationContact",
|
|
126
126
|
)
|
|
127
127
|
billing_c_id = django_filters.ModelMultipleChoiceFilter(
|
|
128
|
-
queryset=
|
|
129
|
-
label="Billing
|
|
128
|
+
queryset=RegistrationContact.objects.all(),
|
|
129
|
+
label="Billing RegistrationContact ID",
|
|
130
130
|
)
|
|
131
131
|
billing_c = django_filters.ModelMultipleChoiceFilter(
|
|
132
|
-
queryset=
|
|
132
|
+
queryset=RegistrationContact.objects.all(),
|
|
133
133
|
field_name="billing_c__contact_id",
|
|
134
134
|
to_field_name="contact_id",
|
|
135
|
-
label="Billing
|
|
135
|
+
label="Billing RegistrationContact",
|
|
136
136
|
)
|
|
137
137
|
active = django_filters.BooleanFilter(
|
|
138
138
|
label="Zone is active",
|