Skip to content

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

@Sulray

Description

@Sulray

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    app: pynetboxcomplexity: mediumRequires a substantial but not unusual amount of effort to implementstatus: backlogtype: featureIntroduction of new functionality to the application

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions