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

Re: get all Vapp Templates in catalog

$
0
0

Hi,

 

You can use the query service and filter the results.

 

Using the VappTemplate query you can filter the results based on the catalog name. Below is an API & Java SDK example. You can easily convert the java sample to C#.

 

REST API:

     Ex: https://vcloud/api/query?type=adminVAppTemplate&filter=(catalogName==mycatalog)&format=records

 

Java SDK:

 

      QueryParams<QueryAdminVAppTemplateField> queryParams = new QueryParams<QueryAdminVAppTemplateField>();
      queryParams.setFilter(new Filter(new Expression(QueryAdminVAppTemplateField.CATALOGNAME, "mycatalog", ExpressionType.EQUALS)));
      RecordResult<QueryResultAdminVAppTemplateRecordType> vappTemplateResult = client.getQueryService().queryRecords(
                                                                                                                                     QueryRecordType.ADMINVAPPTEMPLATE, queryParams);
      for (QueryResultAdminVAppTemplateRecordType vappTemplateRecord : vappTemplateResult.getRecords()) {
         System.out.println(vappTemplateRecord.getName());
      }
Regards,
Rajesh Kamal.

Viewing all articles
Browse latest Browse all 246286

Trending Articles



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