6.5

Table Of Contents
vSphere SDK for Perl Programming Guide
12 VMware, Inc.
Output(receivingfromtheserver):
TomatchBooleanvaluesinafilter,usethestringstrueandfalse.See“CreatingandUsingFilters”on
page 33.
Date/TimeTheserverreturnsaSOAPdateTimevalue.YoucanusetheDate::ParsePerlmoduleto
processtheseobjects.
ThevSphereSDKforPerlacceptsonlynativeSOAPdateTimevaluesusingstandarddatetimeformat
withorwithoutfractionalseconds,andwithorwithoutGMT(Z)timezone:
YYYY-MM-DDThh:mm:ssTZD,
forexample,1997-07-16T19:20:30+01:00
YYYY-MM-DDThh:mm:ss.sTZD,forexample,1997-07-16T19:20:30.45+01:00
TheSDKalwaysreturnsdateTimevaluesinthestandarddatetimeformat.
SOAPerrormessageMostlikelyindicatesanerrorontheserver,notanerrorwiththecommunication
totheserver.
vSphere SDK for Perl Common Options
AnumberofoptionsareavailableforanyvSphereSDKforPerlscript.Mostoftheseoptionsallowyouto
specifythehostorhoststoconnectto.Mostoptionsrequireanoptionvalue.
perl <app_name>.pl --<option_name> <option_value>
Forexample,topoweronavirtualmachineusingthevmcontrol.plutilityapplication,youmustspecifythe
nameofthevirtualmachinetopoweron,asfollows:
perl vmcontrol.pl --server <myserver> --username <admin> --password <mypassword> --operation
poweron --vmname <virtual_machine_name>
Runanyapplicationorsamplewithoutanyoptionsorwith--helptoseeitsparametersandexecution
examples.Informationaboutcommonandscriptspecificoptionsisincluded.
Specifying Options
Youcanspecifythecommonoptionsinseveralways,discussedinthissection.
WhenyourunavSphereCLIcommand,authenticationhappensinthefollowingorderofprecedence:
false: Use0,ʹ0ʹ,orʹfalseʹ(capitalizationignored)
true: Use1,ʹ1ʹ,orʹtrueʹ(capitalizationignored)
false: Returnvalueis0
true: Returnvalueis1
I
MPORTANTIfthehostyouaretargetingisinlockdownmode,youcannotexecutePerlscriptsagainstthe
host.
Table 1-2. vSphere CLI Authentication Precedence
Authentication Description See
TargetingvCenter
ServerandUsing
vCenterSingle
SignOn
Ifyouareworkinginanenvironmentthatis
managedbyvCenterSingleSignOn,youcan
specifythevCenterSingleSignOnserverand
ausername,password,andtargethost.
“UsingaSessionFile”onpage 13
Commandline Password(--password),
sessionfile
(--sessionfile),orconfigurationfile
(--config) specifiedonthecommandline.
“UsingaSessionFile”onpage 13
Configurationfile Passwordsspecifiedina.visdkrc
configurationfile.
“UsingaConfigurationFile”onpage 15