The Vim package includes the following subroutines:
■
■
■ Terminates the current session loaded by the load_session() subroutine.Searches the inventory tree for a managed entity that matches the specified entity type. The search begins with the root folder unless the begin_entity parameter is specified.In most cases, you specify a filter or property when using this command to avoid performance problems. See Creating and Using Filters and Filtering Views Selectively Using Properties.
■ begin_entity (optional) Managed object reference that specifies the starting point for the search in the inventory. This parameter helps you narrow the scope. Hash of one or more name-value pairs. The name represents the property value to test and the value represents a pattern that the property must match. If more than one pair is specified, all the patterns must match.Reference to a view object containing the same properties as the managed entity. If more than one managed entity matches the specified entity type, the subroutine returns only the first managed entity found. If no matching managed entities are found, the subroutine returns undef.To avoid performance problems, use this command with a filter or specify the properties argument. By default, this subroutine retrieves all properties of an entity. See Creating and Using Filters and Filtering Views Selectively Using Properties.See the vSphere SDK for Perl API Reference for a list of properties. You can specify properties inherited from ManagedEntity or local to a specific entity type.
■ begin_entity (optional) Managed object reference that specifies the starting point for search in the inventory. This parameter helps you narrow the scope. filter (optional) Hash of one or more name-value pairs. The name represents the property value to test and the value represents a pattern that the property must match. If more than one pair is specified, all the patterns must match. Reference to an array of view objects containing static copies of property values for the matching inventory objects. If no matching entities are found, the array is empty.The following example, originally published in VMware Communities in post #1272780, retrieves the name property from each inventory object. Note that $entity_views extracted from the server-side managed object is an array reference, not a scalar.Retrieves a ServiceInstance object, which can be used to query the server time or to retrieve the ServiceContent object.Returns a ServiceInstance object.Retrieves properties of the service instance enabling access to the managed objects of the service. Alternatively, you can use get_views(), get_view(), and other subroutines to access the objects more directly. If you start with the service content to work with the Web service, you can navigate to the object of interest.Reference to ServiceContent object, which contains managed object references to all inventory content, including the root folder.Session ID cookie for use by load_session().
view_type (optional) Type of view to construct from the managed object. If the parameter is absent, the subroutine constructs a view with a type that matches the managed object type name.
view_type (optional) Type of view to construct from the managed object. If the parameter is absent, the subroutine constructs a view with a type that matches the name of the managed object type.The Vim::get_views() subroutine takes a reference to an array of managed object references and returns a reference to an array of view objects. Although the array can contain multiple managed object types, objects of only one type can be obtained at the same time.Uses a saved session file or session cookie for connecting to a server. Use Util::connect() instead of Vim::login() after loading the session.
Full path and filename for a session file returned by save_session(). You must specify either session_file or session_id. You must pass in the filename as a hash. To load a session using a session file: load_session(session_file => $filename);Establishes a session with the Web service running on the vCenter Server or ESX/ESXi system using the user name and password credentials provided using the command-line, environment variables, or configuration file.
Disconnects the client from the server and closes the connection to the Web service. Use this subroutine if you connected using Vim::login(). Otherwise, use Util::disconnect().
Full path and filename where the token should be saved. The session times out after 30 minutes. You pass in the filename as a hash.