vSphere SDK for Perl Programming Guide - Documentation - VMware
vSphere SDK for Perl Programming Guide - Documentation - VMware
vSphere SDK for Perl Programming Guide - Documentation - VMware
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>vSphere</strong> Credential Store Subroutine Reference<br />
init<br />
The ViCredStore package includes the following subroutines:<br />
“init” on page 63<br />
“get_password” on page 63<br />
“add_password” on page 64<br />
“remove_password” on page 64<br />
“clear_passwords” on page 64<br />
“get_hosts” on page 64<br />
“get_usernames” on page 65<br />
“close” on page 65<br />
Appendix B Credential Store <strong>Perl</strong> Library<br />
Initializes the credential store. Call this subroutine once, be<strong>for</strong>e any of the other credential store subroutines.<br />
The credential store is not created until your program calls add_password.<br />
This subroutine accepts the location of the credential store file. If you do not provide a credential store filename<br />
VICredStore::init() looks in the default location.<br />
Linux: $HOME/.vmware/credstore/vicredentials.xml<br />
Windows: %APPDATA%\<strong>VMware</strong>\credstore\vicredentials.xml<br />
If no credential store exists at the default location, the initialization process:<br />
Checks that the credstore directory exists, and creates one if it does not.<br />
Creates the vicredentials.xml file and parent directory.<br />
If you provide a non‐default credential store filename to VICredStore::init(), the credential store at that<br />
location is used. If there is no credential store at that location and the directory you specify exists, the<br />
initialization process creates the file. If the directory you specify does not exist, the initialization process fails.<br />
Parameters<br />
Parameter Description<br />
filename Name of credential store file.<br />
Returns<br />
Returns 1 if initialization is successful; otherwise, returns 0.<br />
get_password<br />
Retrieves the password <strong>for</strong> a specified server and user name.<br />
Parameters<br />
Parameter Description<br />
server Server <strong>for</strong> which you want to retrieve the password <strong>for</strong> the specified user. Can be an ESX/ESXi<br />
or vCenter Server system.<br />
username User <strong>for</strong> whom you want to retrieve the password.<br />
Returns<br />
Returns the password, or undef if no password is found.<br />
<strong>VMware</strong>, Inc. 63