[one-users] OpenNebula Java API

William Voorsluys williamvoor at gmail.com
Tue Jul 15 02:23:16 PDT 2008


Hi All,

I've developed a Java wrapper API to access ONE's XML-RPC API.
Source code can be checked out from the following SVN repository:

https://svn.globus.org/repos/gsoc/william/onejava/trunk

To use, add the following jars to your program's classpath:

dist/opennebula.jar
lib/xmlrpc-client-3.1.jar
lib/xmlrpc-common-3.1.jar
lib/commons-logging-1.1.jar
lib/commons-io-1.4.jar
lib/ws-commons-util-1.0.2.jar

Here is one simple usage example:

OpenNebulaClient oneClient = new
OpenNebulaClientImpl("http://localhost:2633/RPC2");
VmAllocateResult allocateResult = oneClient.vmAllocate("S123", new
File("vm.template");
if (allocateResult.success()) {
	System.out.println("VM was successfully allocated. Id: " +
allocateResult.getVid());
} else {
	System.out.println("VM allocation failed. Cause : " +
allocateResult.getErrorMessage());
}

This is a very preliminary version and not all methods have been fully
tested. So I would appreciate your comments on how to improve it.

Cheers,

-- 
William Voorsluys

williamvoor.googlepages.com



More information about the Users mailing list