I’m trying to write a very basic python script to add a pool member to an existing pool, then disable it. My script is this:
!/usr/bin/env python
import pycontrol.pyControl as pc
from pycontrol.Utils import show_status
b = pc.BIGIP(hostname=‘172.24.42.13’, username=‘admin’, password=‘admin’,wsdl_files=[‘LocalLB.PoolMember’,‘LocalLB.Pool’])
mbr = b.LocalLB_PoolMember
pl = b.LocalLB_Pool
new_member = [[{‘address’:‘10.10.10.111’, ‘port’:80}]]
pl.add_member(pool_names=[‘mypool’], members=new_member)
pc.disable_member(pool=[‘mypool’], member=[{‘address’:‘10.10.10.111’, ‘port’:80}])
However when I run it, I get an error of:
Loading WSDL: LocalLB.PoolMember.wsdl
Loading WSDL: LocalLB.Pool.wsdl
Traceback (most recent call last):
File “C:\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py”, line 309, in RunScript
debugger.run(codeObject, __main__.__dict__, start_stepping=0)
File “C:\Python25\Lib\site-packages\pythonwin\pywin\debugger\__init__.py”, line 60, in run
_GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
File “C:\Python25\Lib\site-packages\pythonwin\pywin\debugger\debugger.py”, line 624, in run
exec cmd in globals, locals
File “C:\scripts\test.py”, line 12, in
pc.disable_member(pool=[‘mypool’], member=[{‘address’:‘10.10.10.111’, ‘port’:80}])
TypeError: disable_member() takes at least 1 non-keyword argument (0 given)
I’m pretty new to Python, but I can’t figure out what non-keyword argument disable_member() is looking for. Help!