Replies: 2 comments 2 replies
-
I'm also having a similar issue where I'm attempting to first check if a device is created and then check if interfaces are created for the device. during my testing, I'm getting the same error in my debug logs in Pynetbox version 7.2.0 ERROR: NetBox API request error: The request failed with code 400 Bad Request: {'type': ['This field is required.']} # here's my original code snippet
# Get existing interfaces for the device in NetBox
existing_interfaces = netbox.dcim.interfaces.filter(device_id=device.id)
existing_interface_names = [interface.name for interface in existing_interfaces]
# Add Interfaces to NetBox if they don't exist
for interface in interfaces:
if interface not in existing_interface_names:
netbox.dcim.interfaces.create(device=device.id, name=interface) |
Beta Was this translation helpful? Give feedback.
2 replies
-
FWIW, with pynetbox 7.2.0 and NetBox 3.3:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
That's the call I'm making to the create function and here's my response
pynetbox.core.query.RequestError: The request failed with code 400 Bad Request: {'type': ['GigabitEthernet0/0/1 is not a valid choice.']}
Where do I find the valid choice?
Caveat: This is pynetbox version 4.0.8. I understand that's old but I'm forced to work with legacy software until we can get it updated. I understand if help for something this old is hard to come by but any pointers will be appreciated
Beta Was this translation helpful? Give feedback.
All reactions