NAME

VMware::vCloudDirector::API - Module to do stuff!

VERSION

version 0.006

Attributes

hostname

Hostname of the vCloud server. Must have a vCloud instance listening for https on port 443.

username

Username to use to login to vCloud server.

password

Password to use to login to vCloud server.

orgname

Org name to use to login to vCloud server - this defaults to System.

timeout

Command timeout in seconds. Defaults to 120.

default_accept_header

The default MIME types to accept. This is automatically set based on the information received back from the API versions.

ssl_verify

Whether to do standard SSL certificate verification. Defaults to set.

ssl_ca_file

The SSL CA set to trust packaged in a file. This defaults to those set in the Mozilla::CA

debug

Set debug level. The higher the debug level, the more chatter is exposed.

Defaults to 0 (no output) unless the environment variable VCLOUD_API_DEBUG is set to something that is non-zero. Picked up at create time in BUILD().

API SHORTHAND METHODS

api_version

The api_version holds the version number of the highest discovered non- deprecated API, it is initialised by connecting to the /api/versions endpoint, and is called implicitly during the login setup. Once filled the values are cached.

authorization_token

The authorization_token holds the vCloud authentication token that has been handed out. It is set by login, and can be tested for by using the predicate has_authorization_token.

current_session

The current session object for this login. Attempting to access this forces a login and creation of a current session.

login

Returns the current_session which co-incidently forces a login.

logout

If there is a current session, DELETEs it, and clears the current session state data.

GET ($url)

Forces a session establishment, and does a GET operation on the given URL, returning the objects that were built.

GET_hash ($url)

Forces a session establishment, and does a GET operation on the given URL, returning the XML equivalent hash that was built.

PUT ($url, $xml_hash)

Forces a session establishment, and does a PUT operation on the given URL, passing the XML string or encoded hash, returning the objects that were built.

POST ($url, $xml_hash)

Forces a session establishment, and does a POST operation on the given URL, passing the XML string or encoded hash, returning the objects that were built.

DELETE ($url)

Forces a session establishment, and does a DELETE operation on the given URL, returning the objects that were built.

query_uri

Returns the URI for query operations, as taken from the initial session object.

_clear_api_data

Clears out all the API state data, including the current login state. This is not intended to be used from outside the module, and will completely trash the current state requiring a new login. The basic information passed at object construction time is not deleted, so a new session could be created.

AUTHOR

Nigel Metheringham <nigelm@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Nigel Metheringham.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.