vADC Forum

Reply
Occasional Contributor
Posts: 9
Registered: ‎07-20-2013
Accepted Solution

perl soap script to get pool from nodename

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://loginSmiley Tongueassword@load.balancer.ip:9090';password@load.balancer.ip: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

Occasional Contributor
Posts: 9
Registered: ‎07-20-2013

Re: perl soap script to get pool from nodename

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://loginSmiley Tongueasswordatloadbalancerip: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";

Occasional Contributor
Posts: 9
Registered: ‎07-20-2013

Re: perl soap script to get pool from nodename

what i want to achieve is giving one nodename have all pools it is into as output

Contributor
Posts: 74
Registered: ‎10-03-2011

Re: perl soap script to get pool from nodename

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

Occasional Contributor
Posts: 9
Registered: ‎07-20-2013

Re: perl soap script to get pool from nodename

thank you mark

Join the Community

Get quick and easy access to valuable resource designed to help you manage your Brocade Network.