I want to use VMWare REST API for finding VM. I want to find the VMs with a name 'PW-XXX'. I use /rest/vcenter/vm, but there are too many VM, so I must add a filtre. But I don't have the full name of VM. I want to find all VM with name like 'PW-XXX'. I don't know how can I do. Thanks for your reponse.
Hi, you need to specify what programming language you are using and also paste in the code segment you have so far.
If you're using PowerShell, all you need to do is run a match on the array of VM names returned.
Hello, thanks for your reply.
The problem is I can’t get vm list via rest api. Because in the réponse json, if it have more than 1000 vm, we can’t get all vm by rest api. It must have a filter in url, vm/filter.name=xxx. It must use a full host name. I don’t have the full host name,
Unfortunately this is a known vCenter REST API issue or limitation.
You may need to write your solution with PowerShell/PowerCLI using the SOAP API.
Alternatively, you could log an SR with VMware SDK support, if you have this ability.