是否有用于将vSphere JSON结果映射到适当的Java对象的API?(Is there an API to map a vSphere JSON Result to an appropriate

编程入门 行业动态 更新时间:2024-10-21 19:33:20
是否有用于将vSphere JSON结果映射到适当的Java对象的API?(Is there an API to map a vSphere JSON Result to an appropriate Java Object?)

我正在尝试使用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.

更多推荐

本文发布于:2023-08-07 10:15:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1463777.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:对象   Java   JSON   vSphere   Object

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!