The vSphere API Reference Guide gives reference documentation for all vSphere API objects. Some users might also find the
vSphere Web Services SDK Programmer’s Guide helpful for understanding how the vSphere API objects interact. The guides are available from the VMware APIs and SDKs Documentation page.
After you enter the user name and password, the host might display warning messages regarding the SSL certificate authority, such as Website Certified by an Unknown Authority. If VMware is the certificate authority, you can disregard such warnings and continue to log in to the MOB.
A managed object is the primary type of object in the vSphere object model. A managed object is a data type available on the server that consists of properties and operations. Each managed object has properties and provides various services (operations or methods).
ExtensibleManagedObject Hierarchy shows the
ExtensibleManagedObject hierarchy as an example. See
Managed Entities in the Inventory.
Managed objects define the entities in the inventory and also common administrative and management services such as managing performance (PerformanceManager), finding entities that exist in the inventory (
SearchIndex), disseminating and controlling licenses (
LicenseManager), and configuring alarms to respond to certain events (
AlarmManager). See the
vSphere API Reference.
A managed object reference (represented by a ManagedObjectReference) identifies a specific managed object on the server, encapsulates the state and methods of that server-side object, and makes the state and methods available to client applications. Clients run methods (operations) on the server by passing the appropriate managed object reference to the server as part of the method invocation.
The ServiceContent server-side object provides access to all other server-side objects. Each property of the
ServiceContent object is a reference to a specific managed object. You must know those property names to access the other objects. You can use the MOB (see
Use the Managed Object Browser to Explore Server-Side Objects) or use the API Reference documentation.
The vSphere API Reference Guide contains definitions of all server-side objects and their properties and methods. You can therefore use the
vSphere API Reference Guide to identify the list of parameters and operations that you can use with specific vSphere SDK for Perl views that you create and manipulate in your code.
ServiceContent provides access services, such as
PerformanceManager, and to inventory objects, which allow you to access the entities in the virtual datacenter such as hosts (
HostSystem) and virtual machines (
VirtualMachine).
ServiceContent properties also allow access to other managed objects, for example:
The inventory consists of the managed entities on the server. A managed entity is a managed object that extends the ManagedEntity managed object type.
ManagedEntity is an abstract class that defines the base properties and operations for vSphere managed objects such as datacenters and hosts. See
ExtensibleManagedObject Hierarchy for an overview. The following managed object types extend the
ManagedEntity superclass:
Managed entities offer specific operations that vary depending on the entity type. For example, a VirtualMachine managed entity provides operations for creating, monitoring, and controlling virtual machines. You can power a virtual machine on or off (
PowerOnVM,
PowerOffVM) and you can capture state (
Snapshot). A
HostSystem entity provides operations for entering and exiting maintenance mode (
EnterMaintenanceMode_Task,
ExitMaintenanceMode_Task) and for rebooting the server (
RebootHost_Task).
The ManagedEntity base class includes several properties that are inherited by each subclass, such as a
name property, whose data type is a string.
ManagedEntity also includes a few operations that are inherited by each subclass (
Destroy_Task, and
Reload, for example).
VirtualMachine and
HostSystem extend the
ManagedEntity class, so each subclass has a
name property inherited from
ManagedEntity.
Example: Sample Script (Commented Version) obtains all entities of a specific type from the inventory. The entity type is passed as a parameter to the
Vim::find_entity_views() subroutine, which returns an array of references to view objects that map to the corresponding server-side entities.
Example: Following Changes in a Log File starts at the level of the entire service and uses the
Vim::get_service_content() subroutine to obtain an instance of the
ServiceContent object:
You can use the ServiceContent object to retrieve a local view of the services provided by the server, as in this example:
Example: Following Changes in a Log File shows how these two calls form the basis of a script that follows changes in the log file, which can be accessed as the
logfile property of the
diagnosticManager.