SDK Managed Object Browser
search cancel

SDK Managed Object Browser

book

Article ID: 339826

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

How do you invoke an operation in the Managed Object Browser?

Environment

VMware ESX Server 3.0.x
VMware VirtualCenter 2.0.x

Resolution

Note: Remember that you are connected to a server when you use the Managed Object Browser. Therefore, when you invoke operations, you are potentially making changes to the objects on the server. For example, if you invoke DeleteVm() on a virtual machine, you are deleting that virtual machine.

  1. After you access the Managed Object Browser, find the managed object that contains the operation you want to invoke.
    Refer to the VMware Infrastructure SDK Programming Guide for information about accessing and navigating the Managed Object Browser.

    After the list of properties, you see a list of the operations for this managed object, as shown in the following figure.



  2. Click the link for the operation you want to invoke.
    A window appears, in which you can enter the parameters.



  3. Enter the parameter's value in the Value field.
    See the section below about entering parameter values.

  4. Click Invoke Method.
Entering Parameter Values
For primitive arguments (int, string, boolean, and so on), for which the input field is a single text field (for example, partialUpdates in the figure above), enter the value as you see the value in text form. For example, in the partialUpdates field above, enter true or false.
For complex types (structured data), enter the value according to the schema definition from WSDL. In the VMware Infrastructure SDK Reference Guide, each page describing an object contains a Show WSDL type definition link. Clicking this link displays the definition and enables you to construct the parameter value.
For example, the CloneVM_Task operation requires a Folder managed object reference. If you click the Show WSDL type definition link for ManagedObjectReference in the reference guide, the following information appears:
http://www.w3.org/2001/XMLSchema" name="ManagedObjectReference">





This information tells you that you should enter the parameter value in the field as follows:
folder-123
In this example, folder is the name of the parameter, type is the type of managed object, and folder-123 is the managed object ID. You can find the managed object ID in the Managed Object Browser at the top of the page that describes the managed object.
Some complex types have nested complex types. For example, CreateFilter() has a spec parameter which is a PropertyFilterSpec. Once you find PropertyFilterSpec in the reference guide and click the Show WSDL type definition link, you see the following:
http://www.w3.org/2001/XMLSchema" name="PropertyFilterSpec">








This information tells you that the PropertyFilterSpec has two properties, propSet and objectSet, each of which is a complex type. Find the PropertySpec in the reference guide and you see the following WSDL definition:
http://www.w3.org/2001/XMLSchema" name="PropertySpec">





maxOccurs="unbounded"/>



With these as your guide (and by checking the WSDL definition of the ObjectSpec), the value in the parameter field might look something like:

VirtualMachine
false
config.guestFullName
group-v3
In this example, spec represents the parameter name, propSet and objectSet represent the two properties of the PropertyFilterSpec, and the tags within each of those represent their properties. Notice the order of the properties. The properties must follow the order of the properties in the WSDL definition. Also notice . This is a managed object, so the tag includes a type attribute and the value is a managed object ID.
An array is represented by multiple, sequential tags. For example:

VirtualMachine
false
config.guestFullName
config.guestId
group-v3
Notice the multiple tags. Multiple tags can be represented as follows:

VirtualMachine
false
config.guestFullName
config.guestId
HostSystem
false
runtime.connectionState
group-v3