Forum Discussion
sean_87481
Nimbostratus
Jan 12, 2009Getting VS list with name, address, port
Hello!
In perl, I am able to successfully use the get_list() method to get a list of virtual servers, but I want to pull out the address and port information as well.
It seems that the VirtualServer->get_list() method only returns a list of names, and there doesn't seem to be an input parameter to pass in.
Any suggestions? I've been fiddling with it a while now, and am not making any headway. (NOTE: icontrol newbie).
Thanks,
Sean Swift
- Virtual Servers are identified by their user friendly screen names. The get_list() method returns that list of names. If you want to get the destination for the virtual (ip and port), then you'll want to pass a list of virtual names that you want to query into the LocalLB.VirtualServer.get_destination() method.
http://devcentral.f5.com/wiki/default.aspx/iControl/LocalLB__VirtualServer__get_destination.html
http://devcentral.f5.com/Default.aspx?tabid=53&forumid=1&postid=31065&view=topic
- sean_87481
Nimbostratus
Okay, so here's my code snippet: - You'll likely want to cast $stuff to an array
$soapResponse = $VirtualServer->get_destination( SOAP::Data->name(virtual_servers => [@g_vs_list]) ); @dest_list = @{$soapResponse->result}; foreach $IPPortDef (@dest_list) { $addr = $IPPortDef->{"address"}; $port = $IPPortDef->{"port"}; print "$addr:$port\n"; }
http://devcentral.f5.com/wiki/default.aspx/iControl/PerlVirtualShow.html
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