Closed empusas closed 11 months ago
I have found the issue after some more reading of the pynetbox code and understanding how it works. And it is known bug in the net box API that was fixed in a more recent version. with netbox version 3.5.1 the API response for VDC`s looked like this
HTTP 200 OK
Allow: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept
{
"count": 1149,
"next": "https://xxxxxt/api/dcim/virtual-device-contexts/?limit=50&offset=50",
"previous": null,
"results": [
{
"id": 1059,
"url": "https://xxxx/api/dcim/device/1059/",
"display": "xxxx",
"name": "xxxx",
"device": {
"id": 1178,
"url": "https://xxxxxx/api/dcim/devices/1178/",
As you can see the wrong URL was given back in the API that pointed to "devices" not "virtual-device-contexts". After update ing net box 3.5.7 the API response looked like this. All updates with pynetbox worked then as well.
HTTP 200 OK
Allow: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept
{
"count": 1149,
"next": "https://xxxxxt/api/dcim/virtual-device-contexts/?limit=50&offset=50",
"previous": null,
"results": [
{
"id": 1059,
"url": "https://xxxx/api/dcim/virtual-device-contexts/1059/",
"display": "xxxx",
"name": "xxxx",
"device": {
"id": 1178,
"url": "https://xxxxxx/api/dcim/devices/1178/",
with Pynetbox v7.0.1 I ran into a issue today.
Retrieving the information works fine with get and I get all details. But the save obviously tries to use the "devices" endpoint instead of the "virtual-device-contexts" for the save().
Looking into the code I could not find any support for VDCs. So I assume it has not been implemented yet. But strange that the "get" seems to work anyway.