The Java Multi-Cloud Toolkit
Go to file
Aled Sage 7866612a2e Fix/improve retry-predicate:
- If get timeout of 0 (or negative), then still try once.
- Remove (unlikely) race in retry’s apply(T) where context-switching
  delays could cause `before(end)` to return false the first time, even
  though the timeout was positive.
- Ensure retries at end of the timeout (e.g. if timeout is 30 secs
  and last sleep takes us up to the 30 secs mark, then test again
  rather than returning immediately after the sleep!)
- Use `long` for time, rather than `java.util.Date`, for internal
  calculations. Deprecates old protected methods that use Date.
2015-01-29 12:37:15 +01:00
all Aligned pom.xml files for Chef 2014-11-23 22:23:23 +01:00
allblobstore JCLOUDS-652 Pin filesystem api to Java 7+. 2014-10-25 10:39:06 -07:00
allcompute [maven-release-plugin] prepare for next development iteration 2014-10-10 01:06:02 -04:00
allloadbalancer [maven-release-plugin] prepare for next development iteration 2014-10-10 01:06:02 -04:00
apis Fixed checkstyle violations 2015-01-27 10:45:58 +01:00
blobstore Use AutoService to generate service loader metadata 2015-01-12 11:19:07 -08:00
common [maven-release-plugin] prepare for next development iteration 2014-10-10 01:06:02 -04:00
compute Use AutoService to generate service loader metadata 2015-01-12 11:19:07 -08:00
core Fix/improve retry-predicate: 2015-01-29 12:37:15 +01:00
drivers Use AutoService to generate service loader metadata 2015-01-12 11:19:07 -08:00
loadbalancer [maven-release-plugin] prepare for next development iteration 2014-10-10 01:06:02 -04:00
project Upgrade assertj-core to 1.7.0 and assertj-guava to 1.3.0 2014-12-03 09:47:01 -08:00
providers Use AutoService to generate service loader metadata 2015-01-12 11:19:07 -08:00
resources [maven-release-plugin] prepare for next development iteration 2014-10-10 01:06:02 -04:00
scriptbuilder [maven-release-plugin] prepare for next development iteration 2014-10-10 01:06:02 -04:00
skeletons Use AutoService to generate service loader metadata 2015-01-12 11:19:07 -08:00
.dir-locals.el JCLOUDS-26. Adding .dir-locals.el for Emacs tab-width setting 2013-05-10 14:52:52 -07:00
.gitignore added support for vbox 4.2.6; 2012-12-31 01:33:43 +01:00
.mailmap Update mailmap for acole@twitter.com 2014-10-04 09:21:15 -07:00
CONTRIBUTING.md Added the CONTRIBUTING file 2014-07-02 16:48:14 +02:00
README.md Updated links to the user and dev mailing lists 2014-04-14 14:41:52 +02:00
pom.xml [maven-release-plugin] prepare for next development iteration 2014-10-10 01:06:02 -04:00

README.md

jclouds

jclouds allows provisioning and control of cloud resources, including blobstore and compute, from Java and Clojure. Our API allows developers to use both portable abstractions and cloud-specific features. We test support of dozens of cloud providers and cloud software stacks, including Amazon, Azure, GoGrid, Ninefold, OpenStack, and vCloud. jclouds is licensed under the Apache License, Version 2.0

Features

Even if you don't need the portable apis we provide, or could roll it your own, programming against cloud environments can be challenging. We focus on the following areas so that you can focus on using the cloud, rather than troubleshooting it!

  • SIMPLE INTERFACE Get started without dealing with REST-like APIs or WebServices. Instead of creating new object types, jclouds reuses concepts like maps so that the programming model is familiar.

  • RUNTIME PORTABILITY jclouds drivers enable you to operate in restricted environments like Google App Engine. There are very few required dependencies, so jclouds is unlikely to clash with your app.

  • DEAL WITH WEB COMPLEXITY jclouds handles issues such as transient failures and redirects that traditional network based computing introduces.

  • UNIT TESTABILITY Write your unit tests without mocking complexity or the brittleness of remote connections. Writing tests for cloud endpoints is difficult. jclouds provides you with Stub connections that simulate a cloud without creating network connections.

  • PERFORMANCE Customize configuration to match your performance needs. jclouds provides you with asynchronous commands, tunable http, date, and encryption modules.

  • LOCATION jclouds provides location-aware abstractions. For example, you can get ISO-3166 codes to tell which country or province a cloud runs in.

  • QUALITY Every provider is tested with live scenarios before each release. If the provider doesn't pass, it goes back into the sandbox.

BlobStore

Simplifies dealing with key-value providers such as Amazon S3. For example, BlobStore can give you a simple Map view of a container.

BlobStore Example (Java):

// init
context = new BlobStoreContextFactory().createContext(
"aws-s3",
accesskeyid,
secretaccesskey);
blobStore = context.getBlobStore();

// create container
blobStore.createContainerInLocation(null, "mycontainer");

// add blob
blob = blobStore.blobBuilder("test").payload("testdata").build();
blobStore.putBlob("mycontainer", blob);

BlobStore Example (Clojure):

(use 'org.jclouds.blobstore2)
(def ^:dynamic *blobstore* (blobstore "azureblob" account encodedkey))
(create-container *blobstore* "mycontainer")
(put-blob *blobstore* "mycontainer" (blob "test" :payload "testdata"))

ComputeService

Simplifies the task of managing machines in the cloud. For example, you can use ComputeService to start 5 machines and install your software on them.

Compute Example (Java):

// init
context = new ComputeServiceContextFactory().createContext(
"aws-ec2",
accesskeyid,
secretaccesskey,
ImmutableSet.of(new Log4JLoggingModule(), new SshjSshClientModule()));

client = context.getComputeService();

// define the requirements of your node
template = client.templateBuilder().osFamily(UBUNTU).smallest().build();

// setup a boot user which is the same as your login
template.getOptions().runScript(AdminAccess.standard());

// these nodes will be accessible via ssh when the call returns
nodes = client.createNodesInGroup("mycluster", 2, template);

// you can now run ad-hoc commands on the nodes based on predicates
responses = client.runScriptOnNodesMatching(inGroup("mycluster"), "uptime", wrapInInitScript(false));

Compute Example (Clojure):

(use 'org.jclouds.compute2)

; create a compute service using sshj and log4j extensions
(def compute (*compute* "trmk`-ecloud" "user" "password" :sshj :log4j))

; launch a couple nodes with the default operating system, installing your user.
(create-nodes *compute* "mycluster" 2
(TemplateOptions$Builder/runScript (AdminAccess/standard)))

; run a command on that group 
(run-script-on-nodes-matching *compute* (in-group? "mycluster") "uptime" 
(RunScriptOptions$Builder/wrapInInitScript false))

Check out https://github.com/jclouds/jclouds-examples for more examples!

Downloads

Resources

License

Copyright (C) 2009-2013 The Apache Software Foundation

Licensed under the Apache License, Version 2.0