The findRelation operation finds all the children elements in an inventory that belong to a particular parent or type of parent.

Knowing how a child is related to its parent is useful if you develop tree viewers to view the objects in a library. The findRelation operation is declared as follows.

public FinderResult[] findRelation(String parentType, String parentId, 
String relation, String username, String password);

Type

Value

Description

String

parentType

The type of parent object.

The parentType property can be the name of a plug-in, or it can specify a more narrowly defined parent. For example, you can specify the parentType as "VC:" to obtain the objects at the root of VMware vCenter Server plug-in, or you can a specific folder, such as "VC:VmFolder".

String

parentId

The ID of a particular parent object.

The parentId parameter allows you to find the children of a specific parent object, if you know its ID.

String

relation

The name of the relation.

Calling findRelation returns all children elements under a parent identified by its parentId. If you omit the parentId the parentType is not the root type of the inventory, the findRelation operation returns null.

See Relation Types for more information.

String

username

Orchestrator user name.

String

password

Orchestrator password.

The relation property types are defined by the plug-ins. The validity of relations depends on the parent type.

This table lists the relation types defined by each of the standard plug-ins provided by Orchestrator.

Standard Orchestrator Relation Types

Plug-In

Relation Names

Relation Types

Enumerations

No relations

No relations

Jakarta Commons Net

No relations

No relations

JDBC

No relations

No relations

Library

No relations

No relations

Mail

No relations

No relations

Networking

IpAddress

IPV4Address

MacAddressPool

NetworkDomain

Proxy

Subnet

Range

SSH

File

Folder

RootFolder

SshConnection

vCenter Server

getComputeResource_ClusterComputeResource()

getComputeResource_ComputeResource()

getDatacenter()

getDatastore()

getDatastoreFolder()

getFolder()

getFolder()

getFolder()

getFolder()

getFolder()

getHost()

getHostFolder()

getNetwork()

getNetworkFolder()

getNetwork_DistributedVirtualPortgroup()

getNetwork_Network()

getOwner()

getParentFolder()

getPortgroup()

getRecentTask()

getResourcePool()

getResourcePool_ResourcePool()

getResourcePool_VirtualApp()

getRootFolder()

getSdkConnections()

getVm()

getVmFolder()

getVmSnapshot()

ClusterComputeResource

ComputeResource

Datacenter

Datastore

DatastoreFolder

DatacenterFolder

DatastoreFolder

HostFolder

NetworkFolder

VmFolder

HostSystem

HostFolder

Network

NetworkFolder

DistributedVirtualPortgroup

Network

ComputeResource

VmFolder

DistributedVirtualPortgroup

Task

ResourcePool

ResourcePool

VirtualApp

DatacenterFolder

SdkConnection

VirtualMachine

VmFolder

VirtualMachineSnapshot

XML

No relations

No relations

The relation property can also reference relation types specified in each plug-in's vso.xml file. The following example is an excerpt from the networking plug-in vso.xml file.

[...]
<relations>
				<relation name="Subnet" type="Class:Subnet"/>
				<relation name="Range" type="Class:Range"/>
				<relation name="NetworkDomain" type="Class:NetworkDomain"/>
				<relation name="MacAddressPool" type="Class:MacAddressPool"/>
	</relations>
[...]

In addition to the relation types listed in Standard Orchestrator Relation Types, Orchestrator also defines the CHILDREN relation, to represent all relation types.

Returns a list of FinderResult objects.

Returns an exception if no children are found or if you pass it an invalid parameter.