Ability to synchronize reports & scripts from a remote data source #11890
Labels
status: accepted
This issue has been accepted for implementation
type: feature
Introduction of new functionality to the application
Milestone
NetBox version
v3.4.5
Feature type
New functionality
Proposed functionality
NetBox has long supported custom scripts and reports as ways of enhancing its functionality. Currently, these are Python modules and scripts which must be uploaded to the configured storage system for use, and manually updated whenever changes are needed.
NetBox v3.5 introduces the ability to synchronize arbitrary data from a remote source (see #11558). This FR proposes leveraging this new ability to automatically update custom scripts and reports from an external source, such as a git repository.
I see two potential options for implementation:
Option A: Replication to files on disk
This is the more lightweight approach. One or more remote data sources could be designated (through a mechanism to be determined) as containing NetBox scripts or reports. The DataFiles produced from this source would be automatically replicated to the local storage backend within the
REPORTS_ROOT
orSCRIPTS_ROOT
path as appropriate.Option B: Create reports & scripts as database objects
This approach would be more involved, effectively changing the manner in which we manage scripts and reports. Rather than being stored as files on disk, each report and script module would exist as a database object. Replicating content from a DataFile would then follow the same pattern as we've implemented for config templates and other models. However, I'm not sure how feasible this approach is; further exploration is needed.
Use case
The ability to automatically update custom scripts and reports will obviate the need to apply changes manually to files on disk, and greatly simplify their administration.
Database changes
Option A as outlined above requires no changes to the database. Option B would entail replacing the "fake" Report and Script models under
extras
with concrete models with actual database tables.External dependencies
None
The text was updated successfully, but these errors were encountered: