VMware VCENTER APPLICATION DISCOVERY MANAGER 6.1 - REPOSITORY Spécifications Page 306

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 309
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 305
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
Vue de la page 305
1 2 ... 301 302 303 304 305 306 307 308 309

Commentaires sur ces manuels

Pas de commentaire