nbctl
is a command line for interacting with Netbox. For the moment, it only lists items.
# For insecure usage (dev only)
export NETBOX_HTTP_SCHEME="http"
export NETBOX_HOST="netbox.example.org"
export NETBOX_TOKEN="....."
nbctl help
----
Uncomplicated CLI interaction with Netbox.
Usage:
nbctl [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
dcim Interact with dcim.
help Help about any command
version Shows the current nbctl version
Flags:
-h, --help help for nbctl
-t, --toggle Help message for toggle
Use "nbctl [command] --help" for more information about a command.
List the various items of equipment, filtering by equipment, bay, location, type, site, status, etc.
nbctl dcim devices list [--json|--raw]
Example:
nbctl dcim devices list -k "rack 1"
+---------------+--------------------------------+----------------+--------+----------------+--------------------+----------------+---------+
| NAME | TYPE | TENANT | SERIAL | LOCATION | SITE | RACK | STATUS |
+---------------+--------------------------------+----------------+--------+----------------+--------------------+----------------+---------+
| Server1 | PowerEdge R430 | Restos du Cœur | | Salle serveurs | Data Center | rack 1 | active |
| Server2 | PowerEdge R430 | Restos du Cœur | | Salle serveurs | Data Center | rack 1 | active |
| Web1 | PowerEdge R630 | Restos du Cœur | | Salle serveurs | Data Center | rack 1 | active |
| Web2 | PowerEdge R630 | Restos du Cœur | | Salle serveurs | Data Center | rack 1 | active |
Distributed under the GPLv3 License. See LICENSE for more information.
Julien Briault - @ju_hnny5