6.0

Table Of Contents
VMware, Inc. 43
Chapter 5 Running DCLI Commands
dcli +credstore-remove +server <server> +username user1
3Listallcredentialstoreentries.
dcli +credstore-list
Order of Precedence for DCLI Authentication
WhenyourunaDCLIcommand,authenticationhappensintheorderofprecedenceshowninTable 52,
“DCLIAuthenticationPrecedence,”onpage 43.Thisorderofprecedencealwaysapplies.Thatmeans,for
example,thatyoucanoverrideanenvironmentvariablesettingfromthecommandline.
IfyouareauthenticatingthroughvCenterSingle
SignOn,theorderofprecedenceispreserved.
Input, Output, and Return Codes
DCLIsupportsthefollowinginputarguments.
Basictypes.Youcanenterbasictypeslikestring,int,double,orbooleanonthecommandline.
Listtypes.ProvidethesameoptionmultipletimesonthecommandlineandDCLItreatsitasalist.
Structure.Forstructureinputfieldsusethedotnotation.Forexample,id.pathisthepathfieldintheid
structure.
Currentlysupportedoutputformattertypesaresimple,xml,html,table,csvandjson.Youcanchangethe
outputformatbypassingtheformatteroptiontoDCLI.
ForscriptingpurposesDCLI
returnsanonzeroerrorcodeforanunsuccessfulcommand.Toseethelast
commandstatusininteractivemode,runthe$?command.
Using DCLI with Variables
YoucanpredefineasetofvariablesintheenvironmentwhereyourunDCLIcommandssoyoudon’thaveto
passtheoptionseachtimeyourunacommand.Thefollowingenvironmentvariablesaresupported.
Table 5-2. DCLI Authentication Precedence
Authentication Description
Commandline Usernameandpassword,specifiedonthecommandlinetakesprecedence,evenifacredential
storeexists.
Environment
variable
Ausernamespecifiedinanenvironmentvariabletakesprecedenceoverusernamesinthe
credentialstore,butnotoverthecommandline.
Credentialstore Usernameandpasswordretrievedfromthe
credentialstore.Acustomcredentialstorefileata
nondefaultlocationhasprecedenceoverafileatthedefaultlocation.
Table 5-3. Variables Supported by DCLI
Variable Description
DCLI_SERVER SetthisvariabletopasstheserverIPaddress.
Passingtheserveroptiononthecommandlineoverridesthisvariable.
DCLI_SSLCERTFILE SetthisvariabletopassthepathofyourSSLcertificatefile.
Passingthessl-cert-fileoptiononthecommandlineoverridesthisvariable.
DCLI_SSLKEYFILE Setthisvariabletopassthe
pathofyourSSLkeyfile.
Passingthessl-key-file optiononthecommandlineoverridesthisvariable.
DCLI_CACERTFILE SetthisvariabletopassthepathofaCAcertificatefile.
Passingthecacert-fileoptiononthecommandlineoverridesthisvariable.
DCLI_USERNAME Setthisvariabletopasstheusernamerequiredfor
authentication
Passingtheusernameoptiononcommandlineoverridesthisvariable.