NAME

VMware::vCloud - VMware vCloud Director

SYNOPSIS

my $vcd = new VMware::vCloud ( $hostname, $username, $password, $orgname, { debug => 1 } );  
my %vapps = $vcd->list_vapps();

my $vappid = $vapps{'My Personal vApp'};

my $vapp = $vcd->get_vapp($vappid);
my $ret = $vapp->power_on();

DESCRIPTION

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

EXAMPLE SCRIPTS

Included in the distribution of this module are several example scripts. Hopefully they provide an illustrative example of the use of vCloud Director. 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.
org_get.pl - Selects a random organization and prints a Data::Dumper dump of it's information.
list-vapps.pl - Prints a list of all VMs the user has access to.

METHODS

new($host,$user,$pass,$org,$conf)

This method instances the VMware::vCloud object and verifies the user can log onto the server.

$host, $user, and $pass are required. They should contain the login information for the vCloud server.

$org and $conf are optional.

$org is the vCloud Organization to connect to. If $org is not given, the default of 'System' is used.

$conf is an optional hasref containing tuneable parameters:

* debug - set to a true value to turn on STDERR debugging statements.

create_external_network($name,$gateway,$netmask,$dns1,$dns2,$suffix,$vimref,$moref,$objtype)

create_vapp_from_template($name,$vdcid,$tmplid,$netid)

Given a name, VDC, template and network, instantiate the template with the given settings and other defaults.

Details of the create task will be returned.

get_org($orgid)

Given an organization id, it returns a hash of data for that organization.

get_template($templateid)

Given an organization id, it returns a hash of data for that organization.

$raw_org_data->{href} =~ /([^\/]+)$/;
$org{id} = $1;

$org{contains} = {};

for my $link ( @{$raw_org_data->{Link}} ) {
  $link->{type} =~ /^application\/vnd.vmware.vcloud.(\w+)\+xml$/;
  my $type = $1;
  $link->{href} =~ /([^\/]+)$/;
  my $id = $1;
  
  next if $type eq 'controlAccess';
  
  $org{contains}{$type}{$id} = $link->{name};
}

get_vapp($vappid)

Given an vApp id, it returns a vApp object for that vApp.

See the documentation on VMware::vCloud::vApp for full details on this object type.

get_vdc($vdcid)

Given an vDC id, it returns a hash of data for that vDC.

list_networks() | list_networks($vdcid)

This method returns a hash or hashref of network names and IDs.

Given an optional VDCid it will return only the networks available in that VDC.

list_orgs()

This method returns a hash or hashref of Organization names and IDs.

list_templates()

This method returns a hash or hashref of Template names and IDs the user has access too.

list_vapps()

This method returns a hash or hashref of Template names and IDs the user has access too.

list_vdcs() | list_vdcs($orgid)

This method returns a hash or hashref of VDC names and IDs the user has access too.

The optional argument of an $orgname will limit the returned list of VDCs in that Organization.

login()

This method is deprecated and will be removed in later releases.

This method roughly emulates the default login action of the API: It returns information on which organizations are accessible to the user.

It is a synonym for list_orgs() and all details on return values should be take from that method's documentation.

VERSION

Version: v2.19 (2013/03/13)

AUTHOR

Phillip Pollard, <bennie@cpan.org>

CONTRIBUTIONS

  Stuart Johnston, <sjohnston@cpan.org>

	Significant helpful contrbutions have been made by Mr. Johnston, including
	the proper handling of the authentication header, the layout of modules,
	and proper support for XML encoding.

DEPENDENCIES

Cache::Bounded
VMware::API::vCloud

LICENSE AND COPYRIGHT

Released under Perl Artistic License

1 POD Error

The following errors were encountered while parsing the POD:

Around line 300:

Unknown directive: =head