A git-like branching implementation for NetBox
Project description
NetBox Branching
This NetBox plugin introduces branching functionality. A branch is a discrete, static snapshot of the NetBox database which can be modified independently and later merged back into the main database. This enables users to make "offline" changes to objects within NetBox and avoid interfering with its integrity as the network source of truth. It also provides the opportunity to review changes in bulk prior to their application.
Requirements
- NetBox v4.1 or later
- PostgreSQL 12 or later
Installation
Brief installation instructions are provided below. For a complete installation guide, please refer to the included documentation.
- Activate the NetBox virtual environment:
$ source /opt/netbox/venv/bin/activate
- Install the plugin from PyPI:
$ pip install netboxlabs-netbox-branching
- Add
netbox_branching
toPLUGINS
inconfiguration.py
:
PLUGINS = [
# ...
'netbox_branching',
]
- Create
local_settings.py
to override theDATABASES
&DATABASE_ROUTERS
settings. This enables dynamic schema support.
from netbox_branching.utilities import DynamicSchemaDict
from .configuration import DATABASE
# Wrap DATABASES with DynamicSchemaDict for dynamic schema support
DATABASES = DynamicSchemaDict({
'default': DATABASE,
})
# Employ our custom database router
DATABASE_ROUTERS = [
'netbox_branching.database.BranchAwareRouter',
]
- Run NetBox migrations:
$ ./manage.py migrate
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file netboxlabs-netbox-branching-0.3.0.tar.gz
.
File metadata
- Download URL: netboxlabs-netbox-branching-0.3.0.tar.gz
- Upload date:
- Size: 29.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 970f46bdfa17e2516df596a389661c9efa31a5531a53e40e63190adcb6a3d2c7 |
|
MD5 | 901d04b1986f80f9d02610ec36a4fe2c |
|
BLAKE2b-256 | 7d5fa5bee62bba37a30427a3e3ec302497eb0b11148803dc3db5c177aa6fc1ff |