Forum Discussion
c_harish_12981
Nimbostratus
Jun 17, 2009Create Pool script in PERL
I am looking for "Create Pool" or "CreatePoolWithMembers" script in PERL. Has anybody worked on it?
Thx
5 Replies
- I'm sure I can come up with something. Do you just want the pool creation or do you want to also specify adding members during the creation or possibly adding/removing members post-creation. Let me know and I'll whip something up for you.
-Joe - JRahm
Admin
There is a perl add pool member script in the codeshare:
http://devcentral.f5.com/Wiki/default.aspx/iControl/PerlAddPoolMember.html Click here
I stripped out variables and added this into the main loop to demonstrate adding the pool and the members:added by jrahm $member = { address => "10.10.10.10", port => "80" }; push @memberA, $member; push @memberAofA, [@memberA]; $soapResponse = $Pool->create( SOAP::Data->name(pool_names => [new_pool]), SOAP::Data->name(lb_methods => [LB_METHOD_ROUND_ROBIN]), SOAP::Data->name(members => [@memberAofA]) ); &checkResponse($soapResponse);
This returns:
C:\dev\perl_scripts>perl ltmpool.pl 10.10.20.5 admin admin
POOL : new_pool
MEMBER : 10.10.10.10:80 - JRahm
Admin
oops, sorry Joe, started working on this and didn't refresh before posting. - Here's a script that will either list all the pools and their respective pool members or it will create a new pool with a a list of supplied members.
http://devcentral.f5.com/Wiki/default.aspx/iControl/PerlCreatePool.html
Click here
Hope this helps...
-Joe - c_harish_12981
Nimbostratus
Thanks Joe,
Help appreciated. One quick feedback. Please modify the "Usage" statement as Port is not required to run this program.
Is it possible to keep UserID & Password encrypted (or just password) in a separate file and it can be passed as an argument during run time.
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
