6.5

Table Of Contents
vSphere SDK for Perl Programming Guide
44 VMware, Inc.
“connect”onpage 44
“disconnect”onpage 44
“get_inventory_path”onpage 44
“trace”onpage 44
connect
EstablishesasessionwiththevCenterServerorESX/ESXiWebservicebyusingthetokenprovidedina
previouslysavedsessionfile,orbyusingtheusernameandpasswordprovidedusingthecommandline,
environmentvariables,oraconfigurationfile.
Parameters
Returns
Returnsnothing.
disconnect
Ifusedinconjunctionwithconnectandasessionfile,doesnothing.Ifusedinconjunctionwithausername
andpassword,logsoutandclosesthesession.
Parameters
Noparameters.
Returns
Returnsnothing.
get_inventory_path
Returnstheinventorypathforthespecifiedmanagedentity,forexample,Folder,Datacenter,HostSystem,
VirtualMachine,ComputeResource,ClusterComputeResource,orResourcePool.Theresulting
inventorypathcanlaterbepassedtotheSOAPoperationFindByInventorypathtoretrievethe
ManagedObjectReferenceforamanagedentity(fromwhichaviewcanbe
created).
Parameters
Returns
Returnsastringthatidentifiestheinventorypathofthemanagedentity.
trace
Generalpurposeloggingfunctionusedinconjunctionwiththe--verbosecommandlineoption.Defaultlog
levelis0.Passingthe--verboseflagwithoutavaluesetsthelevelto1.
Parameter Description
user_name UseraccountontheESX/ESXiorvCenterServersystem.
password Passwordfortheus eraccount.
session_file Fullpathandfilenameforthetokensavedfromaprevioussuccessfulconnection.Use
session_file(insteadofuser_nameandpassword)toreestablishasessiontothesameserver
ortoestablishanewconnection
toadifferentserver.
Parameter Description
view Managedentityview.
vim_instance Managedobject.