Forum Discussion
Michel_van_der_
Nimbostratus
Jan 10, 2006LocalLB.VirtualServer.add_rule question
I tried to apply a rule to a virtual server, but it does not seem to work.
What format should the parameter 'virtual_servers' take. Is that '1.2.3.4:80' or the name of the virtual server? ...
Cindy_127211
Nimbostratus
Oct 12, 2006Sorry, I don't really understand what needed to be fixed in the code. My code looks like the following, and it is just not adding the 'rule' to the virtual server, as expected. Can you clarify for me what needs to be fixed?
! perl
use strict;
use SOAP::Lite +trace => qw(all);
sub usage { print STDERR "testCaseForF5 \n"; }
----------------------------------------------------------------------------
SOAP Transport Information
----------------------------------------------------------------------------
sub SOAP::Transport::HTTP::Client::get_basic_credentials { return "user" => "pwd"; }
sub main {
my ($ip, $n, $soap, $soapResponse, $r);
return usage() if @ARGV != 2;
$ip = $ARGV[0]; $n = $ARGV[1];
$soap = SOAP::Lite->uri("urn:iControl:LocalLB/VirtualServer")
->proxy("https://$ip/iControl/iControlPortal.cgi") ||
die "Can't create SOAP object for $ip\n";
$soapResponse = $soap->add_rule(
SOAP::Data->name('virtual_servers' => $n),
SOAP::Data->name('rules' => [ [
{ 'rule_name' => "IPRO_NONSSL",
'priority' => 1 } ] ]),
);
if ( $soapResponse->fault ) {
print "SOAP Error: ",
$soapResponse->faultcode, "; ",
$soapResponse->faultstring , "\n";
return 0;
}
}
main;
1;
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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