6.0

Table Of Contents
VMware, Inc. 49
Chapter 4 vSphere SDK for Perl Subroutine Reference
Parameters
Returns
ReturnsthevSphereobjectinstance.
Example
Toloadasessionusingasessionfile:load_session(session_file => $filename);
ToloadasessionusingasessionID:load_session(service_url => $url, session_id =>
$sessionid);
login
EstablishesasessionwiththeWebservicerunningonthevCenterServerorESX/ESXisystemusingtheuser
nameandpasswordcredentialsprovidedusingthecommandline,environmentvariables,orconfiguration
file.
Parameters
Returns
ReturnsthevSphereobjectinstance.
logout
DisconnectstheclientfromtheserverandclosestheconnectiontotheWebservice.Usethissubroutineifyou
connectedusingVim::login().Otherwise,useUtil::disconnect().
Parameters
Noparameters.
Returns
Returnsnothing.
save_session
Savesasessioncookie,whichisatextfile.See“UsingaSessionFile”onpage 13.
Parameter Description
service_url URLoftheservertowhichtheclientconnects(optionalifusingsession_file).
session_file Fullpathandfilenameforasessionfilereturnedbysave_session().Youmustspecifyeither
session_fileorsession_id.Youmustpassinthefilenameasahash.
session_id SessionIDreturnedbyget_session_id().Youmustspecify
eithersession_fileor
session_id.
NOTEInmostcases,youuseUtil::connect()insteadtoestablishaconnection.
Parameter Description
service_url URLoftheservertowhichtheclientconnects.
user_name UseraccountontheESX/ESXiorvCenterServersystem.
password Passwordfortheus eraccount.