Default language.

discovery.vSphereFindObjects


discovery.vSphereFindObjects(target, "object_type", ["property", "property", ...])

Queries to search from the root folder the instances of an object type and returns the requested properties for each object found.

The required parameters are:

  • target, where target is:
    • the ESX/ESXi node if discovering using vSphere or via vCenter, or the vCenter node if discovering information about the vCenter server. Or,
    • a data source against which the request is performed. See also, discovery-dataSource.
  • object_type - a vSphere managed object name specified in the VMware documentation. For example, Folder, Datacenter, ComputeResource, ResourcePool, or HostSystem.
  • properties - list of properties to retrieve. Each must be simple type (string, int, boolean, and so on), no objects, or lists.

This code example shows retrieving the name and hardware.systemInfo.uuid of HostSystem MOR:

hosts := discovery.vSphereFindObjects(vc_host, "HostSystem", ["name", "hardware.systemInfo.uuid"]);

 

 

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*