Example code that uses jclouds to perform common tasks on an OpenStack Cloud. The class names are self-explanatory and the code is well commented for you to follow along.
To setup an environment to compile and run the examples use these commands:
git clone https://github.com/jclouds/jclouds-examples.git cd jclouds-examples/openstack/
To download all dependencies, run:
mvn dependency:copy-dependencies "-DoutputDirectory=./lib"
If you also want to download the source jars, run:
mvn dependency:copy-dependencies "-DoutputDirectory=./lib" "-Dclassifier=sources"
To run individual examples from the command line use these commands:
Note: If you're on Windows, the only change you need to make is to use a ‘;’ instead of a ‘:’ in the paths.
javac -classpath "lib/*:src/main/java/:src/main/resources/" src/main/java/org/jclouds/examples/openstack/identity/*.java
Every example class has a main method that takes the following arguments in the listed order
Try out an example.
java -classpath "lib/*:src/main/java/:src/main/resources/" org.jclouds.examples.openstack.identity.CreateTenantAndUser identityEndpoint myTenantname myUsername myPassword
Watch the terminal for output!
Your feedback is appreciated! If you have specific issues with OpenStack support in jclouds, we'd prefer that you file an issue via JIRA.
If you have questions or need help, please join our community and subscribe to the jclouds user mailing list.