Add NetBox Branching support #1325
Replies: 1 comment 1 reply
-
I can see a lot of utility in this. One of the issues that I encountered at one Having this branching concept would allow different parts of an organization to make changes in branches to the DCIM that can be "staged" for review and then eventually merged or rejected. |
Beta Was this translation helpful? Give feedback.
-
Imagine a scenario in which we're extracting information from a 3rd party system to be written to NetBox. In NetBox instances that have many users and downstream systems, overwriting information directly in main can interfere with other people's work.
NetBox Branching allows users to conduct their work in branches that are separate from the main NetBox data model and can be diff'd, merged, sync'd etc. With branching the information extracted from the 3rd party system can be written to a branch where it can be inspected in isolation before being merged into main.
Docs: https://docs.netboxlabs.com/netbox-extensions/branching/
Repo: https://github.com/netboxlabs/netbox-branching
Ideally it should be possible to specify a branch's
schema_id
when writing to NetBox so that any actions are applied to the branch and not main.Applying changes to branches is currently supported in
pynetbox
by updating thenb.http_session.headers
like this:This works great for one off jobs when you'll only be interacting with one branch during the execution. For jobs that might need to write to multiple branches, the risk with the above approach is that you forget to set the branch back to its previous state and end up writing to the wrong branch. In that scenario I've been using this sort of thing instead:
Additionally it would be useful to have a module specifically for interacting with branch objects themselves. Branches support the following actions:
Create, Merge and Sync are all asynchronous, so would require some sort of polling mechanism to ensure successful completion.
Example workflow:
schema_id
schema_id
to specify the branch that future creates, updates and deletes should be applied toBeta Was this translation helpful? Give feedback.
All reactions