Forum Discussion
Sep 13, 2013
This Should get you going. I wrote this for the first time here, so it's not tested. Hopefully there aren't any bad typos...
In the future, check out the iControl CodeShare for a lot of Perl examples. A list of perl specific examples can be found here: https://devcentral.f5.com/wiki/iControl.perl.ashx
use SOAP::Lite
use MIME::Base64
BIG-IP address
$bigip = "10.10.10.10";
$user = "someuser";
$pass = "somepass";
sub SOAP::Transport::HTTP::Client::get_basic_credentials
{
return "$user" => "$pass";
}
$Pool = SOAP::Lite
-> url("urn:iControl:LocalLB/Pool")
-> proxy("https://$bigip/iControl/iControlPortal.cgi");
Get list of pools
my $soapResponse = $Pool->get_list();
my @pool_list = @{$soapResponse->result};
$soapResponse = $Pool.get_member_v2(
SOAP::Data->name(pool_names => [@pool_list])
);
@AddressPortAofA = @{$soapResponse->result};
for $i (0 .. $pool_list)
{
$pool = $pool_list[$i];
print "+ POOL $pool";
@AddressPortA = @{$AddressPortAofA[$i]};
foreach $j (0 .. $AddressPortA)
{
$AddressPort = @AddressPortA[$j];
$address = $AddressPort->{"address"};
$port = $AddressPort->{"port"};
print "| ${address}:${port}";
}
}
Hope this helps...
-Joe