Forum Discussion
bdavidfr_8739
Jun 20, 2010Historic F5 Account
pyControl with GTM to add member into Pool
Hi,
I try to use pyControl to add member to a Pool on GTM. I used the following code :
print 'Adding the new VS to the Pool'
p = b.GlobalLB.Pool
IpPortDef = [{'address' : SRV_Addr, 'port' : 80 }]
New_Member =[[{'member' : IpPortDef, 'order' : 1}]]
print New_Member
p.add_member( pool_names = Wide_Ip_Pool_Name , members = New_Member)
But I always receive :
Error Adding VS to Pool
Server raised fault: 'Could not find element by name: member'
Could somebody can help me ?????
- L4L7_53191
Nimbostratus
I have a feeling I know what is going on. The issue is that the ‘members’ keyword actually needs a ‘sequencesequence’, which you’ve tried to represent by a nested list:members=[[PMD]]
In [14]: seq = b.GlobalLB.Pool.typefactory.create('GlobalLB.Pool.PoolMemberDefinitionSequence') In [14]: seq.items = [] Make an attribute called ‘items’ that is a list object.
seq.items.append(PMD) add the PMD to this list object.
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