Forum Discussion
Alexander_Stewa
Nimbostratus
May 02, 2007Help with PoolMember get_object_status on dozens of pools
So I'm writing an iControl program in perl that essentially recreates the network map that was the main page of BigIP 4.x I have the following working:
All VIPs
Status of all VIPs
All Pools in...
May 03, 2007
Alex, all our methods in 9.x allow for multiple input values so you can pass in more than one pool name in a single request. In your example, you are passing in an array with only a single pool per call. One thing I'm also wondering about in your code sample is why you are passing in the members parameter since the PoolMember::get_object_status() method only takes a single parameter (list of pools).
http://devcentral.f5.com/Wiki/default.aspx/iControl/LocalLB__PoolMember__get_object_status.html
Click here
MemberObjectStatus [] [] LocalLB:oolMember::get_object_status(
in String [] pool_names
);
Here's some code that makes one call to get a list of all the pools, and then a second call to request the pool members statuses for all the pools.
$Pool = SOAP::Lite
-> uri('urn:iControl:LocalLB/Pool')
-> readable(1)
-> proxy("$sProtocol://$sHost:$sPort/iControl/iControlPortal.cgi");
$PoolMember = SOAP::Lite
-> uri('urn:iControl:LocalLB/PoolMember')
-> readable(1)
-> proxy("$sProtocol://$sHost:$sPort/iControl/iControlPortal.cgi");
$soapResponse = $Pool->get_list();
@pool_list = @{$soapResponse->result};
$soapResponse = $PoolMember->get_object_status(
SOAP::Data->name(pool_names => [@pool_list])
);
@member_object_status_AofA = @{$soapResponse->result};
$i = 0;
foreach $pool (@pool_list)
{
print "POOL $pool\n";
@member_object_status_list = @{@member_object_status_AofA[$i]};
foreach $member_object_status (@member_object_status_list)
{
$member = $member_object_status->{"member"};
$address = $member->{"address"};
$port = $member->{"port"};
$object_status = $member_object_status->{"object_status"};
$availability_status = $object_status->{"availability_status"};
$enabled_status = $object_status->{"enabled_status"};
$status_description = $object_status->{"status_description"};
print " MEMBER $address:$port\n";
print " $availability_status\n";
print " $enabled_status\n";
print " $status_description\n";
}
$i++;
}
So, no matter how many pools or members you have, it'll only take two calls.
You can do similar things with virtuals and nodes. Also, look for the "get_all*" methods in some of the interfaces. That make help out with avoiding having to query a list first.
Let me know if anything else comes up...
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
