Skip to main content

A simple client for the Infoblox NetMRI RESTful API.

Project description

Infoblox NetMRI Client

https://codecov.io/github/infobloxopen/infoblox-netmri/coverage.svg?branch=master https://img.shields.io/travis/infobloxopen/infoblox-netmri.svg https://img.shields.io/pypi/v/infoblox-netmri.svg

A simple client for the Infoblox NetMRI RESTful API.

Features

  • Enables execution of RESTful API calls on the NetMRI via Python.

  • HTTP and HTTPS

Installation

Install infoblox-netmri using pip:

pip install infoblox-netmri

Usage

It’s simple to use. Just create an InfobloxNetMRI object and then call the api_request method. Almost every API request will return a dictionary. It will contain the outputs documented in the online API documentation.

from infoblox_netmri import InfobloxNetMRI

c = InfobloxNetMRI(host="netmri",
                   username="admin",
                   password="password")

devices = c.api_request('devices/index', {'limit': 10})

Now, devices contains a dictionary of the API call outputs. In this case, it contains the standard keys returned by “list” style methods (index, search, find - see the docs): current, start, limit, and the plural form of the model, devices. This last is an array of dictionaries with the device details, while the others describe the “paging” information of the result. So, we really want to loop through devices['devices']:

FORMAT='%30s %16s %10s'
print FORMAT % ('Device Name', 'IP Address', 'Vendor')
for d in devices['devices']:
    print FORMAT % (d['DeviceName'], d['DeviceIPDotted'], d['DeviceVendor'])

NetMRI Documentation

To see documentation on the calls available, visit the page /api/docs on your NetMRI.

Please also see https://github.com/infobloxopen/netmri-toolkit for examples.

History

0.1.5 (2017-08-09)

  • Fix issue #11, where an API versions numbers with a minor part were not seen as valid.

0.1.4 (2017-03-22)

  • Fix issue #7, where an expired session is never renewed.

  • Cleanup and make more Pythonic

0.1.3 (2016-02-19)

  • Implement authentication caching

0.1.2 (2016-01-07)

  • Fix issue passing strings to show and delete methods

  • Add Python 3 compatibility

0.1.1 (2015-11-11)

  • Fix module naming issue

0.1.0 (2015-11-09)

  • First release on PyPI.

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

infoblox-netmri-0.1.5.tar.gz (17.1 kB view details)

Uploaded Source

Built Distributions

infoblox_netmri-0.1.5-py2.py3-none-any.whl (8.0 kB view details)

Uploaded Python 2 Python 3

infoblox_netmri-0.1.5-py2.7.egg (9.3 kB view details)

Uploaded Source

File details

Details for the file infoblox-netmri-0.1.5.tar.gz.

File metadata

File hashes

Hashes for infoblox-netmri-0.1.5.tar.gz
Algorithm Hash digest
SHA256 c15019489983aaf216a00c1d15eee34dfaa790e9be116d138acb192d1f7a26e0
MD5 1b2a623dc6f1ad93561bed04d2934c71
BLAKE2b-256 196cf13d37181491ef897aeeecb11e3c282215f8cfc94d2848a87f6fa35a2df8

See more details on using hashes here.

File details

Details for the file infoblox_netmri-0.1.5-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for infoblox_netmri-0.1.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5fa05b7a930c38fca968238a8dc840ee7a87088648059167ee14aa7f51bbbb40
MD5 c34e9a32c3ca2d0db43097044df0f95d
BLAKE2b-256 4130acbbf5f48c19f35bed3c2ce6c1d28d759e61ab02c2f73434c069d4f99be5

See more details on using hashes here.

File details

Details for the file infoblox_netmri-0.1.5-py2.7.egg.

File metadata

File hashes

Hashes for infoblox_netmri-0.1.5-py2.7.egg
Algorithm Hash digest
SHA256 cac1bdefb84678a27808563e932e20e36cccbe1d7efb16eb636024a2a535d21e
MD5 15cd2b0c0e369419e50ff2bd13aff274
BLAKE2b-256 d9e8dbeb982e57a75adf92a9e786c3b0ba15b5948ee228b00c07218460cc29f9

See more details on using hashes here.

Supported by

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