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

Get VCAC:VirtualMachine by partial name

$
0
0

I am trying to develop an action i can call as part of one of my workflow that will return a list of vcac:virtualmachines based on a filter i provide so the client get a drop down list to choose from.  The problem i am have is that my code below works find if i provide the whole vm name but doesnt return anything if i use a partial name.  Eventually i will provide another filter to filter by business group as well but i am working up to that.  What am i doing wrong?

 

The whole server name:

"ap-script-p001"

 

Test code:

var Pattern = 'ap-script';

var vms = Server.findAllForType("vCAC:VirtualMachine", "substringof(VirtualMachineName, '" + Pattern + "') eq true")

for each (var vCACVirtualMachine in vms) {
  System.log("name:"+vCACVirtualMachine.VirtualMachineName);
}

 

with the code above nothing comes back

 

With the whole name it returns the object.  I want to be able to enter a partial name and the client can choose their specific box for a drop down.


Viewing all articles
Browse latest Browse all 6251

Trending Articles



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