VMware Cloud Community
qc4vmware
Virtuoso
Virtuoso

Server.findAllForType query parameter mystery solved (sorta)

I recently opened up a case with VMware support around the Sever.findAllForType() method and I figured I would share the results of that discussion.  I initially opened up the case since on a couple of different threads in this forum I have had advice given to use that method along with the optional "query" parameter.  The documentation states that this option will vary based on the plug-in's implementation of said query option.  I asked for some clarity or for someone to point me to the documentation that better explains the usage.  There isn't any currently but I did get this guidance so I figured I would share.  The first comment was in reference to the vCenter plugin in which it seems like xpath is the flavor of string to provide.  The other examples are for the vCAC plugin.

Paul,

I was able to reach out to one of our SDK Support Engineers, and they confirmed with my search that there is currently no such documentation available to describe different query types, as you suggested.  They did however want me to pass along the following comments:

I have also researched but there is no such documentation available to describe different query types. However, customer understanding is correct of using xpath. Regarding types which user can specify is based on the types available under vCAC plug-in, open the API explorer and check under vCAC plug-in option, whatever types are specified can be used in the method.

Additionally,

The VCACHost is an internal type for vCO (virtual type). So querying for a host is pretty simple, you just pass a string, and if it matches the id or the name of the host, it will be returned.

For instance:

Server.findAllForType("vCAC:VCACHost" , “abc”);

will return the vcac host which has "abc" in its name or id.

Filtering inventory objects however follows the OData URI standards and the query has to be structured according to the system query option as described here:URI Conventions | Open Data Protocol


Here’s a simple example:

Server.findAllForType("vCAC:Blueprint" , “VirtualMachineTemplateName eq 'simple_blueprint_name'”);

0 Replies