i am trying to use a perl script to drain a server on my test environment load balancer, the code is this:
#!/usr/bin/perl -w
use SOAP::Lite 0.60;
my $admin_server = 'https://admin:[email protected]:9090';[email protected]:9090';
my $conn = SOAP::Lite
-> uri('https://admin:[email protected]:9090[email protected]:9090')
-> proxy("$admin_server/soap");
$conn = $conn->addDrainingNodes( ["myNewPool"], [["node.ip:8080"]] );
the script exits with no errors but as I go to the "Draining Nodes" list under "Activity" I cannot see node.ip draining.
where exactly am I failing ?
Solved! Go to Solution.
You seem to be missing a set of square braces in your soap call....
my $res = $conn->addDrainingNodes( [ $poolName ], [[ @theNodes ]] );
This works for me...
#!/usr/bin/perl -w
use SOAP::Lite 0.60;
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
# This is the url and password of the ZXTM admin server
my $admin_server = 'https://username
[email protected]:9090';
# The pool to edit, and the nodes to drain
my $poolName = shift @ARGV;
my @theNodes = @ARGV;
# Create the SOAP Connection object
my $conn = SOAP::Lite
-> ns('http://soap.zeus.com/zxtm/1.0/Pool/')
-> proxy("$admin_server/soap")
-> on_fault( sub {
my( $conn, $res ) = @_;
die ref $res?$res->faultstring:$conn->transport->status; } );
# Start the nodes draining
my $res = $conn->addDrainingNodes( [ $poolName ], [[ @theNodes ]] );
Cheers,
Mark
You seem to be missing a set of square braces in your soap call....
my $res = $conn->addDrainingNodes( [ $poolName ], [[ @theNodes ]] );
This works for me...
#!/usr/bin/perl -w
use SOAP::Lite 0.60;
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
# This is the url and password of the ZXTM admin server
my $admin_server = 'https://username
[email protected]:9090';
# The pool to edit, and the nodes to drain
my $poolName = shift @ARGV;
my @theNodes = @ARGV;
# Create the SOAP Connection object
my $conn = SOAP::Lite
-> ns('http://soap.zeus.com/zxtm/1.0/Pool/')
-> proxy("$admin_server/soap")
-> on_fault( sub {
my( $conn, $res ) = @_;
die ref $res?$res->faultstring:$conn->transport->status; } );
# Start the nodes draining
my $res = $conn->addDrainingNodes( [ $poolName ], [[ @theNodes ]] );
Cheers,
Mark
IT WOOOOOOORKS
thank you
you save my life !!!!!!!!!!!!!!!!!!!!
how can I give you points ?
Hi Renato-
Thanks for marking Mark's response as correct! He received 10 points for his correct response to your question.
Thanks for using Splash!
Dave