pynetbox icon indicating copy to clipboard operation
pynetbox copied to clipboard

Support for Netbox Branching detail endpoints (Merge/Sync/Revert)

Open Sulray opened this issue 1 month ago • 1 comments

pynetbox version

v7.5.0

NetBox version

v4.4.1

Feature type

Data model extension

Proposed functionality

Covering specific plugin endpoint needs may require to create a new "plugins.py" model. For example, Netbox Branching have merge/sync/revert as specific endpoints.

I will focus on "merge" detail endpoint to explain the proposed functionality.

A plugins.py file could contain something like that to address "merge" detail endpoint:

class Branches(Record):

    @property
    def merge(self):
        """Represents the ``merge`` detail endpoint.

        Returns a DetailEndpoint object that is the interface for
        viewing response from the merge endpoint.

        ## Returns
        DetailEndpoint object.

        ## Examples

        ```python
        branch= nb.plugins.branching.branches.get(123)
        branch.merge.create(commit=True)
        ```
        """
        return DetailEndpoint(self, "merge")

The expected behaviour would be:

    branch = nb.plugins.branching.branches.get(id=1)
    merging_branch = branch.merge.create(commit=True)
    merge_job_id = merging_branch.job_id
    # give the possibility to watch status of associated merge job

Use case

My need behind this issue it to be able to completely manage Netbox Branches through API requests implemented by pynetbox.

External dependencies

No response

Sulray avatar Nov 05 '25 17:11 Sulray

It looks like https://github.com/netboxlabs/netbox-branching/issues/353 will be adding a branch archive endpoint. If that actually happens, the work for this issue should also include the new archive endpoint.

jnovinger avatar Nov 13 '25 14:11 jnovinger