Specifications

Appendix C: Using Perl SDK
Using the Perl Client
The Perl Client module (Hyper9::Client) contains some inline POD (plain old
documentation). To view the POD, navigate to the place where you extracted the
Perl SDK archive and type the following command:
Perldoc Hyper9/Client.pm
Writing your first script
This example walks you through writing a script that executes a search for VMs
that are configured for less than 1 GB RAM, pulls out the configuration model for
each of those VMs, and prints the memory size and name of the VM.
1. Create a new file called searchMemory.pl and open the file for editing.
2. Set up the proper imports:
use strict;
use Hyper9::Client;
use XML::Simple;
use Data::Dumper;
my $pageSize = 20;
my $total = 0;
3. Set up your script with a Hyper9::Client reference and use it to log in. You
must substitute the host address and credentials in the setup of the client. In
the following example, it is configured to log in to a SolarWinds
Virtualization Manager server found at localhost using the admin/admin
credentials.
my $client = Hyper9::Client->new(
username => 'admin',
password => 'admin',
host => 'VirtualizationManagerHostnameOr',
);
$client->login() || die "Login failed\n\n";
4. Use the $client variable to run any of the web service operations. For a
complete list of operations along with their inputs and outputs, visit
http://your-server:8983/swvm/ws/hyper9.wsdl. To execute the search
operation, insert the following code into your script:
306