tree: bb86cec5e98bf551bd94da82c82903984a68b6ef [path history] [tgz]
  1. src/
  2. pom.xml
  3. README.md
openstack/README.md

OpenStack Examples

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.

Requirements

  1. Username and password for an OpenStack Cloud - See the Getting Started guide.
  2. Java Development Kit (JDK) version 6 or later - Download.
  3. Apache Maven - Maven in 5 Minutes.
  4. Git - Download.

Environment

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"

Examples

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

  1. Identity (Keystone) endpoint (e.g. an IP address or URL)
  2. Tenant name
  3. User name
  4. Password

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!

Support and Feedback

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.