Last active
August 29, 2015 14:22
-
-
Save ahgittin/31eded4ae259294a8d8a to your computer and use it in GitHub Desktop.
Brooklyn GUI groovy snippets
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); | |
System.out.println("RESULT: "+r.getResponseCode() + "\n\n" + r.getContentAsString()); | |
return r; |
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 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