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 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.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
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
File details
Details for the file infoblox-netmri-0.1.4.tar.gz
.
File metadata
- Download URL: infoblox-netmri-0.1.4.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a9828f3a0e0dfb96a3fe9828df887fd618c3a7b95bb50f1739311864bde6634 |
|
MD5 | 91118ea31d668eab1782546cd052c60b |
|
BLAKE2b-256 | bd245bf711f1a8f73e923f54ef2e7f521862309e3230630f130d5f3672fdf816 |
File details
Details for the file infoblox_netmri-0.1.4-py2.py3-none-any.whl
.
File metadata
- Download URL: infoblox_netmri-0.1.4-py2.py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4dfdbb3eaac802143509bce973cbdefd22bed8a6408d40e34f62b73e10dce2f |
|
MD5 | 3477c4b348abe9a35f2499e4ef609fa9 |
|
BLAKE2b-256 | ef29a4ee3346f75a8ba1a0ffa1dfebd7cca24afd26edbf3723a9570e87b5dae2 |