问题描述
我尝试使用来自邮递员的请求按文件夹恢复每个虚拟机。
通过此请求,我可以列出我的 vsphere 中的每个文件夹:
GET https://SERVER/rest/vcenter/folder
使用第二个命令,我可以列出 vpshere 中的每个虚拟机:
GET https://SERVER/rest/vcenter/vm
类似:
GET https://SERVER/rest/vcenter/folder/my_folder
输出如下:
"value": [
{
"folder": "XXX","VMs" : {
VM1
VM2
...
或者类似的东西?
非常感谢!
解决方法
&filter.parent_folders.1=obj-103
它支持查询参数 parent_folders ,所以 url 会像
GET https://SERVER/rest/vcenter/folder?filters.filter.parent_folders.1=obj-103
甚至 VM 也支持名为文件夹的过滤器: