18.08.2013 Views

vSphere SDK for Perl Programming Guide - Documentation - VMware

vSphere SDK for Perl Programming Guide - Documentation - VMware

vSphere SDK for Perl Programming Guide - Documentation - VMware

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> <strong>Programming</strong> <strong>Guide</strong><br />

Table 4-2. Subroutines in the Vim Package (Continued)<br />

Subroutine Description<br />

logout Disconnects the client from the server and closes the connection to the Web service.<br />

save_session Saves a session cookie, which is a text file.<br />

update_view_data Refreshes the property values of a view object.<br />

Table 4-3. Subroutines in the Util Package<br />

Subroutine Description<br />

connect Establishes a session by using the token provided in a previously‐saved session file, or by using the user<br />

name and password provided on the command line, in environment variables, or in a configuration file.<br />

disconnect If used in conjunction with connect (and a session file), does nothing. If used in conjunction with a user<br />

name and password, logs out and closes the session.<br />

get_inventory_path Returns the inventory path <strong>for</strong> the specified managed entity.<br />

trace General‐purpose logging function used in conjunction with the --verbose command‐line option.<br />

Subroutines in the Opts Package<br />

The Opts package includes the following subroutines:<br />

“add_options” on page 42<br />

“get_option” on page 42<br />

“option_is_set” on page 43<br />

“parse” on page 43<br />

“validate” on page 43<br />

“usage” on page 43<br />

add_options<br />

Adds custom options so that they can be submitted to parsing and validation. After the script has validated<br />

the options, the script can use them at run time.<br />

Parameters<br />

Parameter Description<br />

%opts Name of the hash variable that consists of the option name and its attributes.<br />

Returns<br />

Returns nothing.<br />

get_option<br />

Retrieves the value of the specified built‐in or custom option.<br />

Parameters<br />

Parameter Description<br />

option_name String value of the built‐in or custom option.<br />

42 <strong>VMware</strong>, Inc.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!