- maven repo
- brooklyn repository (jboss, etc)
- git projects (anonymous http, with history; and showing URL - jclouds-examples, brooklyn, whirr)
- binaries
- whirr
- brooklyn
- this doc
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
@Test | |
public void createVm() { | |
String groupId = "mygroup-"+System.getProperty("user.name")+"-"+UUID.randomUUID().toString(); | |
Properties properties = new Properties(); | |
properties.setProperty(Constants.PROPERTY_PROVIDER, "aws-ec2"); | |
properties.setProperty(Constants.PROPERTY_IDENTITY, identity); | |
properties.setProperty(Constants.PROPERTY_CREDENTIAL, credential); | |
properties.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, Boolean.toString(true)); | |
properties.setProperty(Constants.PROPERTY_RELAX_HOSTNAME, Boolean.toString(true)); |
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
{ "app": { | |
"name": "MyWebCluster", | |
"entities": [ | |
{ "name": "web", | |
"type": "ControlledDynamicWebAppCluster", | |
"config": { | |
"war": "classpath://hello-world-webapp.war", | |
"httpPort": "8080+", | |
"jvmOpts": { | |
"brooklyn.example.db.url": { "source": { "entity": "mysql", "sensor": "url" } } |
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
<app name="MyWebCluster"> | |
<entity type="ControlledDynamicWebAppCluster" name="web"> | |
<config name="war" value="classpath://hello-world-webapp.war"/> | |
<config name="httpPort" value="8080+"/> | |
<config name="jvmOpts" type="map"> | |
<field name="brooklyn.example.db.url"> | |
<source entity="mysql" sensor="url"/> | |
</field> | |
</config> | |
<policy type="Resizer"> |
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
#!/bin/bash | |
export DIRS="" | |
export ARGS="-o clean install -DskipTests" | |
if [[ -z $1 || $1 = "-h" || $1 == "--help" ]] ; then | |
echo | |
echo "MVNF: a simple script for building multiple maven directories" | |
echo | |
echo "usage: mvnf [ -x \"install -Dxxx\" ] dir1 [ dir2 [ ... ]]" | |
echo | |
echo "This will do a maven build in each directory specified, in order, " |
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 org.apache.commons.lang.builder.EqualsBuilder; | |
import org.apache.commons.lang.builder.HashCodeBuilder; | |
public class ReflectiveEquals { | |
static class Fast { | |
public int a = 1; | |
public int b = 2; | |
public String c = "foo"; | |
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 Map<? extends NodeMetadata, ExecResponse> runScriptOnNodesMatching(ClusterSpec spec, | |
Predicate<NodeMetadata> condition, Statement statement) throws IOException, RunScriptOnNodesException { | |
return runScriptOnNodesMatching(spec, condition, statement, null); | |
} | |
public Map<? extends NodeMetadata, ExecResponse> runScriptOnNodesMatching(ClusterSpec spec, | |
Predicate<NodeMetadata> condition, Statement statement, RunScriptOptions options) | |
throws IOException, RunScriptOnNodesException { | |
Credentials credentials = new Credentials(spec.getClusterUser(), spec.getPrivateKey()); | |
if (options==null) |
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
interface Function2 { int apply(int a, int b); } | |
int factorial(int n) { return applyFromOneToN(new Function2() { int apply(int a, int b) { return a*b; } }, n); } |
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 urlBase = "https://HOSTNAME:8443"; | |
String subUrl = "/"; | |
String password = "PASSWORD"; | |
org.apache.http.client.HttpClient c = new brooklyn.util.http.HttpTool.HttpClientBuilder().https(true).trustAll() | |
.uri(urlBase) | |
.credentials(new org.apache.http.auth.UsernamePasswordCredentials( | |
"admin", password)).build(); | |
brooklyn.util.http.HttpToolResponse r = brooklyn.util.http.HttpTool.httpGet(c, java.net.URI.create( | |
urlBase+subUrl), null); |
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
brooklyn.catalog: | |
version: 0.1 | |
description: Sample VM with a demo script | |
name: Alex-AWS-VM-1 | |
location: | |
jclouds:aws-ec2: | |
region: eu-west-1 | |
osFamily: ubuntu |