Newer
Older
# Infoblox API
This project implements the subset of Infoblox API via REST API
## Infoblox API python module
Class **Infoblox** implements the following methods:
- create_network
- delete_network
- create_networkcontainer
- delete_networkcontainer
- add_host_alias
- delete_host_alias
- create_cname_record
- delete_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_extattrs
- get_network
- get_network_by_ip
- get_network_by_extattrs
- get_network_extattrs
- update_network_extattrs
- delete_network_extattrs
* * *
### How to use
Example:
```
import infoblox
iba_api = infoblox.Infoblox('10.10.20.32', 'admin', 'secret', '1.6', 'internal', 'default')
ip = iba_api.create_host_record('192.168.0.0/24', 'mytest.example.com')
print ip
## Infoblox CLI tool
a simple command line tool to quickly manipulate the infoblox database using the WAPI
### How to use
1. create an infoblox user with api access
1. put the credentials in a local config file "~/.ib-cli.conf"
apiuser: <username>
apipass: <apipassphrase>
```
1. call the command with appropriate arguments (-h for help)
```
usage: ib-cli [-h] [--view {default,external}]
{get_host,get_host_by_ip,create_host_record,delete_host_record}
...
optional arguments:
-h, --help show this help message and exit
--view {default,external}
DNS view
commands:
{get_host,get_host_by_ip,create_host_record,delete_host_record}
get_host retrieve hostobject by fqdn
get_host_by_ip retrieve hostname by ip address
create_host_record create new host object
delete_host_record delete an host object
No hosts found: myhost.domain.local
$ ./ib-cli.py get_host_by_ip 10.10.10.5
No host records found for IP: 10.10.10.5
$ ./ib-cli.py create_host_record 10.10.10.5 myhost.domain.local
10.10.10.5
$ ./ib-cli.py delete_host_record myhost.domain.local
None
```