VMware vsphere 7 api

Vmware vsphere 7 api

我正在尝试构建一个 python 程序来自动执行 vmware vsphere 任务。目前我是 运行 vsphere 7 esxi 服务器。问题是当我尝试使用邮递员测试 api 列出虚拟机时,我得到一个空数组,但我可以在 vsphere Web 客户端上看到虚拟机信息没有任何问题

API 调用:https://host-ip/rest/vcenter/vm(header 包含使用 create session api 创建的 session id)

谁能说说为什么会这样enter image description here

很遗憾,ESXi 主机没有 REST API 服务。该服务只能通过 vCenter Server 获得。但是,您可以使用与该 API 服务交互的 vSphere Web Services (SOAP) API. Since you reference Python, you could also check out the pyvmomi SDK。