vcenter-netbox-sync icon indicating copy to clipboard operation
vcenter-netbox-sync copied to clipboard

Add Support for NetBox API version 2.9

Open bb-Ricardo opened this issue 4 years ago • 11 comments

This adds support for NetBox 2.9 API changes. It is not backwards compatible with older NetBox API Versions.

Also adds some minor code improvements.

Refs: #129

bb-Ricardo avatar Sep 23 '20 12:09 bb-Ricardo

Thank you. For me it's work. Netbox (v2.9.4).

jozefrebjak avatar Oct 02 '20 15:10 jozefrebjak

Great.

I just started a complete reimplementation of this whole project.

Hope to finish it next week.

Would also need some testers 😀

bb-Ricardo avatar Oct 02 '20 18:10 bb-Ricardo

Also using it here, thank you. Sign me up to test your future improvements 🤘

gstorme avatar Oct 04 '20 16:10 gstorme

We are using it and have a non production environment where I would be more then happy yo help test the reimplementation

fjasboka avatar Oct 05 '20 08:10 fjasboka

Thanks for the update I haven't noticed any problems so far. Also looking forward to any news on the reimplementation.

Haeki avatar Oct 06 '20 10:10 Haeki

I'm also using it here, thank you Ricardo!

duviful avatar Oct 06 '20 10:10 duviful

Sign me up for testing too

OBenned avatar Oct 06 '20 10:10 OBenned

Thanks! This almost works for us. There seems to be an issue where it the check for the the type of vCenter platform exists or not. When the initial check for it occurs Netbox responds that it does not exist. However, when vcenter-netbox-sync attempts to create the platform, Netbox now responds that it does exist.

This ultimately prevents the vCenter appliance from being created.

2020-10-29 20:36:13,997 [DEBUG] Sending GET to 'https://netbox.redacted.com/api/dcim/platforms/?name=Linux 4.4.221-3.ph1 VMware Photon 1.0 Photon VMware Photon 1.0 ' with data 'None'. 2020-10-29 20:36:14,042 [DEBUG] Received HTTP Status 200. 2020-10-29 20:36:14,043 [DEBUG] NetBox GET request OK; returned 200 status. 2020-10-29 20:36:14,043 [INFO] Netbox platforms 'Linux 4.4.221-3.ph1 VMware Photon 1.0 Photon VMware Photon 1.0 ' object not found. Requesting creation. 2020-10-29 20:36:14,044 [DEBUG] Sending POST to 'https://netbox.redacted.com/api/dcim/platforms/' with data '{'name': 'Linux 4.4.221-3.ph1 VMware Photon 1.0 Photon VMware Photon 1.0 ', 'slug': 'linux-4-4-221-3-ph1-vmware-photon-1-0-photon-vmware-photon-1-0-'}'. 2020-10-29 20:36:14,061 [DEBUG] Received HTTP Status 400. 2020-10-29 20:36:14,061 [WARNING] NetBox failed to create platforms object. A duplicate record may exist or the data sent is not acceptable. 2020-10-29 20:36:14,062 [DEBUG] NetBox 400 status reason: {"name":["platform with this name already exists."],"slug":["platform with this slug already exists."]} 2020-10-29 20:36:14,062 [DEBUG] Unaccepted request data: {'name': 'Linux 4.4.221-3.ph1 VMware Photon 1.0 Photon VMware Photon 1.0 ', 'slug': #'linux-4-4-221-3-ph1-vmware-photon-1-0-photon-vmware-photon-1-0-'}

josephcouture avatar Oct 29 '20 21:10 josephcouture

It seems the platform name has a white space at the end. And NetBox probably strips the white space and finds a platform with exactly that name and refuses the recreation of the same name.

The mentioned rewrite is coming along well and I hope to have a basic fully functionality version by the end of next week.

bb-Ricardo avatar Oct 29 '20 22:10 bb-Ricardo

@josephcouture I had the same problem, see https://github.com/synackray/vcenter-netbox-sync/pull/127

gstorme avatar Oct 30 '20 07:10 gstorme

I went down a rabbit hole and finally can see the light at the end of the tunnel again. This took way longer then expected (as usual).

Here you go: https://github.com/bb-Ricardo/netbox-sync

please test as much as you can: Debug logs are very welcome.

bb-Ricardo avatar Nov 06 '20 19:11 bb-Ricardo