Forum Discussion
mfreeman451_606
Nimbostratus
Apr 22, 2009problem using LocalLB.Pool.add_member
I'm having trouble trying to add a member to an existing pool. The code I have seems to run fine with no errors, but when I login to the F5 through the GUI I don't see my new member showing up in the pool.
I read the previous topic regarding this and tried the same stuff you guys had suggested and I get the same result, code runs but it doesn't appear to be added.
Here is the code:
test.pl:
my $members = {
member =>
{ address => '10.0.0.1',
port => '80'
},
};
my $member = { address => "10.0.0.1", port => 80 };
my $pool_name = 'pool_mfreeman';
my $res = $local_pool->add_pool_member(
names => $pool_name,
member => $members,
) or die "Couldn't add pool member $pool_name\n";
Module.pm:
sub add_pool_member {
my $self = shift;
my %args = @_;
my $pool_names = $args{'names'};
my $member = $args{'member'};
my $pool = $self->{'object'};
my $soap_response = $pool->add_member(
SOAP::Data->name( pool_names => $pool_names ),
SOAP::Data->name( members => [$member] ),
);
die "Bad SOAP response!" unless ($self->check_response($soap_response));
print "Added pool member\n";
print Dumper($member) . "\n";
print "==\n";
}
Result:
Added pool member
$VAR1 = {
'member' => {
'address' => '172.16.144.198',
'port' => '80'
}
};
==
Called with URN: urn:iControl:LocalLB/Pool
--
Thoughts?
- mfreeman451_606
Nimbostratus
Here is some debug output. I thought maybe the same thing happening here http://devcentral.f5.com/Default.aspx?tabid=53&forumid=1&tpage=1&view=topic&postid=1961619617 was happening to me, but I see that my soapEnc type is an array? - mfreeman451_606
Nimbostratus
looks like i just needed: - Actually, I don't think that code will work either as you are only passing in a 1-d array for the members. The prototype for the methods is:
LocalLB.PoolMember.add_member( in String [] pool_names, in Common__IPPortDefinition [] [] members );
http://devcentral.f5.com/Wiki/default.aspx/iControl/PerlAddPoolMember.html
- mfreeman451_606
Nimbostratus
This code is working perfect and I don't need to do all that stuff with creating temporary arrays or whatever.. - Good deal, glad it's working. Figured the full script might help others as well.
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