Run into this issue while was trying to create circuit in Netbox 3.5:
[2023-05-02 12:17:55,097] /tmp/pytest/netbox_data.py:1374 INFO - creating curcuits
[2023-05-02 12:17:55,097] /tmp/pytest/netbox_data.py:1381 INFO - Creating circuit: {'provider': {'slug': 'provider1'}, 'type': {'slug': 'darkfibre'}, 'status': 'active', 'cid': 'CID1'}
[2023-05-02 12:17:55,108] /usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py:452 DEBUG - http://192.168.75.129:8000 "POST /api/circuits/circuits/ HTTP/1.1" 400 48
[2023-05-02 12:17:55,108] /tmp/pytest/netbox_data.py:1402 ERROR - creating circuit '{'provider': {'slug': 'provider1'}, 'type': {'slug': 'darkfibre'}, 'status': 'active', 'cid': 'CID1'}' error 'The request failed with code 400 Bad Request: {'provider_account': ['This field is required.']}'
Traceback (most recent call last):
File "/tmp/pytest/netbox_data.py", line 1382, in create_circuits
circuit = nb.circuits.circuits.create(**item)
File "/usr/local/lib/python3.9/site-packages/pynetbox/core/endpoint.py", line 313, in create
req = Request(
File "/usr/local/lib/python3.9/site-packages/pynetbox/core/query.py", line 396, in post
return self._make_call(verb="post", data=data)
File "/usr/local/lib/python3.9/site-packages/pynetbox/core/query.py", line 284, in _make_call
raise RequestError(req)
pynetbox.core.query.RequestError: The request failed with code 400 Bad Request: {'provider_account': ['This field is required.']}
root@salt-master:/tmp/pytest# pip list | grep netbox
pynetbox 7.0.0
root@salt-master:/tmp/pytest#
Not sure if it is a Pynetbox or Netbox itself issue and whether this is expected at all but Netbox API states that provider_account field is not mandatory:
Run into this issue while was trying to create circuit in Netbox 3.5:
Not sure if it is a Pynetbox or Netbox itself issue and whether this is expected at all but Netbox API states that![image](https://user-images.githubusercontent.com/28857266/235664656-73acdfad-5be7-40ea-8655-162e4d6ee845.png)
provider_account
field is not mandatory:Code to reproduce: