Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 193504

Re: How to get VappTemplate list

$
0
0

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


Viewing all articles
Browse latest Browse all 193504

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>