Infoblox NIOS的接口和CLI应用程序
项目描述
这是一个非官方的Python库,用于与Infoblox NIOS交互。此库与Infoblox, Inc.没有任何关联。
文档
需求
Python 2.6, 2.7, 3.2, 3.3
argparse <http://pypi.python.org/pypi/argparse> (仅限Python 2.6)
requests <http://docs.python-requests.org/en/latest/>
CLI使用
usage: infoblox-host [-h] [--version] [--debug] [-u USERNAME] [-p PASSWORD]
<Infoblox Address> {add,remove} <FQDN> [IPv4 Address] [COMMENT]
Add or remove a host from the Infoblox appliance
positional arguments:
<Infoblox Address> The Infoblox hostname
{add,remove} Specify if you are adding or removing a host
<FQDN> The FQDN for the host
[IPv4 Address] The IPv4 address for the host
[COMMENT] A comment set on the host when adding.
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
--debug Enable debug output
-u USERNAME, --username USERNAME
The username to perform the work as. Default: admin
-p PASSWORD, --password PASSWORD
The password to authenticate with. Default: infoblox
库使用
import infoblox
session = infoblox.Session('127.0.0.1', 'admin', 'infoblox')
host = infoblox.Host(session)
host.name = 'foo.bar.net'
host.add_ipv4addr('10.0.0.1')
if host.save():
print('Host saved')