Hi,
My requirement is to get all the vApp templates of a particular organization which have only 1 VM.
I tried with this but it didnt work.
QueryService queryService = client.getQueryService();
QueryParams<QueryVAppTemplateField> tParam = new QueryParams<QueryVAppTemplateField>();
MetadataNumberValue number = new MetadataNumberValue();
number.setValue(1);
Expression expression = new Expression("numberOfVMs", number, MetadataExpressionType.EQUALS);
Filter filter = new Filter(expression);
tParam.setFilter(filter);
for(ReferenceType t:queryService.queryvAppTemplateReferences(tParam).getReferences())
{
VappTemplate tTemplate = VappTemplate.getVappTemplateByReference(client, t);
System.out.println(t.getName());
}
I am not getting any result while executing this. Could you please let me know whether this is right?
Thanks,
Reshmi