This project implements the subset of Infoblox API via REST API
Class Infoblox implements the following methods:
- create_network
- delete_network
- create_networkcontainer
- delete_networkcontainer
- get_next_available_network
- create_host_record
- create_txt_record
- delete_host_record
- delete_txt_record
- add_host_alias
- delete_host_alias
- create_cname_record
- delete_cname_record
- update_cname_record
- create_dhcp_range
- delete_dhcp_range
- get_next_available_ip
- get_host
- get_host_by_ip
- get_ip_by_host
- get_host_by_extattrs
- get_host_by_regexp
- get_txt_by_regexp
- get_host_extattrs
- get_network
- get_network_by_ip
- get_network_by_extattrs
- get_network_extattrs
- update_network_extattrs
- delete_network_extattrs
- get_dhcp_range
- create_fixed_address
- get_fixed_address
- delete_fixed_address
- get_grid
- restart_grid_services
- get_pending_changes
- get_lease
Example:
import infoblox
iba_api = infoblox.Infoblox('10.10.20.32', 'admin', 'secret', '1.6', 'internal', 'default')
try:
ip = iba_api.create_host_record('192.168.0.0/24', 'mytest.example.com')
print ip
except Exception as e:
print e
__init__(self, iba_ipaddr, iba_user, iba_password, iba_wapi_version, iba_dns_view, iba_network_view, iba_verify_ssl=False)
Class initialization method :param iba_ipaddr: IBA IP address of management interface :param iba_user: IBA user name :param iba_password: IBA user password :param iba_wapi_version: IBA WAPI version (example: 1.0) :param iba_dns_view: IBA default view :param iba_network_view: IBA default network view :param iba_verify_ssl: IBA SSL certificate validation (example: False)
Implements IBA REST API call to add an alias to IBA host record :param host_fqdn: host record name in FQDN :param alias_fqdn: host record name in FQDN
Implements IBA REST API call to create IBA cname record :param canonical: canonical name in FQDN format :param name: the name for a CNAME record in FQDN format
Implements IBA REST API call to add DHCP range for given start and end addresses :param start_ip_v4: IP v4 address :param end_ip_v4: IP v4 address
Implements IBA REST API call to create IBA host record Returns IP v4 address assigned to the host :param address: IP v4 address or NET v4 address in CIDR format to get next_available_ip from :param fqdn: hostname in FQDN
Implements IBA REST API call to create DHCP network object :param network: network in CIDR format
Implements IBA REST API call to create DHCP network containert object :param networkcontainer: network container in CIDR format
Implements IBA REST API call to create IBA txt record Returns IP v4 address assigned to the host :param text: free text to be added to the record :param fqdn: hostname in FQDN
Implements IBA REST API call to delete IBA cname record :param fqdn: cname in FQDN
Implements IBA REST API call to delete DHCP range for given start and end addresses :param start_ip_v4: IP v4 address :param end_ip_v4: IP v4 address
Implements IBA REST API call to add an alias to IBA host record :param host_fqdn: host record name in FQDN :param alias_fqdn: host record name in FQDN
Implements IBA REST API call to delete IBA host record :param fqdn: hostname in FQDN
Implements IBA REST API call to delete DHCP network object :param network: network in CIDR format
Implements IBA REST API call to delete network extensible attributes :param network: network in CIDR format :param attributes: array of extensible attribute names
Implements IBA REST API call to delete DHCP network container object :param networkcontainer: network container in CIDR format
Implements IBA REST API call to delete IBA TXT record :param fqdn: hostname in FQDN
Implements IBA REST API call to retrieve host record fields Returns hash table of fields with field name as a hash key :param fqdn: hostname in FQDN :param fields: comma-separated list of field names (optional)
Implements IBA REST API call to find host by it's extensible attributes Returns array of hosts in FQDN :param attributes: comma-separated list of attrubutes name/value pairs in the format: attr_name=attr_value - exact match for attribute value attr_name:=attr_value - case insensitive match for attribute value attr_name~=regular_expression - match attribute value by regular expression attr_name>=attr_value - search by number greater than value attr_name<=attr_value - search by number less than value attr_name!=attr_value - search by number not equal of value
Implements IBA REST API call to find hostname by IP address Returns array of host names in FQDN associated with given IP address :param ip_v4: IP v4 address
Implements IBA REST API call to retrieve host records by fqdn regexp filter Returns array of host names in FQDN matched to given regexp filter :param fqdn: hostname in FQDN or FQDN regexp filter
Implements IBA REST API call to retrieve host extensible attributes Returns hash table of attributes with attribute name as a hash key :param fqdn: hostname in FQDN :param attributes: array of extensible attribute names (optional)
Implements IBA REST API call to find IP addresses by hostname Returns array of IP v4 addresses associated with given hostname :param fqdn: hostname in FQDN
Implements IBA REST API call to retrieve network object fields Returns hash table of fields with field name as a hash key :param network: network in CIDR format :param fields: comma-separated list of field names (optional, returns network in CIDR format and netmask if not specified)
Implements IBA REST API call to find a network by it's extensible attributes Returns array of networks in CIDR format :param attributes: comma-separated list of attrubutes name/value pairs in the format: attr_name=attr_value - exact match for attribute value attr_name:=attr_value - case insensitive match for attribute value attr_name~=regular_expression - match attribute value by regular expression attr_name>=attr_value - search by number greater than value attr_name<=attr_value - search by number less than value attr_name!=attr_value - search by number not equal of value
Implements IBA REST API call to find network by IP address which belongs to this network Returns network in CIDR format :param ip_v4: IP v4 address
Implements IBA REST API call to retrieve network extensible attributes Returns hash table of attributes with attribute name as a hash key :param network: network in CIDR format :param attributes: array of extensible attribute names (optional)
Implements IBA next_available_ip REST API call Returns IP v4 address :param network: network in CIDR format
Implements IBA REST API call to retrieve next available network of network container Returns network address in CIDR format :param networkcontainer: network container address in CIDR format :param cidr: requested network length (from 0 to 32)
Implements IBA REST API call to retrieve TXT records by fqdn regexp filter Returns dictonary of host names in FQDN matched to given regexp filter with the TXT value :param fqdn: hostname in FQDN or FQDN regexp filter
Implements IBA REST API call to update or repoint IBA cname record :param canonical: canonical name in FQDN format :param name: the name for the new CNAME record in FQDN format
Implements IBA REST API call to add or update network extensible attributes :param network: network in CIDR format :param attributes: hash table of extensible attributes with attribute name as a hash key
Implements IBA REST API call to retrieve a DHCP Range by CIDR network :param network: Network (in CIDR format) to get the DHCP Range for
Implements IBA REST API call to create a Fixed Address Record :param ipv4addr: IPv4 Address of object to put on the Record :param mac: Mac Address of object to put on the Record
Implements IBA REST API call to get a Fixed Address Record :param ipv4addr: IPv4 Address of object to get :param mac: Mac Address of object to get
Implements IBA REST API call to delete a Fixed Address Record :param ipv4addr: IPv4 Address of object to delete :param mac: Mac Address of object to delete
Implements IBA REST API call to det a Grid Object :param query_params: Dictionary of searchable fields on Grid object. :param fields: Fields to return from the Grid object
Implements IBA REST API call to restart Grid Services :param name: Name of a Grid object. :param payload: Dictionary of fields used to restart services.
Implements IBA REST API call to get pending changes on the Grid
Implements IBA REST API call to retrieve a DHCP Lease :param query_params: dictionary of fields to query lease against :param fields: comma-separated list of field names (optional) :param not_found_fail: Raise an exception if nothing is found.