Skip to content

Instantly share code, notes, and snippets.

@ahgittin
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahgittin/31eded4ae259294a8d8a to your computer and use it in GitHub Desktop.
Save ahgittin/31eded4ae259294a8d8a to your computer and use it in GitHub Desktop.
Brooklyn GUI groovy snippets
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);
System.out.println("RESULT: "+r.getResponseCode() + "\n\n" + r.getContentAsString());
return r;
String entityId = "TODO";
String command = "echo hi";
brooklyn.entity.basic.Entities.submit((brooklyn.entity.Entity)mgmt.lookup(entityId), brooklyn.entity.software.SshEffectorTasks.ssh(
command)).block().getStdout();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment