This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.rackspace; | |
import java.lang.Thread.UncaughtExceptionHandler; | |
import org.jclouds.ContextBuilder; | |
import org.jclouds.compute.ComputeServiceContext; | |
import org.jclouds.compute.domain.NodeMetadata; | |
import org.jclouds.compute.domain.NodeMetadata.Status; | |
import org.jclouds.compute.domain.NodeMetadataBuilder; | |
import org.jclouds.enterprise.config.EnterpriseConfigurationModule; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir jclouds-test | |
$ cd jcloud-test | |
$ curl -o lein.sh https://raw.github.com/technomancy/leiningen/stable/bin/lein | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 9905 100 9905 0 0 13005 0 --:--:-- --:--:-- --:--:-- 31444 | |
$ chmod u+x lein.sh | |
$ echo '(defproject deps "1" :dependencies [[org.jclouds/jclouds-all "1.5.1"] [org.jclouds.driver/jclouds-sshj "1.5.1"]])' > project.clj | |
$ ./lein.sh deps | |
<output omitted> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Set; | |
import java.lang.Thread.UncaughtExceptionHandler; | |
import org.jclouds.ContextBuilder; | |
import org.jclouds.compute.ComputeService; | |
import org.jclouds.compute.ComputeServiceContext; | |
import org.jclouds.compute.domain.ComputeMetadata; | |
public class JCloudsTest { | |
private ComputeService compute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ pwd | |
/Users/phymata/test/jclouds-test | |
$ ls | |
JCloudsTest.java lein.sh lib project.clj | |
$ javac -cp ".:lib/*" JCloudsTest.java | |
$ ls | |
JCloudsTest$1.class JCloudsTest.class JCloudsTest.java lein.sh lib project.clj | |
$ java -cp ".:lib/*" JCloudsTest | |
Calling listNodes... | |
Total Number of Nodes = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ TOKEN=`curl -s -X POST https://identity.api.rackspacecloud.com/v2.0/tokens -d '{"auth": {"passwordCredentials": {"username":"MY_USERNAME", "password":"MY_PASSWORD"}}}' -H "Content-type: application/json" | python -c 'import json,sys; response=json.loads(sys.stdin.read()); print response["access"]["token"]["id"]'` | |
$ echo $TOKEN | |
9d1dc8da-d306-4e39-b9c2-f39a127341f1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.Thread.UncaughtExceptionHandler; | |
import java.util.Set; | |
import org.jclouds.ContextBuilder; | |
import org.jclouds.compute.ComputeService; | |
import org.jclouds.compute.ComputeServiceContext; | |
import org.jclouds.compute.domain.ComputeMetadata; | |
import org.jclouds.logging.slf4j.config.SLF4JLoggingModule; | |
import com.google.common.collect.ImmutableSet; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ javac -cp ".:lib/*" JCloudsLoggingExample.java | |
$ java -cp ".:lib/*" JCloudsLoggingExample | |
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". | |
SLF4J: Defaulting to no-operation (NOP) logger implementation | |
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. | |
Calling listNodes... | |
Total Number of Nodes = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<configuration scan="false"> | |
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | |
<encoder> | |
<pattern>- %m%n</pattern> | |
</encoder> | |
</appender> | |
<logger name="jclouds.wire"> | |
<level value="DEBUG" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ pwd | |
/Users/phymata/test/jclouds-test | |
$ ls | |
JCloudsLoggingExample$1.class JCloudsTest.java | |
JCloudsLoggingExample.class lein.sh | |
JCloudsLoggingExample.java lib | |
JCloudsTest$1.class logback.xml | |
JCloudsTest.class project.clj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17:00:49,672 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy] | |
17:00:49,676 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml] | |
17:00:49,676 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/Users/ever5257/dev/everett-toews/jclouds/apis/openstack-keystone/target/test-classes/logback.xml] | |
17:00:49,682 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath. | |
17:00:49,682 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [file:/Users/ever5257/dev/everett-toews/jclouds/apis/openstack-keystone/target/test-classes/logback.xml] | |
17:00:49,682 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [file:/Users/ever5257/dev/everett-toews/jclouds/compute/target/test-classes/logback.xml] | |
17:00:49,770 |-INFO in ch.qos.logback.classic.joran.ac |
OlderNewer