Forum Discussion
May 06, 2008
First off, thanks for the amount of detail, that makes things eaasier on this end. Second, why are you getting the enabled state from the GlobalLB.VirtualServer interface? Since you are querying Pool Members, wouldn't you want to use the GlobalLB.PoolMember interface to get those enabled states? I'm going to proceed assuming that you want to use the PoolMember states. If you really want to use those pool members as virtual server states, then just change step 4.
So, here's what I would suggest. I would definitely not loop all of your calls, but make use of the arrays of inputs. You will need to build some new arrays as inputs to the methods, but after it's all said and done, you should only have to make 4 API calls.
1. GlobalLB.WideIP.get_list()
This returns a list of wideips. Pass this into the next method.
2. GlobalLB.WideIP.get_wideip_pool(wideip_list)
This returns a 2-d array of WideIPPool structures, one for each passed in wideip. Take the pool names out of here and build an array that contains all the pool names (pool_names) and pass that into the next method.
3. GlobalLB.Pool.get_member(pool_names)
This returns a 2-d array of PoolMemberDefinition structures containing the pool name and member details. Take each Member addr:port and build an array of Common.IPPortDefinition structures (member_list) containing each pool member's definition. Then pass that array into the following method.
4. GlobalLB.PoolMember.get_enabled_state(member_list)
During this, you may need to do some bookkeeping on where the pool members belong but you should have all the returned structures to do reverse lookups.
Hope this helps...
-Joe