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::API::vCloud - The VMware vCloud API

SYNOPSIS

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

DESCRIPTION

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

In general, for most API calls, they are in the structure of the conecptual name followed by an underscore and then the REST action. (IE: org_get() for retrieveing an org, and org_post() for creating one.)

RETURNED VALUES

Responses received from vCloud are in XML. They are translated via XML::Simple with ForceArray set for consistency in nesting. This is the object returned.

Aside from the translation of XML into a perl data structure, no further alteration is performed on the data.

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.04 (2011/10/03)

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 258:

Deleting unknown formatting code U<>