I have the following code to list VMs by name. The list method is not returning any templates, but only VMs. From the documentation, I guess, it's supposed to return both VMs and templates. Any help is appreciated.
Builder searchSpec = new Builder();
searchSpec.setNames(Collections.singleton('template01'))
List<VMTypes.Summary> vms = client.vmService.list(searchSpec.build())
if (vms.size() == 0) {
println "Unable to find template"
}
But, getting template details using the ID of the template is working as expected.
VMTypes.Info info = client.vmService.get("vm-123") //vm-123 is the id of template "template01"