Lately I had to do a lot of works with the VMware VCloud product and since the python API did not seem available and I did not have the courage to use the PHP API I had to do most of the API works with Java. I never did any Java before and while I have found Eclipse+Java development surprisingly pleasant and easy to use/learn my favourite are still Emacs+Python.

I have then started to look over Jython to see if I can interact easily with Java via Python and this was actually pretty easy, it took me less than 10mn to convert a Login/Listing-VAPPS script in Jython.

The script is attached at the end of this post (or on github gist here). Don’t forget to adjust the classpath variable mine are defined like that :

commons-codec-1.3.jar
commons-httpclient-3.1.jar
commons-logging-1.1.1.jar
rest-api-schemas-1.0.0.jar
vcloud-java-sdk-0.9.jar
vCloudJavaSDK-samples.jar