Handle Netbox API versions #52

Open
opened 2019-08-29 18:00:14 +02:00 by Solvik · 1 comment
Solvik commented 2019-08-29 18:00:14 +02:00 (Migrated from github.com)

At some point, Netbox versions will depreciate or change some behavior.
The project has been developed with Netbox 2.6

One way to change the behavior depending of the version will be to match the HTTP header API-Version:

➜  ~ curl -i https://netbox.company.com/api/
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 29 Aug 2019 15:58:27 GMT
Content-Type: application/json
Content-Length: 325
Connection: keep-alive
Vary: Accept, Cookie, Origin
Allow: GET, HEAD, OPTIONS
API-Version: 2.6
X-Frame-Options: SAMEORIGIN
P3P: CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"
At some point, Netbox versions will depreciate or change some behavior. The project has been developed with Netbox 2.6 One way to change the behavior depending of the version will be to match the HTTP header `API-Version`: ``` ➜ ~ curl -i https://netbox.company.com/api/ HTTP/1.1 200 OK Server: nginx Date: Thu, 29 Aug 2019 15:58:27 GMT Content-Type: application/json Content-Length: 325 Connection: keep-alive Vary: Accept, Cookie, Origin Allow: GET, HEAD, OPTIONS API-Version: 2.6 X-Frame-Options: SAMEORIGIN P3P: CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV" ```
ribetm commented 2024-10-13 10:13:45 +02:00 (Migrated from github.com)
I think this was done in https://github.com/Solvik/netbox-agent/pull/177
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: DGNum/netbox-agent#52
No description provided.