Forum Discussion
Patrick_Chang_7
Sep 22, 2011Historic F5 Account
pycontrol pool.add_member problem
I have a customer who is trying pycontrol and got the following: >>> b =
pc.BIGIP( ...
hostname = LTM, ...
username = USER, ...
password = PASS, ...
...
Patrick_Chang_7
Sep 22, 2011Historic F5 Account
Turns out that the pool member had to be created with the correct structure. The devcentral examples are not quite right.
http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/51/aft/1172647/showtab/groupforums/Default.aspx
>>> member_seq = s.LocalLB.Pool.typefactory.create('Common.IPPortDefinitionSequenceSequence')
>>> member_seq.items = []
>>> new_member = s.LocalLB.Pool.typefactory.create('Common.IPPortDefinition')
>>> new_member.address='1.2.3.4'
>>> new_member.port='80'
>>> member_seq.items.append(new_member)
>>> s.LocalLB.Pool.get_list()
[pool1]
>>> s.LocalLB.Pool.add_member(pool_names=["pool1"], members=[member_seq])
>>> s.LocalLB.Pool.get_member(pool_names=["pool1"])
[[(Common.IPPortDefinition){
address = "1.2.3.4"
port = 80
}]]
>>>
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects