netbox-cli-0.2.1 is not a library.
netbox-cli
full-featured cli for the netbox api. covers standard crud resources and a raw mode for any endpoint.
install
from crates.io:
from this repo:
quickstart
auth
required:
--url--token
or set:
NETBOX_URLNETBOX_TOKEN
resources
list resource groups:
common commands
list:
get by id:
create/update with json:
output formats
select a field with a dot path:
table output flattens paginated responses by showing the results rows and a summary line with count/next/previous when present.
dry run
print the request for write operations without sending them:
raw requests
use raw for any endpoint:
notes:
--pathis api-relative, e.g.dcim/devices/- a leading
api/is stripped if present - repeat
--query key=valuefor multiple params
graphql
read-only graphql queries:
special endpoints
output
responses are json, pretty-printed to stdout. errors return non-zero exit codes.
exit codes:
0success1request or parsing error2invalid command or arguments
errors include http status, path, and request id when available.
help