vSphere SDK for Perl Programming Guide - Documentation - VMware
vSphere SDK for Perl Programming Guide - Documentation - VMware
vSphere SDK for Perl Programming Guide - Documentation - VMware
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> <strong>Programming</strong> <strong>Guide</strong><br />
Subroutines in the Util Package<br />
The Util package includes the following subroutines:<br />
“connect” on page 44<br />
“disconnect” on page 44<br />
“get_inventory_path” on page 44<br />
“trace” on page 45<br />
connect<br />
Establishes a session with the vCenter Server or ESX/ESXi Web service by using the token provided in a<br />
previously saved session file, or by using the user name and password provided using the command line,<br />
environment variables, or a configuration file.<br />
Parameters<br />
Parameter Description<br />
user_name User account on the ESX/ESXi or vCenter Server system.<br />
password Password <strong>for</strong> the user account.<br />
session_file Full path and filename <strong>for</strong> the token saved from a previous successful connection. Use<br />
session_file (instead of user_name and password) to reestablish a session to the same server<br />
or to establish a new connection to a different server.<br />
Returns<br />
Returns nothing.<br />
disconnect<br />
If used in conjunction with connect and a session file, does nothing. If used in conjunction with a user name<br />
and password, logs out and closes the session.<br />
Parameters<br />
No parameters.<br />
Returns<br />
Returns nothing.<br />
get_inventory_path<br />
Returns the inventory path <strong>for</strong> the specified managed entity, <strong>for</strong> example, Folder, Datacenter, HostSystem,<br />
VirtualMachine, ComputeResource, ClusterComputeResource, or ResourcePool. The resulting<br />
inventory path can later be passed to the SOAP operation FindByInventory path to retrieve the<br />
ManagedObjectReference <strong>for</strong> a managed entity (from which a view can be created).<br />
Parameters<br />
Parameter Description<br />
view Managed entity view.<br />
vim_instance Managed object.<br />
Returns<br />
Returns a string that identifies the inventory path of the managed entity.<br />
44 <strong>VMware</strong>, Inc.