PySphere 和 PyVmomi 有什么区别? [英] What is the Difference between PySphere and PyVmomi?

查看:36
本文介绍了PySphere 和 PyVmomi 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要编写 python 脚本来自动化在 ESX/ESXi 主机上运行的虚拟机的时间配置.我不知道该使用哪个api...我能够找到 VMWare apis viz 的 python 绑定.PySphere 和 PyVmomi.谁能解释一下它们之间有什么区别,应该使用哪一个?

I need to write python scripts to automate time configuration of Virtual Machines running on a ESX/ESXi host. I don't know which api to use... I am able to find to python bindings for VMWare apis viz. PySphere and PyVmomi. Could anyone please explain what is the difference between them, which one should be used?

谢谢!

推荐答案

我是(现在是前任)VMware 员工,他帮助解决了这个问题.

I'm the (now former) VMware employee who helped get this out the door.

pyVmomi 代表 VMware 发布的 vSphere API 的官方绑定.函数和对象名称直接映射到 vSphere Web 服务 SDK 中记录的内容.需要一段时间来适应它,我们应该添加一些文档来帮助人们将官方文档中的内容映射到您可以在 pyVmomi 中实际使用的内容,但它真的就在那里,您可能会获得比您所获得的更多的功能pysphere 将官方 API 调用包装在特定于 API 的函数名称中.

pyVmomi represents the official bindings of the vSphere API released by VMware. The functions and object names map directly to what's documented in the vSphere Web Services SDK. It takes a while to get used to it and we should add some docs helping people map what's in the official documentation to what you can actually use in pyVmomi, but it's really all there and you'll probably get more functionality than you would out of pysphere which wraps official API calls in API-specific function names.

通过 pyVmomi 使用 vSphere API 的最完整的项目之一是我帮助开源的另一个项目 ThinApp Factory.我建议查看其来源(特别是 linked.py)以查看什么是可能的.

One of the most complete projects that uses the vSphere API via pyVmomi is another project I helped open source, ThinApp Factory. I recommend looking at its source (specifically linked.py) to see what is possible.

如果 pyVmomi 难以使用或不清楚,请随时在 我们的 Github 上提交错误.玩得开心!

If things are hard to use or unclear about pyVmomi, please feel free to file a bug on our Github. Have fun!

这篇关于PySphere 和 PyVmomi 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆