Closed LoSaMe closed 1 year ago
Hi @LoSaMe what happens if you simply omit the fields in your POST
?
Thank you for the fast answer @jsenecal . Omitting all null values resolved the problem. Simple but effective :)
It seems to me that this is not the final solution to this problem.
For example, if you want to change 802.1Q Mode
from Access
to null
using the API, this is currently not possible.
Leaving out values isn't a solution for people that don't directly control what's sent in the HTTP request, like users of pynetbox.
@tomasz-c @jcollie would either of you like to volunteer for this one?
I don't know if this is a bug. mode does not take null, it does take "" however.
Likely some of the other columns are the same as well.
I ran into the same issue after upgrading I was previously setting interface mode to None (which used to work). Using "" instead does indeed solves the issue.
NetBox version
v3.5.1
Python version
3.8
Steps to Reproduce
We utilize a custom script to add new devices to NetBox, which collects necessary information and creates corresponding objects via the NetBox API. However, we encountered an issue after upgrading our instance from version 3.4.1 to 3.5.1 (worked before). Below is an example Powershell code that is responsible for creating interfaces.
Same results with a Python script:
Expected Behavior
Add the Interface as defined.
Observed Behavior
The following error occurs when the script attempts to add a interface:
{"wnn": ["This field may not be null.""]}
If a default value for "wwn" such as "0000000000000000" is added to the script, then the script will output:
Adding an interface via GUI is not a problem (only the required fields are filled)