Announcing Code Generator For vSphere Java API

As I tweeted last week, there would be a big announcement when the open source VI Java API gets 20,000 downloads. It hit target yesterday. To celebrate it, I decide to release the code generator for the API, which William (@lamw) rated as “awesome.”

If you have used Onyx for generating PowerCLI code before, you can think it as Java version of Onyx. Even better, it generates complete Java code which is ready to run once you supply the URL, username, and password. It’s so easy that from now on, all the system administrators have no excuse for not trying open source vSphere Java API. :-)

Lost VMs or Containers? Too Many Consoles? Too Slow GUI? Time to learn how to "Google" and manage your VMware and clouds in a fast and secure HTML5 App.

At its heart, the code generator is a reversed proxy which sits between a vSphere Client and vCenter or ESX(i) server, and intercepts the SOAP XML messages. With the XML messages, I designed the algorithm to automatically generate the Java code based on the open source Java API code.

Unlike Onyx, the Java code generator provides richer GUI which allows you to:

  • Record both the requests and responses.
  • Sort the recorded messages in any order.
  • Generate complete code of any selected requests.
  • Save recorded messages to a local file, and read it back later.
  • Support raw HTTP data, XML, Java simultaneously in different tabs.

Although the generator supports only Java today, I did designed it to be extensible architecture for other languages like Jython, JRuby, Perl, etc. When I have time, I will continue to work on these in the future.

Too much talk? Let’s take a peek at a few screenshots in this page which includes download link and getting started tutorial. Shorter than my 5 minute VI Java API tutorial, it should be less than one minute this time.

Hope you enjoy the tool and let me how you like it.

This entry was posted in vSphere API and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.


  1. Posted February 1, 2012 at 7:31 am | Permalink

    This does sound “Awesome”. I can’t wait to try it out.

  2. monsrud
    Posted February 8, 2012 at 2:50 pm | Permalink

    Thanks. This will be extremely helpful.

  3. Abe
    Posted February 25, 2012 at 7:55 am | Permalink

    Can this tool be used to emulate a Virtual Center? We have a need for such a tool that can simulate 1000+ VMs.


  4. Posted February 26, 2012 at 4:11 pm | Permalink

    It cannot emulate a vCenter as it is. What’s the purpose for the emulation?

  5. Louis Jia
    Posted April 23, 2012 at 3:24 pm | Permalink

    What is URL to download this powerful tool?

  6. Posted April 23, 2012 at 3:39 pm | Permalink

    Check out in this page:

  7. Michael Landman
    Posted May 25, 2012 at 8:08 am | Permalink

    Hi Steve,

    I’m looking to automate the deployment of a virtual appliance from template, which I currently accomplish through the interactive dialog vSphere presents. I’ve used vijava in the past to automate the restoration of snapshots and other activities… do you know if I’ll be able to capture the correct set of messages to translate to java using this tool, to deploy appliances?

    Thanks in advance,


  8. Posted May 25, 2012 at 3:21 pm | Permalink

    Hi Mike,
    Whatever you can do from vSphere Client should be recorded and code generated. You may need to tweak the code a bit afterwards.

  9. tangramor
    Posted July 27, 2012 at 2:57 am | Permalink

    tried this tool, it only works with Sun (now Oracle) JDK, failed on IBM JDK.

    It really works, however, I do want to have a tailor function or filter funtion to remove the useless messages

  10. Mike Landman
    Posted February 6, 2013 at 2:27 pm | Permalink

    This was very useful when debugging why my usage of cloneVM via vijava APIs were failing, but the clone was succeeding via vSphere client. I was able to see vSphere client populating additional values for the cluster resourcePool that I didn’t know were required.

    I tried to use it side by side with the java APIs, by specifying the proxy at service instance creation time. :) It worked, but for the traffic generated by vijava, the SOAP operation shows as “?xml”. I can a bunch of the XML, but it does not format nicely and is very difficult to read, in comparison to the traffic captured from vSphere. Is there a way that vijava can generate the appropriate headers so that the soap messages are read and displayed in a more readable fashion?

  11. Posted March 19, 2013 at 10:14 am | Permalink

    The generated code has some error and it looks like I am not pointing to the right library.
    I am using vijava5120121125.jar which contains HostNetworkSystem class but the generated code invokes a constructor without arguments while the code is expecting a ServerConnection argument. In addition the next line of code
    _type1.type = “HostNetworkSystem”;
    is also in error because no type field exist.

    Could you, please, help with this?
    THank you

  12. Posted March 22, 2013 at 10:45 am | Permalink

    Thanks for reporting the issue. I will look into it later.

Post a Comment

Your email is never published nor shared. Required fields are marked *


You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


    My company has created products like vSearch ("Super vCenter"), vijavaNG APIs, EAM APIs, ICE tool. We also help clients with virtualization and cloud computing on customized development, training. Should you, or someone you know, need these products and services, please feel free to contact me: steve __AT__

    Me: Steve Jin, VMware vExpert who authored the VMware VI and vSphere SDK by Prentice Hall, and created the de factor open source vSphere Java API while working at VMware engineering. Companies like Cisco, EMC, NetApp, HP, Dell, VMware, are among the users of the API and other tools I developed for their products, internal IT orchestration, and test automation.