auroraresearchlab / netbox-dns

Netbox Dns is a netbox plugin for managing zone, nameserver and record inventory.
MIT License
208 stars 20 forks source link

Support for NetBox 3.4 #253

Closed peteeckel closed 1 year ago

peteeckel commented 1 year ago

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:

PLUGINS_CONFIG = {
    "netbox_dns": {
        "feature_ipam_integration": True,
    }
}

The panels in the IPAM IP Address and Prefix detail view currently look like this:

IPAM IP Address

Screenshot 2022-12-01 at 22 43 22

IPAM Prefix

Screenshot 2022-12-01 at 22 43 06

As always, feedback is very welcome.

Internal Changes

Some internal changes that should not be visible on the surface:

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