To all,
I’m trying to figure out how to determine what ‘Data Center’ is associated with each pool member. I’ve been digging, and the only way I can figure it out, is to determine the dependencies of the pool member, and grab the virtual server name. With that name, you would do a query $soapResponse = $Server->get_data_center(SOAP::Data->name(servers => [@list]));
If that is the most logical way to do it, then…I’m struggling with the $PoolMembers->get_dependency query.
The parameters are:
pool_names String[] The pool names to which the specified members belong.
members IPPortDefinition[][] The pool members.
However, I keep getting the following error:
Wide IP: <…>
Pool List: p-www-fineground
Availability: AVAILABILITY_STATUS_GREEN
Description: Pool p-www-fineground: Available
Load Balance: LB_METHOD_TOPOLOGY
Order: 0
Pool List: p-www-not-fineground
Availability: AVAILABILITY_STATUS_GREEN
Description: Pool p-www-not-fineground: Available
Load Balance: LB_METHOD_TOPOLOGY
Order: 1
Pool Member:
Member Order: 0
Active Topology Member:
Error: SOAP-ENV:Server Could not find element by name: members
...
if ( ("80" eq $sPort) or ("8080" eq $sPort) )
{
$sProtocol = "http";
}
if ( ($sHost eq "") or ($sPort eq "") or ($sUID eq "") or ($sPWD eq "") )
{
die ("Usage: AKOinfo.pl host port uid pwd\n");
}
----------------------------------------------------------------------------
Transport Information
----------------------------------------------------------------------------
sub SOAP::Transport::HTTP::Client::get_basic_credentials
{
return "$sUID" => "$sPWD";
}
$Pool = SOAP::Lite
-> ns('urn:iControl:GlobalLB/Pool')
-> proxy("$sProtocol://$sHost:$sPort/iControl/iControlPortal.cgi");
$PoolMember = SOAP::Lite
-> ns('urn:iControl:GlobalLB/PoolMember')
-> proxy("$sProtocol://$sHost:$sPort/iControl/iControlPortal.cgi");
$PoolMember->transport->http_request->header
(
'Authorization' =>
'Basic ' . MIME::Base64::encode("$sUID:$sPWD", '')
);
$Server = SOAP::Lite
-> ns('urn:iControl:GlobalLB/Server')
-> proxy("$sProtocol://$sHost:$sPort/iControl/iControlPortal.cgi");
$WideIP = SOAP::Lite
-> ns('urn:iControl:GlobalLB/WideIP')
-> proxy("$sProtocol://$sHost:$sPort/iControl/iControlPortal.cgi");
eval { $soap->transport->http_request->header
(
'Authorization' =>
'Basic ' . MIME::Base64::encode("$sUID:$sPWD", '')
);
};
sub PoolMemberDataCenter()
{
my @pool_name = "p-www-fineground";
my @pool_member = shift;
my $soapResponse1 = $Pool->get_member(SOAP::Data->name(pool_names =>[@pool_names]));
&checkResponse($soapResponse1);
my @memberAofA = @{$soapResponse1->result};
my $soapResponse = $PoolMember->get_dependency(SOAP::Data->name(pool_names=>[@pool_name],
members=>[@memberAofA]));
&checkResponse($soapResponse);
my @dataCenter = @{$soapResponse->result};
foreach my $dc (@dataCenter)
{
Verbose("\t\t\t\tDataCenter: $dc");
}
}