Skip to main content

A simple client for the Infoblox NetMRI RESTful API.

Project description

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.

import infoblox_netmri

c = infoblox_netmri.InfobloxNetMRI({
    'url': 'https://netmri/api/3',
    'username': 'admin',
    'password': 'password',
    'sslverify': False
})

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

Uploaded Source

Built Distribution

infoblox_netmri-0.1.2-py2.py3-none-any.whl (6.0 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

File hashes

Hashes for infoblox-netmri-0.1.2.tar.gz
Algorithm Hash digest
SHA256 dcd5bdb7cd6f89e444a114f7315ff240e1cbea6f771d72961e04c740a12474d6
MD5 69c6d4d956683a351eeec3f43e994c44
BLAKE2b-256 4124ef4b427e81ed9045f5f98a3ea4dac8f2c4eb779e3b073797dca16613bd9d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for infoblox_netmri-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 02a1e0923658b9f17a3e474c52ffdcc23b0b9ee27dec50375e7d79c01a591863
MD5 6192ce1cee4ddae688dc6a92aebd514e
BLAKE2b-256 66527b6b332b34ce5f6224842189eb9b0f4d3e39ff5aa1ac9293b5606393e530

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