Skip to main content

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.3 or later
  • PostgreSQL 12 or later

Installation

Brief installation instructions are provided below. For a complete installation guide, please refer to the included documentation.

  1. Grant PostgreSQL permission for the NetBox database user to create schemas:
GRANT CREATE ON DATABASE $database TO $user;
  1. Activate the NetBox virtual environment:
$ source /opt/netbox/venv/bin/activate
  1. Install the plugin from PyPI:
$ pip install netboxlabs-netbox-branching
  1. Add netbox_branching to the end of PLUGINS in configuration.py. Note that netbox_branching MUST be the last plugin listed.
PLUGINS = [
    # ...
    'netbox_branching',
]
  1. Configure the database and router in configuration.py:
from netbox_branching.utilities import DynamicSchemaDict

DATABASES = DynamicSchemaDict({
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'netbox',               # Database name
        'USER': 'netbox',               # PostgreSQL username
        'PASSWORD': 'password',         # PostgreSQL password
        'HOST': 'localhost',            # Database server
        'PORT': '',                     # Database port (leave blank for default)
        'CONN_MAX_AGE': 300,            # Max database connection age
    }
})

DATABASE_ROUTERS = [
    'netbox_branching.database.BranchAwareRouter',
]
  1. 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

netboxlabs_netbox_branching-0.6.0b1.tar.gz (39.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netboxlabs_netbox_branching-0.6.0b1-py3-none-any.whl (56.1 kB view details)

Uploaded Python 3

File details

Details for the file netboxlabs_netbox_branching-0.6.0b1.tar.gz.

File metadata

File hashes

Hashes for netboxlabs_netbox_branching-0.6.0b1.tar.gz
Algorithm Hash digest
SHA256 7cfd8c1680b149774908bf37333aa693e7957b7b0a2f77c37ee1320409ac4c54
MD5 05777ae3b7f6bf09f42996fd54f8e4e2
BLAKE2b-256 23e110b97c064cab8772606d312d3afb6b82f2ae5bbe6448d1ed8298a6e6b08b

See more details on using hashes here.

Provenance

The following attestation bundles were made for netboxlabs_netbox_branching-0.6.0b1.tar.gz:

Publisher: release.yaml on netboxlabs/netbox-branching

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netboxlabs_netbox_branching-0.6.0b1-py3-none-any.whl.

File metadata

File hashes

Hashes for netboxlabs_netbox_branching-0.6.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 65559610ed16a41517c7a4b816c0658e7347c10a35771b42eaa36f37e01d546b
MD5 c42f05e0d07090cd03278f03ca207cc4
BLAKE2b-256 60eb2f1e97061139547fcb0590d75cde0a4e72741210eca00178aa9920ee2d97

See more details on using hashes here.

Provenance

The following attestation bundles were made for netboxlabs_netbox_branching-0.6.0b1-py3-none-any.whl:

Publisher: release.yaml on netboxlabs/netbox-branching

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page