Subroutines in the Util Package
The Util package includes the following subroutines:
connect
Establishes a session with the vCenter Server or ESX/ESXi Web service by using the token provided in a previously saved session file, or by using the user name and password provided using the command line, environment variables, or a configuration file.
Parameters
Full path and filename for the token saved from a previous successful connection. Use session_file (instead of user_name and password) to reestablish a session to the same server or to establish a new connection to a different server.
Returns
Returns nothing.
disconnect
If used in conjunction with connect and a session file, does nothing. If used in conjunction with a user name and password, logs out and closes the session.
Parameters
No parameters.
Returns
Returns nothing.
get_inventory_path
Returns the inventory path for the specified managed entity, for example, Folder, Datacenter, HostSystem, VirtualMachine, ComputeResource, ClusterComputeResource, or ResourcePool. The resulting inventory path can later be passed to the SOAP operation FindByInventory path to retrieve the ManagedObjectReference for a managed entity (from which a view can be created).
Parameters
Returns
Returns a string that identifies the inventory path of the managed entity.
trace
General-purpose logging function used in conjunction with the --verbose command-line option. Default log level is 0. Passing the --verbose flag without a value sets the level to 1.
Parameters
Returns
Returns nothing.