Forum Discussion
Aug 07, 2012
Hi corpkid, you are indeed doing it the long way. With the iControl methods you can pass in arrays of objects allowing you to manipulate many pool members for a given pool or even multiple pools with many pool members in each in a single call.
The issues with the sample that you picked out is that it's gracefully shutting down the pool members by disabling new connections, querying the current connection statistics, and then when that reaches zero, turning the monitor state off. If you wanted to keep that functionality in, you'll have to change the method calls to pass in the 2-D parameter for the MemberSessionStateAofA with more values in it for the added pool members, query the statistics for all of them and wait until they all go to zero, and then change the MemberMonitorStateAofA variable to take all the members.
Now, if you don't care shutting things down "cleanly", you could just make the two method calls to set_session_enabled_state() and set_monitor_state() with the array of pool members. But, that depends on your implementation.