netbox-bgp icon indicating copy to clipboard operation
netbox-bgp copied to clipboard

Move Session model to use the NetBox core ASN model

Open christianpinger opened this issue 3 years ago • 1 comments

ported @nahun's commit to latest k01ek/netbox-bgp@develop Credits: Nathan Wheeler [email protected] https://github.com/nahun/netbox-bgp/commit/6b870b086d46f58cb42e603b5daab3f6fb9d9ee1

NetBox v3.1 added a native ASN model. The plugin should utilize that model instead of a separate model that is specific to BGP.

Fixes https://github.com/k01ek/netbox-bgp/issues/82

christianpinger avatar Jul 29 '22 12:07 christianpinger

I've added data migrations for ASN objects.

A native ASN object must be created for every ASN used in a BGPSession, before running this migration. Afterwards every Session will reference to the native ASN object.

christianpinger avatar Aug 01 '22 14:08 christianpinger

Thanks @christianharendt and @nahun for your work, in next release I provide tool for migration plugin ASN objects to native NetBox ASN objects. So plugin ASN model will be removed later, I think in next minor release.

k01ek avatar Aug 19 '22 12:08 k01ek

Thanks @k01ek I was also considering to create a native ASN object for each plugin ASN during migration, but the native ASN model has a mandatory field: RIR. I was unsure what to insert there as a safe default. Maybe the first RIR found or create a meta RIR "netbox-bgp"?

christianpinger avatar Aug 22 '22 07:08 christianpinger

@christianharendt yea, just create some default RIR. I think change RIR for ASN is easier than create all ASN numbers by hands.

k01ek avatar Aug 25 '22 05:08 k01ek

I've updated the code to be compatible with the latest develop commits

christianpinger avatar Sep 13 '22 17:09 christianpinger