You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by an...@apache.org on 2015/04/07 17:04:47 UTC
jclouds-examples git commit: bump jclouds version to 1.9.0
Repository: jclouds-examples
Updated Branches:
refs/heads/master 741371e6e -> 549fba2cf
bump jclouds version to 1.9.0
removed virtualbox references
Project: http://git-wip-us.apache.org/repos/asf/jclouds-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds-examples/commit/549fba2c
Tree: http://git-wip-us.apache.org/repos/asf/jclouds-examples/tree/549fba2c
Diff: http://git-wip-us.apache.org/repos/asf/jclouds-examples/diff/549fba2c
Branch: refs/heads/master
Commit: 549fba2cfc0ef3afef749e5231cf58dfe17b1498
Parents: 741371e
Author: Andrea Turli <an...@gmail.com>
Authored: Tue Mar 31 13:58:05 2015 +0200
Committer: Andrea Turli <an...@gmail.com>
Committed: Tue Apr 7 17:04:28 2015 +0200
----------------------------------------------------------------------
blobstore-basics/pom.xml | 2 +-
.../examples/blobstore/basics/MainApp.java | 12 ++++----
blobstore-largeblob/pom.xml | 2 +-
blobstore-uploader/dependency-reduced-pom.xml | 18 ++++++++++++
blobstore-uploader/pom.xml | 18 ++++++++++++
chef-basics/pom.xml | 7 +----
compute-basics/README.md | 5 ----
compute-basics/pom.xml | 9 ++----
.../examples/compute/basics/MainApp.java | 29 +++++++++-----------
google/pom.xml | 2 +-
openstack/pom.xml | 7 +----
pom.xml | 4 +--
12 files changed, 63 insertions(+), 52 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds-examples/blob/549fba2c/blobstore-basics/pom.xml
----------------------------------------------------------------------
diff --git a/blobstore-basics/pom.xml b/blobstore-basics/pom.xml
index 043b6b5..bebeeed 100644
--- a/blobstore-basics/pom.xml
+++ b/blobstore-basics/pom.xml
@@ -27,7 +27,7 @@
<description>jclouds blobstore example that creates a container, then displays the size of each container</description>
<properties>
- <jclouds.version>1.8.0</jclouds.version>
+ <jclouds.version>1.9.0</jclouds.version>
</properties>
<dependencies>
http://git-wip-us.apache.org/repos/asf/jclouds-examples/blob/549fba2c/blobstore-basics/src/main/java/org/jclouds/examples/blobstore/basics/MainApp.java
----------------------------------------------------------------------
diff --git a/blobstore-basics/src/main/java/org/jclouds/examples/blobstore/basics/MainApp.java b/blobstore-basics/src/main/java/org/jclouds/examples/blobstore/basics/MainApp.java
index 186051c..ac20e72 100755
--- a/blobstore-basics/src/main/java/org/jclouds/examples/blobstore/basics/MainApp.java
+++ b/blobstore-basics/src/main/java/org/jclouds/examples/blobstore/basics/MainApp.java
@@ -18,7 +18,6 @@ package org.jclouds.examples.blobstore.basics;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.Iterables.contains;
-
import java.io.IOException;
import java.util.Map;
import java.util.Set;
@@ -35,10 +34,9 @@ import org.jclouds.blobstore.BlobStoreContext;
import org.jclouds.blobstore.domain.Blob;
import org.jclouds.blobstore.domain.StorageMetadata;
import org.jclouds.openstack.swift.SwiftApiMetadata;
-import org.jclouds.openstack.swift.SwiftClient;
+import org.jclouds.openstack.swift.v1.SwiftApi;
import org.jclouds.providers.ProviderMetadata;
import org.jclouds.providers.Providers;
-import org.jclouds.rest.RestContext;
import org.jclouds.s3.S3ApiMetadata;
import org.jclouds.s3.S3Client;
@@ -116,11 +114,11 @@ public class MainApp {
S3Client api = context.unwrapApi(S3Client.class);
object = api.headObject(containerName, blobName);
} else if (apiMetadata instanceof SwiftApiMetadata) {
- SwiftClient api = context.unwrapApi(SwiftClient.class);
- object = api.getObjectInfo(containerName, blobName);
+ SwiftApi api = context.unwrapApi(SwiftApi.class);
+ object = api.getObjectApi(containerName, blobName);
} else if (apiMetadata instanceof AzureBlobApiMetadata) {
- RestContext<AzureBlobClient, ?> providerContext = context.unwrap();
- object = providerContext.getApi().getBlobProperties(containerName, blobName);
+ AzureBlobClient api = context.unwrapApi(AzureBlobClient.class);
+ object = api.getBlobProperties(containerName, blobName);
} else if (apiMetadata instanceof AtmosApiMetadata) {
AtmosClient api = context.unwrapApi(AtmosClient.class);
object = api.headFile(containerName + "/" + blobName);
http://git-wip-us.apache.org/repos/asf/jclouds-examples/blob/549fba2c/blobstore-largeblob/pom.xml
----------------------------------------------------------------------
diff --git a/blobstore-largeblob/pom.xml b/blobstore-largeblob/pom.xml
index 377a6dd..eef23e8 100644
--- a/blobstore-largeblob/pom.xml
+++ b/blobstore-largeblob/pom.xml
@@ -27,7 +27,7 @@
<description>jclouds blobstore example that creates a container, then uploads a large file using parallel multipart upload</description>
<properties>
- <jclouds.version>1.8.0</jclouds.version>
+ <jclouds.version>1.9.0</jclouds.version>
</properties>
<dependencies>
http://git-wip-us.apache.org/repos/asf/jclouds-examples/blob/549fba2c/blobstore-uploader/dependency-reduced-pom.xml
----------------------------------------------------------------------
diff --git a/blobstore-uploader/dependency-reduced-pom.xml b/blobstore-uploader/dependency-reduced-pom.xml
index 7fa7220..2b3c3c6 100644
--- a/blobstore-uploader/dependency-reduced-pom.xml
+++ b/blobstore-uploader/dependency-reduced-pom.xml
@@ -1,4 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>blobstore-uploader</groupId>
http://git-wip-us.apache.org/repos/asf/jclouds-examples/blob/549fba2c/blobstore-uploader/pom.xml
----------------------------------------------------------------------
diff --git a/blobstore-uploader/pom.xml b/blobstore-uploader/pom.xml
index 2e3cba3..536792e 100644
--- a/blobstore-uploader/pom.xml
+++ b/blobstore-uploader/pom.xml
@@ -1,4 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
http://git-wip-us.apache.org/repos/asf/jclouds-examples/blob/549fba2c/chef-basics/pom.xml
----------------------------------------------------------------------
diff --git a/chef-basics/pom.xml b/chef-basics/pom.xml
index 2d44dfd..4569fce 100644
--- a/chef-basics/pom.xml
+++ b/chef-basics/pom.xml
@@ -27,7 +27,7 @@
<description>jclouds chef example that adds a node to a group, then installs an Apache web server on all nodes</description>
<properties>
- <jclouds.version>1.8.0</jclouds.version>
+ <jclouds.version>1.9.0</jclouds.version>
</properties>
<dependencies>
@@ -51,11 +51,6 @@
<artifactId>joyentcloud</artifactId>
<version>${jclouds.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>virtualbox</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
<!-- note that if you want a smaller distribution
remove the above dependency and place something
like below -->
http://git-wip-us.apache.org/repos/asf/jclouds-examples/blob/549fba2c/compute-basics/README.md
----------------------------------------------------------------------
diff --git a/compute-basics/README.md b/compute-basics/README.md
index 78902ce..a31122d 100755
--- a/compute-basics/README.md
+++ b/compute-basics/README.md
@@ -74,11 +74,6 @@ To list all images (the *groupname* parameter is not used):
-jar target/compute-basics-jar-with-dependencies.jar \
openstack-nova tenantId:user password mygroup add
-### Virtualbox
-
- java -jar target/compute-basics-jar-with-dependencies.jar virtualbox \
- your-username your-password mygroup add
-
### Your own OpenStack Nova emulating EC2
java \
http://git-wip-us.apache.org/repos/asf/jclouds-examples/blob/549fba2c/compute-basics/pom.xml
----------------------------------------------------------------------
diff --git a/compute-basics/pom.xml b/compute-basics/pom.xml
index 7268c8c..7355ccb 100644
--- a/compute-basics/pom.xml
+++ b/compute-basics/pom.xml
@@ -22,12 +22,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.jclouds.examples</groupId>
<artifactId>compute-basics</artifactId>
- <version>1.8.0</version>
+ <version>1.9.0</version>
<name>compute-basics</name>
<description>jclouds compute example that adds a node to a group, then executes "echo hello" on all nodes</description>
<properties>
- <jclouds.version>1.8.0</jclouds.version>
+ <jclouds.version>1.9.0</jclouds.version>
</properties>
<dependencies>
@@ -48,11 +48,6 @@
</dependency>
<dependency>
<groupId>org.apache.jclouds.labs</groupId>
- <artifactId>virtualbox</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.labs</groupId>
<artifactId>google-compute-engine</artifactId>
<version>${jclouds.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/jclouds-examples/blob/549fba2c/compute-basics/src/main/java/org/jclouds/examples/compute/basics/MainApp.java
----------------------------------------------------------------------
diff --git a/compute-basics/src/main/java/org/jclouds/examples/compute/basics/MainApp.java b/compute-basics/src/main/java/org/jclouds/examples/compute/basics/MainApp.java
index 4fbd650..e47cc34 100644
--- a/compute-basics/src/main/java/org/jclouds/examples/compute/basics/MainApp.java
+++ b/compute-basics/src/main/java/org/jclouds/examples/compute/basics/MainApp.java
@@ -18,6 +18,7 @@
*/
package org.jclouds.examples.compute.basics;
+
import static com.google.common.base.Charsets.UTF_8;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Predicates.not;
@@ -28,12 +29,10 @@ import static org.jclouds.aws.ec2.reference.AWSEC2Constants.PROPERTY_EC2_AMI_QUE
import static org.jclouds.aws.ec2.reference.AWSEC2Constants.PROPERTY_EC2_CC_AMI_QUERY;
import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_SCRIPT_COMPLETE;
import static org.jclouds.compute.options.TemplateOptions.Builder.overrideLoginCredentials;
-import static org.jclouds.compute.options.TemplateOptions.Builder.overrideLoginUser;
import static org.jclouds.compute.options.TemplateOptions.Builder.runScript;
import static org.jclouds.compute.predicates.NodePredicates.TERMINATED;
import static org.jclouds.compute.predicates.NodePredicates.inGroup;
import static org.jclouds.scriptbuilder.domain.Statements.exec;
-
import java.io.File;
import java.io.IOException;
import java.util.Map;
@@ -49,8 +48,12 @@ import org.jclouds.compute.ComputeService;
import org.jclouds.compute.ComputeServiceContext;
import org.jclouds.compute.RunNodesException;
import org.jclouds.compute.RunScriptOnNodesException;
+import org.jclouds.compute.domain.ComputeMetadata;
import org.jclouds.compute.domain.ExecResponse;
+import org.jclouds.compute.domain.Image;
import org.jclouds.compute.domain.NodeMetadata;
+import org.jclouds.compute.domain.OsFamily;
+import org.jclouds.compute.domain.Template;
import org.jclouds.compute.domain.TemplateBuilder;
import org.jclouds.domain.LoginCredentials;
import org.jclouds.enterprise.config.EnterpriseConfigurationModule;
@@ -69,10 +72,6 @@ import com.google.common.collect.Maps;
import com.google.common.io.Files;
import com.google.inject.Module;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.ComputeMetadata;
-import org.jclouds.compute.domain.OsFamily;
-
/**
* Demonstrates the use of {@link ComputeService}.
* <p/>
@@ -128,8 +127,7 @@ public class MainApp {
}
String minRam = System.getProperty("minRam");
- String loginUser = System.getProperty("loginUser", "toor");
-
+
// note that you can check if a provider is present ahead of time
checkArgument(contains(allKeys, provider), "provider %s not in supported list: %s", provider, allKeys);
@@ -146,9 +144,9 @@ public class MainApp {
// that tested to work with java, which tends to be Ubuntu or CentOS
TemplateBuilder templateBuilder = compute.templateBuilder();
- if (providerIsGCE)
+ if (providerIsGCE) {
templateBuilder.osFamily(OsFamily.CENTOS);
-
+ }
// If you want to up the ram and leave everything default, you can
// just tweak minRam
if (minRam != null)
@@ -160,12 +158,11 @@ public class MainApp {
Statement bootInstructions = AdminAccess.standard();
// to run commands as root, we use the runScript option in the template.
- if(provider.equalsIgnoreCase("virtualbox"))
- templateBuilder.options(overrideLoginUser(loginUser).runScript(bootInstructions));
- else
- templateBuilder.options(runScript(bootInstructions));
-
- NodeMetadata node = getOnlyElement(compute.createNodesInGroup(groupName, 1, templateBuilder.build()));
+ templateBuilder.options(runScript(bootInstructions));
+
+ Template template = templateBuilder.build();
+
+ NodeMetadata node = getOnlyElement(compute.createNodesInGroup(groupName, 1, template));
System.out.printf("<< node %s: %s%n", node.getId(),
concat(node.getPrivateAddresses(), node.getPublicAddresses()));
http://git-wip-us.apache.org/repos/asf/jclouds-examples/blob/549fba2c/google/pom.xml
----------------------------------------------------------------------
diff --git a/google/pom.xml b/google/pom.xml
index af32cb6..b9aaa29 100644
--- a/google/pom.xml
+++ b/google/pom.xml
@@ -26,7 +26,7 @@
<name>google-examples</name>
<properties>
- <jclouds.version>1.8.0</jclouds.version>
+ <jclouds.version>1.9.0</jclouds.version>
</properties>
<dependencies>
http://git-wip-us.apache.org/repos/asf/jclouds-examples/blob/549fba2c/openstack/pom.xml
----------------------------------------------------------------------
diff --git a/openstack/pom.xml b/openstack/pom.xml
index 4ccb2bc..4811ed1 100644
--- a/openstack/pom.xml
+++ b/openstack/pom.xml
@@ -26,7 +26,7 @@
<name>openstack-examples</name>
<properties>
- <jclouds.version>1.8.0</jclouds.version>
+ <jclouds.version>1.9.0</jclouds.version>
</properties>
<dependencies>
@@ -53,11 +53,6 @@
<version>${jclouds.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>openstack-swift</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
<groupId>org.apache.jclouds.api</groupId>
<artifactId>openstack-cinder</artifactId>
<version>${jclouds.version}</version>
http://git-wip-us.apache.org/repos/asf/jclouds-examples/blob/549fba2c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 5b2941f..8610ec9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.jclouds.examples</groupId>
<artifactId>jclouds-examples</artifactId>
- <version>1.8.0</version>
+ <version>1.9.0</version>
<packaging>pom</packaging>
<name>jclouds examples</name>
@@ -33,7 +33,7 @@
</scm>
<properties>
- <jclouds.version>1.8.0</jclouds.version>
+ <jclouds.version>1.9.0</jclouds.version>
</properties>
<repositories>