andy_12_5042
Jul 19, 2011Nimbostratus
create a pool with members
For some reason I will hit these walls every once in a while as I have to keep wrapping my head around the best way to implement something with pycontrol.
I am trying to figure out the best way to create a pool with multiple members. I have built a web service that I want to be able to make call to create a pool with 1 or more members. The problem I am having is how do you feed in the member ip port definitions via a web call?
I can do this fine with what I will call a one off type script.. However, I need to instantiate an instance of a Common.IPPortDefinition for each member in a single call. I am sure this is not rocket science but this is where I am lacking in development experience. I am looking to get this to work dynamicall regardless of how many members are passed or pools.....
I am referring to something like this :
member1= b.LocalLB.PoolMember.typefactory.create('Common.IPPortDefinition')
member2= b.LocalLB.PoolMember.typefactory.create('Common.IPPortDefinition')
If anyone can point me in the right direction that would be great. One thing I have learned as I have been building stuff with pycontrol is that once I see the correct logic, I usually think wow that is so simple while I was trying to re-invent the wheel :)
love pycontrol and python in general!
thanks for any help