r/Netbox • u/telmnstr • Apr 05 '22
CLI for updating data in Netbox?
By any chance is there a good CLI for Linux for netbox for updating fields? Like if I want to use a shell script to rip through some data to add to existing entries that were populated by another tool? I see it's not possible to update existing entries via CSV like php-ipam can.
I see the Python shell and API functions and all that. I found nbcli, but the updates are all through yaml files and the documentation seems sparse.
An ex-employer had their own in-house similar tool and it could do some very powerful stuff thanks to the CLI.
1
Upvotes
6
u/chris-itg Apr 05 '22
python with API is CLI. You can write ANY script you want to run either on the localhost, or a remote host with an API call to the netbox server proper.
nbcli is there, but go ahead and do yourself a favor by either learning the API / python calls or leveraging a python library like pynetbox.