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. For now only the get/create/delete methods are implemented. The possibility to modify items will be implementend soon.

The full documentation can be found here.

Installation

To get the latest version from Github:

$ pip install -e git+https://github.com/jagter/python-netbox.git#egg=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_per_rack('rack_name')

Get device by name

>>> netbox.dcim.get_device(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(device='device_name', interface_id=interface_id)

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.4.tar.gz (8.5 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: python-netbox-0.0.4.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for python-netbox-0.0.4.tar.gz
Algorithm Hash digest
SHA256 77187800490914a8387cf675db8de40f3c3dedda4fe11cfece468e8055a4f2ef
MD5 47c19f87c11cea87ec82e64b65046462
BLAKE2b-256 496a96ca894ef6ae8c0e129f2b681c135e94bc0e514cbb71a10dd1dc01763fc2

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