Forum Discussion
davmec_127271
Nimbostratus
Nov 12, 2004problem using LocalLB.Pool.add_member
Hi!
I have been trying this code without success (no node added to the pool)
use SOAP::Lite + trace => qw(method debug);
use iControlTypeCa...
Nov 12, 2004
David, the signature for the add_members methods is the following
void add_member(
in String[] pool_names,
in IPPortDefinition[][] members
);
The idea is that you pass in a single dimensional array of pool_names and then a 2 dimensional array of members, 1 for each pool. This way you can add "n" different members for "m" pools. If the members parameter was a single dimensional array, it would add the list of members to all of the pools and more than likely that's not what would be wanted.
So, looking at your code:
$thepool = "NWG_WAP2";
$node = {address => "10.200.16.51", port => 8080};
$soapResponse = $Pool->add_member
(
SOAP::Data->name(pool_names => [$thepool]),
SOAP::Data->name(members => [$node])->type("IPPortDefinition")
);
&checkResponse($soapResponse);
it is passing in a single dimensional array for the members variable. Change your code to the following and you should be set.
my @pool_list = @_;
$member = {address => "10.200.16.51", port => 8080};
@members = ( [ $member ] ); Create Array of Array
$soapResponse = $Pool->add_member
(
SOAP::Data->name(pool_names => [@pool_list]),
SOAP::Data->name(members => [@members])
);
Check out this link (http://www.perldoc.com/perl5.8.4/pod/perllol.html) on perldoc.com about arrays of arrays. (I always get a chuckle out of this URL. The perl doc folks obviously have a sense of humor)...
-Joe
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