Forum Discussion
Dec 07, 2010
Smart way to convert a PoolMemberDefinitionSequenceSequence to a IPPortDefinitionSequenceSequence
Hi,
I want to dump out (and eventually read in and set) the enabled state of each of my GTM pools pool members. Its easy to get a list of the pools and pool members, but the PoolMember.get_en...
L4L7_53191
Dec 07, 2010Nimbostratus
Andy: give this a go.
def member_factory(b, member):
'''
Produces a Common.IPPortDefinition object per member ip:port combination
object per member ip:port combination. Add these to Common.IPPortDefinitionSequence.
args: a pycontrol LocalLB.PoolMember object and an ip:port
combination that you'd like to add.
'''
ip,port = member.split(':')
pmem = b.LocalLB.PoolMember.typefactory.create('Common.IPPortDefinition')
pmem.address = ip
pmem.port = int(port)
return pmem
HTH,
-Matt
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