Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

find virtual machines by business group name and virtual machine name filter

$
0
0

I am trying to develop logic to find all virtual machines from a given business group and with a name filter.  What i would like to get back is a VCAC:VirtualMachine object with all of the machines.

 

I have been trying to pull together bits and pieces from the net with no luck.  Eventually i want to move this from a workflow to an action so i can drive form elements in vra asd.

 

Inputs:

BusinessGroupName(string)

ServerName(string)

 

General Attributes:

vcaccafehost(VCACCAFE:VCACHost)

vms(vCAC:Entity)

 

 

Scriptable Task:

service = vcaccafehost.createCatalogClient().getCatalogConsumerResourceService();


var conditions = new Array();
conditions[0] = vCACCAFEFilterParam.substringOf("name", vCACCAFEFilterParam.string(ServerName));
conditions[1] = vCACCAFEFilterParam.substringOf("organization/subTenant/id", vCACCAFEFilterParam.string(BusinessGroupName));


var filter = new Array();
filter[0] = vCACCAFEFilterParam.and(conditions);
var query = vCACCAFEOdataQuery.query().addFilter(filter);


var items = service.getResourcesList(new vCACCAFEPageOdataRequest(query));


System.log(items);


for each (var item in items) {
  System.log("name:"+ item);
}

 

I am on a learning curve for java script and the vcac cafe.

 

Help  Please....


Viewing all articles
Browse latest Browse all 6251

Trending Articles



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