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
$ docker-compose up --force-recreate | |
Creating network "pythonwebapp_default" with the default driver | |
Creating network "pythonwebapp_backend" with the default driver | |
Creating pythonwebapp_app_1 | |
Creating pythonwebapp_lb | |
Creating pythonwebapp_db_data | |
Creating pythonwebapp_db | |
Attaching to pythonwebapp_app_1, pythonwebapp_lb, pythonwebapp_db_data, pythonwebapp_db | |
←[36mapp_1 | ←[0m[2016-03-11 20:58:40 +0000] [1] [INFO] Starting gunicorn 19.4.5 | |
←[36mapp_1 | ←[0m[2016-03-11 20:58:40 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (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
public void testCreateWith100Continue() throws Exception { | |
MockWebServer server = mockOpenStackServer(); | |
server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json")))); | |
server.enqueue(new MockResponse() | |
.setStatus("HTTP/1.1 100 Continue").clearHeaders()); | |
server.enqueue(addCommonHeaders(new MockResponse() | |
.setResponseCode(201) | |
.addHeader("Etag", "4d8f51d3fe3900efc6e395be48030d6d") | |
.addHeader("Date", "Tue, 26 Jan 2016 16:56:25 GMT") | |
.addHeader("Last-Modified", "Tue, 26 Jan 2016 16:56:25 GMT") |
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
ul { | |
margin:6px 0 0 12px; | |
padding:0; | |
} | |
ul li { | |
list-style-type:square; | |
margin:0 0 8px; | |
padding:0; | |
} |
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
String endpoint = "http://127.0.0.1:5000/v2.0/"; | |
Iterable<Module> modules = ImmutableSet.<Module> of( | |
new SshjSshClientModule(), | |
new SLF4JLoggingModule()); | |
ComputeServiceContext context = ContextBuilder.newBuilder(provider) | |
.credentials(user, password) | |
.endpoint(endpoint) | |
.modules(modules) |
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
gedit src/main/java/org/jclouds/workshop/JCloudsWorkshop.java | |
javac -classpath "lib/*:src/main/java/:src/main/resources/" src/main/java/org/jclouds/workshop/*.java | |
java -classpath "lib/*:src/main/java/:src/main/resources/" org.jclouds.workshop.JCloudsWorkshop |
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 -p workshop/src/main/java/org/jclouds/workshop | |
mkdir workshop/src/main/resources | |
cd workshop | |
gedit pom.xml | |
mvn dependency:copy-dependencies "-DoutputDirectory=./lib" |
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
./start.sh | |
source devstack/openrc | |
nova image-list | |
nova list | |
nova delete <id> | |
nova delete <name> |
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 org.jclouds.workshop; | |
import static com.google.common.base.Charsets.UTF_8; | |
import static java.util.concurrent.TimeUnit.SECONDS; | |
import static org.jclouds.compute.predicates.NodePredicates.inGroup; | |
import static org.jclouds.scriptbuilder.domain.Statements.exec; | |
import static org.jclouds.util.Predicates2.retry; | |
import java.io.BufferedReader; | |
import java.io.Closeable; |
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
System.out.println("ENTER to delete node"); | |
s.nextLine(); | |
try { | |
Set<? extends NodeMetadata> servers = compute.destroyNodesMatching(inGroup("jclouds-workshop")); | |
for (NodeMetadata nodeMetadata: servers) { | |
System.out.println(" " + nodeMetadata); | |
} | |
} |
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
try { | |
String provider = compute.getContext().toString().contains("rackspace") ? | |
"Rackspace CloudServers" : "Openstack Nova"; | |
System.out.println("Provider: " + provider); | |
System.out.println("Credentials: " + node.getCredentials()); | |
if (node.getCredentials().getOptionalPrivateKey().isPresent()) { | |
System.out.println(" Login: ssh -i jclouds.pem " + node.getCredentials().getUser() + "@" + address); | |
} |
NewerOlder