vapor-ware / netbox-virtual-circuit-plugin

A plugin for NetBox that supports Virtual Circuit management
GNU General Public License v3.0
55 stars 19 forks source link

Add field/model for linking Virtual Circuits to Circuits #43

Open tyler-8 opened 3 years ago

tyler-8 commented 3 years ago

I would find a ton of value in being able to link the virtual circuit model to a physical "Circuit" model from NetBox.

Just a rough draft idea of what that could look like:

class VirtualCircuitPhysicalCircuit(ChangeLoggedModel):
    """Virtual Circuit to Physical Circuit relationship."""

    virtual_circuit = models.ForeignKey(
        to=VirtualCircuit,
        on_delete=models.CASCADE,
        related_name='circuits',
        verbose_name='Virtual Circuit',
    )
    circuit = models.OneToOneField(
        to=Circuit,
        on_delete=models.CASCADE,
        related_name='circuit_of',
        verbose_name='Circuit',
    )

Happy to have more discussion around the idea.

hoanhan101 commented 3 years ago

May I ask what are your use cases? Are you using any workaround for this and seeking a better solution?

tyler-8 commented 3 years ago

I have X numbers of sites, with 2-4 circuits at each, and only one of those has 'virtual' circuits riding across it, in the form of multiple VLANs+Prefixes. Those services are directly tied to the physical circuit so being able to track them all together would be very handy.

Right now I'm using a combination of tags to help model the relationship between the VLANs/virtual circuits & physical circuit, but it's not ideal and doesn't provide any concrete linkage between them.