This PR provides support for the upcoming NetBox 3.4 release and utilises some of the new features provided by it.
Compatibility
The changes made in this PR require NetBox 3.4.
Major Changes
The PR makes some noticeable changes to the user interface of NetBox DNS. This is mainly due to the migration from home-grown view code to standard NetBox view classes and has the advantage of providing a more homogenous user interface across NetBox, as well as some new features that haven't been possible before.
Global Search
NetBox 3.4 provides an API to include plugin models into the global search feature. NetBox DNS makes use of this feature so that View, NameServer, Zone and Record objects can now be found using global search.
Child Object Lists
NetBox DNS provides lists of zones per name server and view, and list of records and managed records per zone. These views were formerly implemented in custom templates, which required a lot of duplicate code and some functional restrictions (e.g. the failure to include Quick Search, #250).
Using the new ViewTab class of NetBox, the lists have now been moved to separate tabs within the zone, view and nameserver detail views, which made it possible to eliminate much of the custom templates.
Quick Search in Child Object Lists
As a side effect of re-implementing the child object lists using ViewTab and ObjectChildrenView instead of custom HTML templates, Quick Search now works out of the box for child object lists. Thanks, @jeremystretch!
SOA Zones in NameServer Detail View
For each NameServer object now there is a list of zones using it as their primary name server (SOA_MNAME). As with all new child object lists, the tab will not be displayed if there is no such zone.
NetBox DNS Menu
Another new feature of NetBox 3.4 is the option to include plugin specific top level menu bar entries for plugins. NetBox DNS now no longer hides under the generic "Plugins" menu entry but uses its own, which is a major improvement.
Bulk Import from YAML and JSON
NetBox 3.4 provides the functionality to import objects from YAML and JSON as well, not just from CSV. NetBox DNS inherits this functionality.
Bulk Updates
NetBox 3.4 provides the functionality to bulk update objects using YAML, CSV and JSON. NetBox DNS inherits this functionality as well.
Experimental Integration with NetBox IPAM Views
Another functionality NetBox 3.4 provides is the option to inject contents in core model views. With this PR, NetBox DNS gets an experimental feature that displays related address and pointer records for IPAM IP addresses (records that have that address as their value in case of address records, or provide a pointer for the address), and related .arpa zones for IPAM prefix objects (zones that contain pointers for all IP addresses in the prefix or pointers for a subnet of the prefix).
This is an experimental feature and needs to be switched on explicitly. To enable it, set the plugin configuration variable feature_ipam_integration in the NetBox DNS configuration to True:
The panels in the IPAM IP Address and Prefix detail view currently look like this:
IPAM IP Address
IPAM Prefix
As always, feedback is very welcome.
Internal Changes
Some internal changes that should not be visible on the surface:
All classes formerly inheriting from NetBoxCSVForm now inherit from NetBoxImportForm instead. This change in NetBox' API has been made to reflect the new import formats, the old one will be deprecated in NetBox 3.5
All of NetBox DNS' *CSVForm subclasses have been renamed to the analogous *ImportForm class name to remain consistent with NetBox.
All test_view.py modules have been adjusted to include csv_update_data so the NetBox view test classes (still undocumented, but extremely useful` can still be used for testing.
Python 3.11 is now supported
Improved determination of return URLs for various actions such as cloning or importing objects, which led the user back to the NetBox main page in many cases.
Known Issues
Very few issues have been found so far, all of which could be cleared by fixing the underlying issues in the NetBox 3.4-beta1 release (thanks again, @jeremystretch).
This PR provides support for the upcoming NetBox 3.4 release and utilises some of the new features provided by it.
Compatibility
The changes made in this PR require NetBox 3.4.
Major Changes
The PR makes some noticeable changes to the user interface of NetBox DNS. This is mainly due to the migration from home-grown view code to standard NetBox view classes and has the advantage of providing a more homogenous user interface across NetBox, as well as some new features that haven't been possible before.
Global Search
NetBox 3.4 provides an API to include plugin models into the global search feature. NetBox DNS makes use of this feature so that View, NameServer, Zone and Record objects can now be found using global search.
Child Object Lists
NetBox DNS provides lists of zones per name server and view, and list of records and managed records per zone. These views were formerly implemented in custom templates, which required a lot of duplicate code and some functional restrictions (e.g. the failure to include Quick Search, #250).
Using the new
ViewTab
class of NetBox, the lists have now been moved to separate tabs within the zone, view and nameserver detail views, which made it possible to eliminate much of the custom templates.Quick Search in Child Object Lists
As a side effect of re-implementing the child object lists using
ViewTab
andObjectChildrenView
instead of custom HTML templates, Quick Search now works out of the box for child object lists. Thanks, @jeremystretch!SOA Zones in NameServer Detail View
For each NameServer object now there is a list of zones using it as their primary name server (
SOA_MNAME
). As with all new child object lists, the tab will not be displayed if there is no such zone.NetBox DNS Menu
Another new feature of NetBox 3.4 is the option to include plugin specific top level menu bar entries for plugins. NetBox DNS now no longer hides under the generic "Plugins" menu entry but uses its own, which is a major improvement.
Bulk Import from YAML and JSON
NetBox 3.4 provides the functionality to import objects from YAML and JSON as well, not just from CSV. NetBox DNS inherits this functionality.
Bulk Updates
NetBox 3.4 provides the functionality to bulk update objects using YAML, CSV and JSON. NetBox DNS inherits this functionality as well.
Experimental Integration with NetBox IPAM Views
Another functionality NetBox 3.4 provides is the option to inject contents in core model views. With this PR, NetBox DNS gets an experimental feature that displays related address and pointer records for IPAM IP addresses (records that have that address as their value in case of address records, or provide a pointer for the address), and related
.arpa
zones for IPAM prefix objects (zones that contain pointers for all IP addresses in the prefix or pointers for a subnet of the prefix).This is an experimental feature and needs to be switched on explicitly. To enable it, set the plugin configuration variable
feature_ipam_integration
in the NetBox DNS configuration toTrue
:The panels in the IPAM IP Address and Prefix detail view currently look like this:
IPAM IP Address
IPAM Prefix
As always, feedback is very welcome.
Internal Changes
Some internal changes that should not be visible on the surface:
NetBoxCSVForm
now inherit fromNetBoxImportForm
instead. This change in NetBox' API has been made to reflect the new import formats, the old one will be deprecated in NetBox 3.5*CSVForm
subclasses have been renamed to the analogous*ImportForm
class name to remain consistent with NetBox.test_view.py
modules have been adjusted to includecsv_update_data
so the NetBox view test classes (still undocumented, but extremely useful` can still be used for testing.Known Issues
Very few issues have been found so far, all of which could be cleared by fixing the underlying issues in the NetBox 3.4-beta1 release (thanks again, @jeremystretch).
fixes #250 fixes #252 fixes #32