首页 > 解决方案 > 使用邮递员请求按文件夹恢复 Vsphere VM?

问题描述

我尝试使用邮递员的请求按文件夹恢复每个 VM。

通过这个请求,我可以列出我的 vsphere 中的每个文件夹:

GET https://SERVER/rest/vcenter/folder

使用第二个命令,我可以在我的 vpshere 中列出每个 VM:

GET https://SERVER/rest/vcenter/vm

我想知道是否有办法获取文件夹和其中的每个 VMS?

就像是 :

GET https://SERVER/rest/vcenter/folder/my_folder

输出如下:

"value": [
        {
            "folder": "XXX",
               "VMs" : {
                VM1
                VM2
                ...

或者类似的东西?

非常感谢 !

标签: requestpostmanvspherevcenter

解决方案


http://vmware.github.io/vsphere-automation-sdk-rest/6.5/operations/com/vmware/vcenter/folder.list-operation.html

&filter.parent_folders.1=obj-103

它支持查询参数 parent_folders ,所以 url 就像

GET https://SERVER/rest/vcenter/folder?filters.filter.parent_folders.1=obj-103

甚至 VM 也支持名为文件夹的过滤器:

http://vmware.github.io/vsphere-automation-sdk-rest/6.5/operations/com/vmware/vcenter/vm.list-operation.html


推荐阅读