Simple Content
The data object type
ManagedObjectReference
is one of
the most commonly required parameters to be passed to the server. For example,
the MOB for the
PerformanceManager.QueryPerfProviderSummary
method shows that the method requires a single parameter, the managed object
reference (an instance of
ManagedObjectReference
) of the
entity for which you want to obtain the
PerfProviderSummary
object.
Using the
vSphere API Reference
for
ManagedObjectReference
type, you
can obtain the schema information from the
Show WSDL type definition
link at the bottom of the documentation page for
ManagedObjectReference
.
XML Schema Definition of
ManagedObjectReference Data Object
<complexType xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="ManagedObjectReference"> <simpleContent> <extension base="xsd:string"> <attribute name="type" type="xsd:string"/> </extension> </simpleContent> </complexType>
XML Schema Definition of ManagedObjectReference Data Object
shows that a managed object reference is defined as a
<SimpleContent>
element that consists of a string that specifies the
attribute
type
with its associated
value, also as string. Use this information to construct the appropriate
structure by replacing
type
with the parameter name
from the MOB, setting the value as needed, and submitting in the entry field of
the MOB. (The value for the
Datacenter
is displayed in the
MOB.)
<entity
type=”Datacenter”>datacenter-21</entity>
Figure 1
shows the result of using the definition listed in
XML Schema Definition of ManagedObjectReference Data Object
to specify the managed object reference for a target datacenter to the
PerformanceManager.QueryPerfProviderSummary
method.
Using the MOB to Pass Complex Types to a Method

As another example, one of the parameters
required by the
VirtualMachine.CloneVM_Task
method is a
folder
. In this case, the
parameter is defined as a managed object reference to a specific
Folder
object. Using the same
definition shown in
XML Schema Definition of ManagedObjectReference Data Object,
the result is as follows:
<folder
type=”Folder”>folder-87</folder>
Although both examples submit a
ManagedObjectReference
to the
MOB, each is specific to the parameter name required by the method (entity
type for
PerformanceManager.QueryPerfProviderSummary
method,
folder
type for the
VirtualMachine.CloneVM_Task
method).