VMware Cloud Community
meoli
Enthusiast
Enthusiast

Rest-Api Get VM List - Partial Selection for VM-Fields?

Hey there,

i just dived into Rest-Api stuff (first time doing that) i atleast can now get my session cookie and extract it into a cookie so that i can shutdown and start VMs on my Android Phone with Shortucts 🙂

Since i don't want to remember all the moref-ids or rather want to use a variable where i type in the moref i need (i would rather use my vm-names but well) i wanted to create a Call which gives me a full list of my VMs where i only select the vm and name fields. Because Memory, CPU, Powerstate doesn't matter in this query.

Unfortunately the following Call:

Get HTTPS://vcsa/rest/vcenter/vm?filter.name=ThisismyVM&fields=vm,name

only gives me an Error:      "type": "com.vmware.vapi.std.errors.unexpected_input"

and fields alone only gives me {

     "value": []

}

Is there a way to get an output which only gives me the content of vm and name?

0 Kudos
0 Replies