F5-pycontrol
https://github.com/timfreund/pycontrol-shed/blob/master/pycontrolshed/model.py
https://github.com/swalberg/f5-icontrol/tree/master/lib/wsdl
New-VirtualEnvironment -Name F5Env
pip install suds, pycontrol
ipython
import suds
import sys
import pycontrol.pycontrol as pc
import getpass
print suds.__version__
print pc.__version__
dir(pc)
ltm = "10.10.0.76"
user = getpass.getuser()
passwd = getpass.getpass()
b = pc.BIGIP(
hostname = ltm,
username = user,
password = passwd,
fromurl = True,
wsdls = [
'LocalLB.NodeAddress', 'LocalLB.Pool', 'LocalLB.PoolMember',
'LocalLB.Rule', 'LocalLB.VirtualAddress', 'LocalLB.VirtualServer',
'Management.Partition', 'Networking.RouteDomain',
'Management.DeviceGroup', 'System.Failover',
])
dir(b.Management.DeviceGroup)
print b.Management.DeviceGroup.get_sync_status_overview()
syncstatus = b.Management.DeviceGroup.get_sync_status_overview()
dir(syncstatus)
print syncstatus.member_state
pools = b.LocalLB.Pool.get_list()
version = b.LocalLB.Pool.get_version()
print "Version is: %s\n" % version
print "Pools:"
# Note that pools.item represents the pool list. Return
# Structures from pycontrol2 are VERY different from the original.
for x in pools:
print "\t%s" % x
print b.System.Failover.get_failover_state()