The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

VMware::vCloud - The VMware vCloud API

SYNOPSIS

This module has been developed against VMware vCenter director.

  my $vcd = new VMware::vCloud (
    $hostname, $username, $password, $orgname
  );
  
  my $login = $vcd->login;

DESCRIPTION

This module provides a Perl interface to VMware's vCloud REST interface.

RETURNED VALUES

Many of the methods return hash references or arrays of hash references that contain information about a specific "object" or concept on the vCloud Director server. This is a rough analog to the Managed Object Reference structure of the VIPERL SDK without the generic interface for retireval.

EXAMPLE SCRIPTS

Included in the distribution of this module are several example scripts. Hopefully they provide an illustrative example of the vCloud API. All scripts have their own POD and accept command line parameters in a similar way to the VIPERL SDK utilities and vghetto scripts.

    login.pl - An example script that demonstrates logging in to the 
server.

PERL MODULE METHODS

These methods are not API calls. They represent the methods that create this module as a "wrapper" for the vCloud API.

new

This method creates the vCloud object.

Arguments

  • hostname

  • username

  • password

  • organization

config

  $vcd->config( debug => 1 );
debug - 1 to turn on debugging. 0 for none. Defaults to 0.
die_on_fault - 1 to cause the program to die verbosely on a soap fault. 0 for the fault object to be returned on the call and for die() to not be called. Defaults to 1. If you choose not to die_on_fault (for example, if you are writing a CGI) you will want to check all return objects to see if they are fault objects or not.
ssl_timeout - seconds to wait for timeout. Defaults to 3600. (1hr) This is how long a transaction response will be waited for once submitted. For slow storage systems and full clones, you may want to up this higher. If you find yourself setting this to more than 6 hours, your vCloud setup is probably not in the best shape.
hostname, orgname, username and password - All of these values can be changed from the original settings on new(). This is handing for performing multiple transactions across organizations.

PUBLIC API METHODS

api_version

This call queries the server for the current version of the API supported. It is implicitly called when library is instanced.

login

This call takes the username and password provided and creates an authentication token from the server. If successful, it returns the list of organizations the authenticated user may access..

catalog_get($catid or $caturl)

As a parameter, this method thakes the raw numeric id of the catalog or the full URL detailed for the catalog from the login catalog.

It returns the requested catalog.

org_get($orgid or $orgurl)

As a parameter, this method thakes the raw numeric id of the organization or the full URL detailed for the organization from the login catalog.

It returns the requested organization.

vdc_get($vdcid or $vdcurl)

As a parameter, this method thakes the raw numeric id of the virtual data center or the full URL detailed a catalog.

It returns the requested VDC.

vapp_get($vappid or $vappurl)

As a parameter, this method thakes the raw numeric id of the vApp or the full URL.

It returns the requested vApp.

WISH LIST

If someone from VMware is reading this, and has control of the API, I would dearly love a few changes, that might help things:

System - It would really help if in the API guide it mentions early on that the organization to connect as an administrator account, IE: the macro organization to which all other orgs descend from is called "System." That helps a lot.
External vs External - When you have the concept of a "fenced" network for a vApp, one of the most confusing points is the local network that is natted to the outside is referred to as "External" as is the outside IPs that the network is routed to. Walk a new user through some of the Org creation wizards and watch the confusion. Bad choice of names.

VERSION

  Version: v2.02 (2011/09/30)

AUTHOR

  Phillip Pollard, <bennie@cpan.org>

CONTRIBUTIONS

  stu41j - http://communities.vmware.com/people/stu42j

DEPENDENCIES

  LWP
  XML::Simple

LICENSE AND COPYRIGHT

  Released under Perl Artistic License

SEE ALSO

 VMware vCloud Director
  http://www.vmware.com/products/vcloud/

 VMware vCloud API Specification v1.0
  http://communities.vmware.com/docs/DOC-12464

 VMware vCloud API Programming Guide v1.0
  http://communities.vmware.com/docs/DOC-12463
  
 vCloud API and Admin API v1.0 schema definition files
  http://communities.vmware.com/docs/DOC-13564
  
 VMware vCloud API Communities
  http://communities.vmware.com/community/vmtn/developer/forums/vcloudapi

1 POD Error

The following errors were encountered while parsing the POD:

Around line 264:

Deleting unknown formatting code U<>