I am trying to write a script to get the pool name from the name of a node.
I can use only soap to do that.
#!/usr/bin/perl -w
use SOAP::Lite 0.60;
# This is the url of the Stingray admin server
my $admin_server = 'https://login[email protected]:9090';[email protected]:9090';
my $vsName = "node.ip" ;
my $conn = SOAP::Lite
-> ns('http://soap.zeus.com/zxtm/1.0/VirtualServer/')
-> proxy("$admin_server/soap");
$res = $conn->getBasicInfo( [ $vsName ] );
my $r = @{$res->result}[0];
print "Virtual Server $vsName:\n";
print " port $r->{port}, protocol $r->{protocol}, pool $r->{default_pool}\n";
this code gives me this output:
Unrecognized type '{http://soap.zeus.com/zxtm/1.0/}VirtualServer.Protocol'
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:zeusns_1_1="http://soap.zeus.com/zxtm/1.1/" xmlns:zeusns_1_2="http://soap.zeus.com/zxtm/1.2/" xmlns:namesp9="http://soap.zeus.com/zxtm/1.0/VirtualServer/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:zeusns="http://soap.zeus.com/zxtm/1.0/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><namesp9:getBasicInfoResponse><info soapenc:arrayType="zeusns:VirtualServer.BasicInfo[1]" xsi:type="soapenc:Array"><Item xsi:type="zeusns:VirtualServer.BasicInfo"><port xsi:type="xsd:int">8080</port><protocol xsi:type="zeusns:VirtualServer.Protocol">http</protocol><default_pool xsi:type="xsd:string">myNewPool</default_pool></Item></info></namesp9:getBasicInfoResponse></soap:Body></soap:Envelope> at ./listVS.pl line 10
I am a bit lost.... can someone please help me ?
thank you in advance
Renato Gallo
Solved! Go to Solution.
what i want to achieve is giving one nodename have all pools it is into as output
ERRATA CORRIGE
the code is actually this:
#!/usr/bin/perl -w
use SOAP::Lite 0.60;
# This is the url of the Stingray admin server
my $admin_server = 'https://loginasswordatloadbalancerip:9090';
my $vsName = "node.ip" ;
my $conn = SOAP::Lite
-> ns('http://soap.zeus.com/zxtm/1.0/VirtualServer/')
-> proxy("$admin_server/soap");
$res = $conn->getBasicInfo( [ $vsName ] );
my $r = @{$res->result}[0];
print "Virtual Server $vsName:\n";
print " port $r->{port}, protocol $r->{protocol}, pool $r->{default_pool}\n";
Hi Renato,
The BasicInfo structure contains an enumeration of protocol type... therefore you will need to use a customer deserialiser as described in this document:
Tech Tip: using Perl SOAP::Lite with Stingray's SOAP Control API
Cheers,
Mark
thank you mark