VMware Cloud Community
batchenregev
Contributor
Contributor

Vcenter rest api for listing vms in a folder

Hello,

I have gone through  vcenter rest api docs : 

REST API - list

And when im sending this request :

GET https://{server}/rest/vcenter/vm

Im getting this  ( multipul times as for all the vms my user has premmision to see):

{

"cpu_count": 2,

"memory_size_Mib": 8192,

"name": myvm name,

"power_state" : "POWERD_OFF",

"vm": "vm-223"

}

As you see there is no "folder" in this json even when this vm is inside a folder.

Hoe can i send rest API request to show me all vms in a specific folder like "testfolder" ?

I couldn't find a way.

please help.

Thanks

Tags (2)
Reply
0 Kudos
2 Replies
daphnissov
Immortal
Immortal

You can't, it's not available yet in the rest API.

Reply
0 Kudos
Alex_Romeo
Leadership
Leadership

Hi,

If they can be useful:

REST API Reference Documentation

within the Vcenter subheadings

ARomeo

Blog: https://www.aleadmin.it/
Reply
0 Kudos