Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


https://github.com/digitalocean/pynetbox

instantiate the API

import pynetbox
nb = pynetbox.api(
    'http://localhost:8000',
    private_key_file='/path/to/private-key.pem',
    token='d6f4e314a5b5fefd164995169f28ae32d987704f'
)

List of devices:

nb.dcim.devices.all()
[test1-leaf1, test1-leaf2]