Forum Discussion
kennemt_50219
Sep 20, 2011Nimbostratus
set_priority (perl)
Hey all,
I'm fairly new to iControl, and I'm trying to write a perl script to dynamically alter member priorities in . I'm working with LTM version 10.2.1 so I have to use the PoolMember interface rather than Pool. Using scripts from codeshare as a model, this is the meat of what I've come up with. Unfortunately, although it doesn't throw any errors, it also doesn't appear to do anything. Can anybody tell me what I'm missing?
$Pool = SOAP::Lite
-> uri('urn:iControl:LocalLB/PoolMember')
-> proxy("$sProtocol://$ichost/iControl/iControlPortal.cgi");
$Pool->transport->http_request->header (
'Authorization' => 'Basic ' . MIME::Base64::encode("$UID:$PWD", '')
);
my $member = {
address => "10.100.125.18",
port => "443"
};
my $member_priority = (
member => $member,
priority => "2"
);
push @memberPriorityList, $member_priority;
push @memberPriorityLists, @memberPriorityList;
$soapResponse = $Pool->set_priority (
SOAP::Data->name(pool_names => ["testpool-443"]),
SOAP::Data->name(priorities => [@memberPriorityLists])
);
4 Replies
Sort By
- My code formatting seems to have gotten mangled, going to try again for readability.
- Perl can be somewhat odd when it comes to casting arrays, especially when dealing with the SOAP::Lite module and their internal types. Try casting the second array and see if that makes a difference.
my $member = { address => "10.100.125.18", port => "443" }; my $member_priority = { member => $member, priority => "2" }; push @memberPriorityList, $member_priority; push @memberPriorityLists, [@memberPriorityList]; $soapResponse = $Pool->set_priority( SOAP::Data->name(pool_names => ["testpool443"]), SOAP::Data->name(priorities => [@MemberPriorityLists]) );
use SOAP::Lite + trace => qw(method debug);
- Sure enough, I made those changes and that seemed to fix it. Thanks for pointing those out!
- Great, glad it worked!
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