Skip to main content

Python NetBox Client

Project description

python-netbox is a client for the Netbox (https://github.com/digitalocean/netbox) API. It’s based on the APIv2 which is released since version 2.0.0. It requires python 3.

The full documentation can be found here.

Installation

To get the latest version from Github:

$ pip3 install python-netbox

Usage

To start with the module:

>>> from netbox import NetBox
>>> netbox = NetBox(host='127.0.0.1', port=32768, use_ssl=False, auth_token='token')

Examples

Get all devices:

>>> netbox.dcim.get_devices()

Get devices per rack:

>>> netbox.dcim.get_devices(rack_id=1)

Get device by name

>>> netbox.dcim.get_devices(name='device_name')

Create a site:

>>> netbox.dcim.create_site('site1', 'site1')

Delete a site:

>>> netbox.dcim.delete_site('site1')

Get IP address object:

>>> netbox.ipam.get_ip_addresses(address='10.0.0.1/16')

Support

If you have questions or comments please send an email to thomas@tjrb.nl

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-netbox-0.0.21.tar.gz (13.0 kB view details)

Uploaded Source

File details

Details for the file python-netbox-0.0.21.tar.gz.

File metadata

  • Download URL: python-netbox-0.0.21.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1

File hashes

Hashes for python-netbox-0.0.21.tar.gz
Algorithm Hash digest
SHA256 8b4c414921664e8d88ec4918b885b31c84b5d1486c6490a823f1aff9749de14d
MD5 3fa0463d68e204bbed2f557678a765c2
BLAKE2b-256 1d70d96a11f13c1bea7ea02a7d1747d40f592c8a9ee75222746c3a9a8e54dfbb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page