我正在尝试使用vSphere的REST API来获取有关我们虚拟机的信息。 我已经使用提供的REST API连接到服务器,并且我从REST请求获得了JSON结果。 vSphere JSON结果如下所示:
{"value":[{ "hot_add_increment_size_MiB": 8, "size_MiB": 1, "hot_add_enabled": false, "hot_add_limit_MiB": 51258 }] }现在我想将此JSON字符串转换为适当的类。 我实际面临的问题是,它可能是一个非常复杂的JSON结果。
我的问题是:是否有来自VMWare的API,我可以用来解决我的问题? 每个提示都表示赞赏。 提前谢谢了。
I am trying to use the REST API of vSphere to get information about our virtual machines. I already connected to the server using the provided REST API and I got a JSON Result from a REST request. The vSphere JSON result looks like this:
{"value":[{ "hot_add_increment_size_MiB": 8, "size_MiB": 1, "hot_add_enabled": false, "hot_add_limit_MiB": 51258 }] }Now I want to convert this JSON String to an appropriate Class. The problem, I am actually facing is, that it can be a very complex JSON result.
My question is: Is there an API from VMWare, I can use to solve my problem? Every hint is appreciated. Many thanks in advance.
最满意答案
答案是不。 VMware发布了架构。 它可能不存在。
您可以通过此API获得所需内容(免责声明:我是作者): https : //github.com/DoubleCloudInc/vim-rest-api/
架构与vSphere API相同,因此您可以将vijava数据对象用作Java对象。 http://vijava.sf.net 。 再说一次,我是作者。
The answer is no. There is schema published by VMware. It might not exist.
You may be able to get what you want with this API (disclaimer: I am the author): https://github.com/DoubleCloudInc/vim-rest-api/
The schema is the same as vSphere API, so you can use the vijava data objects as your Java objects. http://vijava.sf.net. Again, I am the author.
更多推荐
发布评论