A simple client for the Infoblox NetMRI RESTful API.
Project description
A simple client for the Infoblox NetMRI RESTful API.
Free software: Apache license
Documentation: https://infoblox-netmri.readthedocs.org
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.client 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='{:30} {:16} {}' print(FORMAT.format('Device Name', 'IP Address', 'Vendor')) for d in devices['devices']: print(FORMAT.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 and https://github.com/infobloxopen/infoblox-netmri/tree/master/examples/tutorial for examples.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for infoblox_netmri-3.8.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb09cd7d35d226511da1f0ebef36fb51cdbfde584a58ae317482020ba9441131 |
|
MD5 | d23ab76743c0a3a2b065d8f8ce2fec4d |
|
BLAKE2b-256 | d2f71034900898ecc6f2eeb187d251456d7efeea354500c5238e61b17c94236c |