Client for interacting with Infoblox NIOS over WAPI
Project description
===============================
Infoblox Client
===============================
.. image:: https://travis-ci.org/infobloxopen/infoblox-client.svg?branch=master
:target: https://travis-ci.org/infobloxopen/infoblox-client
.. image:: https://img.shields.io/pypi/v/infoblox-client.svg
:target: https://pypi-hypernode.com/pypi/infoblox-client
.. image:: https://codecov.io/github/infobloxopen/infoblox-client/coverage.svg?branch=master
:target: https://codecov.io/github/infobloxopen/infoblox-client?branch=master
Client for interacting with Infoblox NIOS over WAPI.
* Free software: Apache license
* Documentation: https://infoblox-client.readthedocs.org.
Installation
------------
Install infoblox-client using pip:
::
pip install infoblox-client
Usage
-----
1. Low level API, using connector module.
Retrieve list of network views from NIOS:
::
from infoblox_client import connector
opts = {'host': '192.168.1.10', 'username': 'admin', 'password': 'admin'}
conn = connector.Connector(opts)
# get all network_views
network_views = conn.get_object('networkview')
For this request data is returned as list of dicts:
::
[{u'_ref': u'networkview/ZG5zLm5ldHdvcmtfdmlldyQw:default/true',
u'is_default': True,
u'name': u'default'}]
2. High level API, using objects.
Example of creating Network View, Network, DNS View, DNSZone and HostRecord using NIOS objects:
::
from infoblox_client import connector
from infoblox_client import objects
opts = {'host': '192.168.1.10', 'username': 'admin', 'password': 'admin'}
conn = connector.Connector(opts)
nview = objects.NetworkView.create(conn, name='my_view')
network = objects.Network.create(conn, network_view='my_view', cidr='192.168.1.0/24')
view = objects.DNSView.create(conn, network_view='my_view', name='my_dns_view')
zone = objects.DNSZone.create(conn, view='my_dns_view', fqdn='my_zone.com')
my_ip = objects.IP.create(ip='192.168.1.25', mac='aa:bb:cc:11:22:33')
hr = objects.HostRecord.create(conn, view='my_dns_view',
name='my_host_record.my_zone.com', ip=my_ip)
Reply from NIOS is parsed back into objects and contains next data:
::
In [22]: hr
Out[22]: HostRecordV4: _ref=record:host/ZG5zLmhvc3QkLjQuY29tLm15X3pvbmUubXlfaG9zdF9yZWNvcmQ:my_host_record.my_zone.com/my_dns_view, name=my_host_record.my_zone.com, ipv4addrs=[<infoblox_client.objects.IPv4 object at 0x7f7d6b0fe9d0>], view=my_dns_view
Objects Interface
-----------------
All top level objects support interface for CRUD operations. List of supported objects is defined in next section.
- create(cls, connector, check_if_exists=True, update_if_exists=False, **kwargs)
Creates object on NIOS side.
Requires connector passed as the first argument, check_if_exists and update_if_exists are optional.
Object related fields are passed in as kwargs: field=value, field2=value2.
- search(cls, connector, return_fields=None, search_extattrs=None, force_proxy=False, **kwargs)
Search single object on NIOS side, returns first object that match search criteria.
Requires connector passed as the first argument.
'return_fields' can be set to retrieve particular fields from NIOS,
for example return_fields=['view', 'name'].
If 'return_fields' is '[]' default return_fields are returned by NIOS side for current wapi_version.
'search_extattrs' used to filter out results by extensible attributes.
'force_proxy' forces search request to be processed on Grid Master (applies only in cloud environment)
- search_all(cls, connector, return_fields=None, search_extattrs=None, force_proxy=False, **kwargs)
Search all objects on NIOS side that match search cryteria. Returns list of objects.
All other options are equal to search().
- update(self)
Update object on NIOS side by pushing changes done in local object.
- delete(self)
Deletes object from NIOS side.
Supported NIOS objects
----------------------
* NetworkView for 'networkview'
* DNSView for 'view'
* DNSZone for 'zone_auth'
* Member for 'member'
* Network (V4 and V6)
* NetworkV4 for 'network'
* NetworkV6 for 'ipv6network'
* IPRange (V4 and V6)
* IPRangeV4 for 'range'
* IPRangeV6 for 'ipv6range'
* HostRecord (V4 and V6)
* HostRecordV4 for 'record:host'
* HostRecordV6 for 'record:host'
* FixedAddress (V4 and V6)
* FixedAddressV4 for 'fixedaddress'
* FixedAddressV6 for 'ipv6fixedaddress'
* IPAddress (V4 and V6)
* IPv4Address for 'ipv4address'
* IPv6Address for 'ipv6address'
* ARecordBase
* ARecord for 'record:a'
* AAAARecord for 'record:aaaa'
* PtrRecord (V4 and V6)
* PtrRecordV4 for 'record:ptr'
* PtrRecordV6 for 'record:ptr'
* EADefinition for 'extensibleattributedef'
Features
--------
* TODO
History
-------
0.0.10 (2015-11-19)
___________________
* Add utility to determine supported feature
* Update README.rst with objects interface
0.0.9 (2015-11-13)
__________________
* Add allowed_object_types field for EA Definition
* Allow to return default fields for object
* Update README.rst with list of supported objects
0.0.8 (2015-11-12)
___________________
* Add Extensible Attributes Definition support
* Fixed options processing for create_network in object_manager
* Fixed missed DNSZone object in create_dns_zone
0.0.7 (2015-10-27)
____________________
* Added 'network' to IPRange search fields
* Modified `get` method of the EA class to allow return default values
0.0.6 (2015-10-26)
____________________
* Added initial support of Extensible Attributes as sub objects
* Added search by Extensible Attributes
* Improved validation in connector
* Added delete_object_by_ref to object manager
0.0.5 (2015-10-12)
____________________
* Fixed issues in working with objects
* Added missed _get_object_type_from_ref
* Added code coverage
* Updated links to point to infobloxopen repository
0.0.4 (2015-09-23)
____________________
* Added object abstraction for interacting with NIOS objects
* Added object_manager to simplify some operations on objects
0.0.3 (2015-09-15)
____________________
* Added dependencies to package.
0.0.2 (2015-09-11)
____________________
* Fixed using dashes in package directory names that prevented package import after install.
0.0.1 (2015-09-11)
---------------------
* Added connector to send wapi requests to NIOS, does not includes NIOS object model at this point.
* First release on PyPI.
Infoblox Client
===============================
.. image:: https://travis-ci.org/infobloxopen/infoblox-client.svg?branch=master
:target: https://travis-ci.org/infobloxopen/infoblox-client
.. image:: https://img.shields.io/pypi/v/infoblox-client.svg
:target: https://pypi-hypernode.com/pypi/infoblox-client
.. image:: https://codecov.io/github/infobloxopen/infoblox-client/coverage.svg?branch=master
:target: https://codecov.io/github/infobloxopen/infoblox-client?branch=master
Client for interacting with Infoblox NIOS over WAPI.
* Free software: Apache license
* Documentation: https://infoblox-client.readthedocs.org.
Installation
------------
Install infoblox-client using pip:
::
pip install infoblox-client
Usage
-----
1. Low level API, using connector module.
Retrieve list of network views from NIOS:
::
from infoblox_client import connector
opts = {'host': '192.168.1.10', 'username': 'admin', 'password': 'admin'}
conn = connector.Connector(opts)
# get all network_views
network_views = conn.get_object('networkview')
For this request data is returned as list of dicts:
::
[{u'_ref': u'networkview/ZG5zLm5ldHdvcmtfdmlldyQw:default/true',
u'is_default': True,
u'name': u'default'}]
2. High level API, using objects.
Example of creating Network View, Network, DNS View, DNSZone and HostRecord using NIOS objects:
::
from infoblox_client import connector
from infoblox_client import objects
opts = {'host': '192.168.1.10', 'username': 'admin', 'password': 'admin'}
conn = connector.Connector(opts)
nview = objects.NetworkView.create(conn, name='my_view')
network = objects.Network.create(conn, network_view='my_view', cidr='192.168.1.0/24')
view = objects.DNSView.create(conn, network_view='my_view', name='my_dns_view')
zone = objects.DNSZone.create(conn, view='my_dns_view', fqdn='my_zone.com')
my_ip = objects.IP.create(ip='192.168.1.25', mac='aa:bb:cc:11:22:33')
hr = objects.HostRecord.create(conn, view='my_dns_view',
name='my_host_record.my_zone.com', ip=my_ip)
Reply from NIOS is parsed back into objects and contains next data:
::
In [22]: hr
Out[22]: HostRecordV4: _ref=record:host/ZG5zLmhvc3QkLjQuY29tLm15X3pvbmUubXlfaG9zdF9yZWNvcmQ:my_host_record.my_zone.com/my_dns_view, name=my_host_record.my_zone.com, ipv4addrs=[<infoblox_client.objects.IPv4 object at 0x7f7d6b0fe9d0>], view=my_dns_view
Objects Interface
-----------------
All top level objects support interface for CRUD operations. List of supported objects is defined in next section.
- create(cls, connector, check_if_exists=True, update_if_exists=False, **kwargs)
Creates object on NIOS side.
Requires connector passed as the first argument, check_if_exists and update_if_exists are optional.
Object related fields are passed in as kwargs: field=value, field2=value2.
- search(cls, connector, return_fields=None, search_extattrs=None, force_proxy=False, **kwargs)
Search single object on NIOS side, returns first object that match search criteria.
Requires connector passed as the first argument.
'return_fields' can be set to retrieve particular fields from NIOS,
for example return_fields=['view', 'name'].
If 'return_fields' is '[]' default return_fields are returned by NIOS side for current wapi_version.
'search_extattrs' used to filter out results by extensible attributes.
'force_proxy' forces search request to be processed on Grid Master (applies only in cloud environment)
- search_all(cls, connector, return_fields=None, search_extattrs=None, force_proxy=False, **kwargs)
Search all objects on NIOS side that match search cryteria. Returns list of objects.
All other options are equal to search().
- update(self)
Update object on NIOS side by pushing changes done in local object.
- delete(self)
Deletes object from NIOS side.
Supported NIOS objects
----------------------
* NetworkView for 'networkview'
* DNSView for 'view'
* DNSZone for 'zone_auth'
* Member for 'member'
* Network (V4 and V6)
* NetworkV4 for 'network'
* NetworkV6 for 'ipv6network'
* IPRange (V4 and V6)
* IPRangeV4 for 'range'
* IPRangeV6 for 'ipv6range'
* HostRecord (V4 and V6)
* HostRecordV4 for 'record:host'
* HostRecordV6 for 'record:host'
* FixedAddress (V4 and V6)
* FixedAddressV4 for 'fixedaddress'
* FixedAddressV6 for 'ipv6fixedaddress'
* IPAddress (V4 and V6)
* IPv4Address for 'ipv4address'
* IPv6Address for 'ipv6address'
* ARecordBase
* ARecord for 'record:a'
* AAAARecord for 'record:aaaa'
* PtrRecord (V4 and V6)
* PtrRecordV4 for 'record:ptr'
* PtrRecordV6 for 'record:ptr'
* EADefinition for 'extensibleattributedef'
Features
--------
* TODO
History
-------
0.0.10 (2015-11-19)
___________________
* Add utility to determine supported feature
* Update README.rst with objects interface
0.0.9 (2015-11-13)
__________________
* Add allowed_object_types field for EA Definition
* Allow to return default fields for object
* Update README.rst with list of supported objects
0.0.8 (2015-11-12)
___________________
* Add Extensible Attributes Definition support
* Fixed options processing for create_network in object_manager
* Fixed missed DNSZone object in create_dns_zone
0.0.7 (2015-10-27)
____________________
* Added 'network' to IPRange search fields
* Modified `get` method of the EA class to allow return default values
0.0.6 (2015-10-26)
____________________
* Added initial support of Extensible Attributes as sub objects
* Added search by Extensible Attributes
* Improved validation in connector
* Added delete_object_by_ref to object manager
0.0.5 (2015-10-12)
____________________
* Fixed issues in working with objects
* Added missed _get_object_type_from_ref
* Added code coverage
* Updated links to point to infobloxopen repository
0.0.4 (2015-09-23)
____________________
* Added object abstraction for interacting with NIOS objects
* Added object_manager to simplify some operations on objects
0.0.3 (2015-09-15)
____________________
* Added dependencies to package.
0.0.2 (2015-09-11)
____________________
* Fixed using dashes in package directory names that prevented package import after install.
0.0.1 (2015-09-11)
---------------------
* Added connector to send wapi requests to NIOS, does not includes NIOS object model at this point.
* 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
infoblox-client-0.0.10.tar.gz
(30.9 kB
view details)
Built Distribution
File details
Details for the file infoblox-client-0.0.10.tar.gz
.
File metadata
- Download URL: infoblox-client-0.0.10.tar.gz
- Upload date:
- Size: 30.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 720e0fa09c657222aadf1f2de905cfa50044cc5e9293481b7ec26e720dc44404 |
|
MD5 | c49d0bf0f25e8fb2bae2d37a834309e7 |
|
BLAKE2b-256 | 94fe61948c64a95a1c323bbe0430dc8de05a2ad9b6940ba3481b980b5deb690f |
File details
Details for the file infoblox_client-0.0.10-py2.py3-none-any.whl
.
File metadata
- Download URL: infoblox_client-0.0.10-py2.py3-none-any.whl
- Upload date:
- Size: 26.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef27a7ee05497cade6fe38bfcd76ceda2b270b665fe8c4dad0baa34963d4cd82 |
|
MD5 | 5ce67c29b022b464a8c5343a4bf19fac |
|
BLAKE2b-256 | 4e8bf032ad8a7f46e513b61088ffe008fcc8df2850f0be40f7f5d7e5605e9304 |