You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2015/11/27 10:49:49 UTC

[1/9] incubator-brooklyn git commit: Reverting incorrect diagnosis for Parse Exception (#1060)

Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master b03f77e92 -> 1337affeb


Reverting incorrect diagnosis for Parse Exception (#1060)


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/fd786359
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/fd786359
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/fd786359

Branch: refs/heads/master
Commit: fd786359a4a2a1468ac9e981cb4a7c1d46803840
Parents: 9a9e780
Author: Mark McKenna <m4...@gmail.com>
Authored: Tue Nov 24 19:35:20 2015 +0000
Committer: Mark McKenna <m4...@gmail.com>
Committed: Tue Nov 24 19:35:20 2015 +0000

----------------------------------------------------------------------
 usage/rest-client/pom.xml | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/fd786359/usage/rest-client/pom.xml
----------------------------------------------------------------------
diff --git a/usage/rest-client/pom.xml b/usage/rest-client/pom.xml
index d518d43..389ffdd 100644
--- a/usage/rest-client/pom.xml
+++ b/usage/rest-client/pom.xml
@@ -101,11 +101,7 @@
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>jaxrs-api</artifactId>
         </dependency-->
-        <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-jaxrs</artifactId>
-        </dependency>
-
+        
         <dependency>
             <groupId>org.testng</groupId>
             <artifactId>testng</artifactId>


[5/9] incubator-brooklyn git commit: Add documentation and additional tests to SshToolAbstractIntegrationTest

Posted by he...@apache.org.
Add documentation and additional tests to SshToolAbstractIntegrationTest


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/0f2061ca
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/0f2061ca
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/0f2061ca

Branch: refs/heads/master
Commit: 0f2061caa02d59353d16b4b9c93ed0a186e1f9c5
Parents: b03f77e
Author: Valentin Aitken <va...@cloudsoftcorp.com>
Authored: Thu Nov 26 23:56:10 2015 +0200
Committer: Valentin Aitken <va...@cloudsoftcorp.com>
Committed: Fri Nov 27 01:41:16 2015 +0200

----------------------------------------------------------------------
 .../ssh/SshToolAbstractIntegrationTest.java     | 79 +++++++++++++++-----
 1 file changed, 61 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/0f2061ca/core/src/test/java/org/apache/brooklyn/util/core/internal/ssh/SshToolAbstractIntegrationTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/util/core/internal/ssh/SshToolAbstractIntegrationTest.java b/core/src/test/java/org/apache/brooklyn/util/core/internal/ssh/SshToolAbstractIntegrationTest.java
index 07ca008..131caa3 100644
--- a/core/src/test/java/org/apache/brooklyn/util/core/internal/ssh/SshToolAbstractIntegrationTest.java
+++ b/core/src/test/java/org/apache/brooklyn/util/core/internal/ssh/SshToolAbstractIntegrationTest.java
@@ -26,6 +26,7 @@ import static org.testng.Assert.fail;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.Calendar;
 import java.util.LinkedHashMap;
@@ -33,9 +34,6 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.brooklyn.util.collections.MutableMap;
-import org.apache.brooklyn.util.core.internal.ssh.ShellTool;
-import org.apache.brooklyn.util.core.internal.ssh.SshException;
-import org.apache.brooklyn.util.core.internal.ssh.SshTool;
 import org.apache.brooklyn.util.exceptions.Exceptions;
 import org.apache.brooklyn.util.os.Os;
 import org.apache.brooklyn.util.text.Identifiers;
@@ -53,17 +51,25 @@ import com.google.common.io.Files;
 
 /**
  * Test the operation of the {@link SshTool} utility class; to be extended to test concrete implementations.
- * 
- * Requires keys set up, e.g. running:
- * 
- * <pre>
- * cd ~/.ssh
- * ssh-keygen
- * id_rsa_with_passphrase
- * mypassphrase
- * mypassphrase
- * </pre>
- * 
+ * <p>
+ * The test <strong>assumes that</strong> you have configured keys for accessing localhost with the following keys:
+ * <ul>
+ * <li>passwordless ~/.ssh/id_rsa</li>
+ * <li>~/.ssh/id_rsa_with_passphrase with password mypassphrase </li>
+ * </ul>
+ *
+ * <br>
+ * Paths for the keys above can override the from Java System Properties.
+ * Here are the system properties you can override:
+ *
+ * <ul>
+ * <li>brooklyn.sshPrivateKeyWithPassphrase by default it is ~/.ssh/id_rsa_with_passphrase<br>
+ * <li>brooklyn.sshPrivateKeyPassphrase     by default it is mypassphrase<br>
+ * <li>brooklyn.sshDefaultPrivateKeyFile    by default it is ~/.ssh/id_rsa<br>
+ * </ul>
+ *
+ * Note that {@link #testSshKeyWithNoKeyDefaultsToIdrsa} requires a passwordless ~/.ssh/id_rsa
+ * </p>
  */
 public abstract class SshToolAbstractIntegrationTest extends ShellToolAbstractTest {
 
@@ -74,8 +80,9 @@ public abstract class SshToolAbstractIntegrationTest extends ShellToolAbstractTe
 
     // TODO No tests for retry logic and exception handing yet
 
-    public static final String SSH_KEY_WITH_PASSPHRASE = System.getProperty("sshPrivateKeyWithPassphrase", "~/.ssh/id_rsa_with_passphrase");
-    public static final String SSH_PASSPHRASE = System.getProperty("sshPrivateKeyPassphrase", "mypassphrase");
+    public static final String SSH_KEY_WITH_PASSPHRASE = System.getProperty("brooklyn.sshPrivateKeyWithPassphrase", "~/.ssh/id_rsa_with_passphrase");
+    public static final String SSH_PASSPHRASE = System.getProperty("brooklyn.sshPrivateKeyPassphrase", "mypassphrase");
+    public static final String SSH_DEFAULT_KEYFILE = System.getProperty("brooklyn.sshDefaultPrivateKeyFile", "~/.ssh/id_rsa");
 
     protected String remoteFilePath;
 
@@ -85,7 +92,7 @@ public abstract class SshToolAbstractIntegrationTest extends ShellToolAbstractTe
 
     @Override
     protected SshTool newTool() {
-        return newTool(ImmutableMap.of("host", "localhost", "privateKeyFile", "~/.ssh/id_rsa"));
+        return newTool(ImmutableMap.of("host", "localhost", "privateKeyFile", SSH_DEFAULT_KEYFILE));
     }
     
     @Override
@@ -264,8 +271,44 @@ public abstract class SshToolAbstractIntegrationTest extends ShellToolAbstractTe
     }
 
     @Test(groups = {"Integration"})
+    public void testSshKeyWithNoKeyDefaultsToIdrsa() throws Exception {
+        final SshTool localtool = newTool(ImmutableMap.<String,Object>builder()
+                .put(SshTool.PROP_HOST.getName(), "localhost")
+                .build());
+        tools.add(localtool);
+        localtool.connect();
+        assertEquals(localtool.execScript(MutableMap.<String,Object>of(), ImmutableList.of("date")), 0);
+    }
+
+    @Test(groups = {"Integration"})
+    public void testSshKeyWithPrivateKeyData() throws Exception {
+        final SshTool localtool = newTool(ImmutableMap.<String,Object>builder()
+                .put(SshTool.PROP_HOST.getName(), "localhost")
+                .put(SshTool.PROP_PRIVATE_KEY_DATA.getName(), new String(Files.toByteArray(new File(Os.tidyPath(SSH_DEFAULT_KEYFILE))), StandardCharsets.UTF_8))
+                .build());
+        localtool.connect();
+
+        assertEquals(localtool.execScript(MutableMap.<String,Object>of(), ImmutableList.of("date")), 0);
+
+        // Also needs the negative test to prove that we're really using an ssh-key with a passphrase
+        try {
+            final SshTool localtool2 = newTool(ImmutableMap.<String,Object>builder()
+                    .put(SshTool.PROP_HOST.getName(), "localhost")
+                    .put(SshTool.PROP_PRIVATE_KEY_DATA.getName(), "invalid data")
+                    .build());
+            localtool2.connect();
+            localtool2.execScript(MutableMap.<String,Object>of(), ImmutableList.of("date"));
+            // Notice that executing a command may succeed for SshCliToolIntegrationTest.testSshKeyWithPrivateKeyData if you already have valid keys loaded in the ssh-agent
+            fail();
+        } catch (Exception e) {
+            SshException se = Exceptions.getFirstThrowableOfType(e, SshException.class);
+            if (se == null) throw e;
+        }
+    }
+
+    @Test(groups = {"Integration"})
     public void testConnectWithInvalidUserThrowsException() throws Exception {
-        final ShellTool localtool = newTool(ImmutableMap.of("user", "wronguser", "host", "localhost", "privateKeyFile", "~/.ssh/id_rsa"));
+        final ShellTool localtool = newTool(ImmutableMap.of("user", "wronguser", "host", "localhost", "privateKeyFile", SSH_DEFAULT_KEYFILE));
         tools.add(localtool);
         try {
             connect(localtool);


[2/9] incubator-brooklyn git commit: Set ApiOperaion response class to String

Posted by he...@apache.org.
Set ApiOperaion response class to String

 Reason :: Using javax.ws.rs.core.Response is invalid


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/ad6e8c86
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/ad6e8c86
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/ad6e8c86

Branch: refs/heads/master
Commit: ad6e8c8637361d07d0f0226807763c0d92bdfe65
Parents: fd78635
Author: Mark McKenna <m4...@gmail.com>
Authored: Tue Nov 24 19:40:20 2015 +0000
Committer: Mark McKenna <m4...@gmail.com>
Committed: Wed Nov 25 11:36:15 2015 +0000

----------------------------------------------------------------------
 .../src/main/java/org/apache/brooklyn/rest/api/CatalogApi.java    | 2 +-
 .../apache/brooklyn/rest/client/BrooklynApiRestClientTest.java    | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/ad6e8c86/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/CatalogApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/CatalogApi.java b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/CatalogApi.java
index bd93fb2..cf18b89 100644
--- a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/CatalogApi.java
+++ b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/CatalogApi.java
@@ -65,7 +65,7 @@ public interface CatalogApi {
     @Consumes
     @POST
     @ApiOperation(value = "Add a catalog item (e.g. new type of entity, policy or location) by uploading YAML descriptor "
-        + "Return value is map of ID to CatalogItemSummary, with code 201 CREATED.", response = Response.class)
+        + "Return value is map of ID to CatalogItemSummary, with code 201 CREATED.", response = String.class)
     public Response create(
             @ApiParam(name = "yaml", value = "YAML descriptor of catalog item", required = true)
             @Valid String yaml);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/ad6e8c86/usage/rest-client/src/test/java/org/apache/brooklyn/rest/client/BrooklynApiRestClientTest.java
----------------------------------------------------------------------
diff --git a/usage/rest-client/src/test/java/org/apache/brooklyn/rest/client/BrooklynApiRestClientTest.java b/usage/rest-client/src/test/java/org/apache/brooklyn/rest/client/BrooklynApiRestClientTest.java
index da5bac5..da3966f 100644
--- a/usage/rest-client/src/test/java/org/apache/brooklyn/rest/client/BrooklynApiRestClientTest.java
+++ b/usage/rest-client/src/test/java/org/apache/brooklyn/rest/client/BrooklynApiRestClientTest.java
@@ -105,7 +105,8 @@ public class BrooklynApiRestClientTest {
 
     public void testCatalogCreate()throws Exception {
         final Response response = api.getCatalogApi().create(getFileContentsAsString("catalog/test-catalog.bom"));
-        Asserts.assertEquals(response.getStatus(),201);
+        Asserts.assertEquals(response.getStatus(), 201);
+        Asserts.assertStringContains(String.valueOf(response.getEntity()), "simple-tomcat:1.0");
     }
 
 


[6/9] incubator-brooklyn git commit: This closes #1068

Posted by he...@apache.org.
This closes #1068


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/0aef0c73
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/0aef0c73
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/0aef0c73

Branch: refs/heads/master
Commit: 0aef0c73be3fee4136a51665423ea65e35eb1be8
Parents: b03f77e ad6e8c8
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Fri Nov 27 09:22:16 2015 +0000
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Fri Nov 27 09:22:16 2015 +0000

----------------------------------------------------------------------
 .../src/main/java/org/apache/brooklyn/rest/api/CatalogApi.java | 2 +-
 usage/rest-client/pom.xml                                      | 6 +-----
 .../apache/brooklyn/rest/client/BrooklynApiRestClientTest.java | 3 ++-
 3 files changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------



[8/9] incubator-brooklyn git commit: This closes #1072

Posted by he...@apache.org.
This closes #1072


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/0832db49
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/0832db49
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/0832db49

Branch: refs/heads/master
Commit: 0832db49e5e8deb42df7c3ea344010d04f095b0b
Parents: fdffad6 c9608c7
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Fri Nov 27 09:38:50 2015 +0000
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Fri Nov 27 09:38:50 2015 +0000

----------------------------------------------------------------------
 docs/guide/ops/cli-reference.md                 | 201 -------------------
 docs/guide/ops/gui/_my-web-cluster.yaml         |  23 +++
 docs/guide/ops/gui/_my-web-cluster2.yaml        |  31 +++
 docs/guide/ops/gui/blueprints.md                |  68 +++++++
 ...cation-catalog-web-cluster-with-db-large.png | Bin 0 -> 165148 bytes
 ...talog-web-cluster-with-db-location-large.png | Bin 0 -> 152721 bytes
 ...ion-catalog-web-cluster-with-db-location.png | Bin 0 -> 86425 bytes
 ...-application-catalog-web-cluster-with-db.png | Bin 0 -> 70109 bytes
 .../images/add-application-modal-yaml-large.png | Bin 0 -> 124297 bytes
 .../gui/images/add-application-modal-yaml.png   | Bin 0 -> 55183 bytes
 .../ops/gui/images/home-app-starting-large.png  | Bin 0 -> 490707 bytes
 docs/guide/ops/gui/images/home-app-starting.png | Bin 0 -> 188754 bytes
 .../gui/images/my-db-activities-step1-large.png | Bin 0 -> 99671 bytes
 .../ops/gui/images/my-db-activities-step1.png   | Bin 0 -> 57813 bytes
 .../gui/images/my-db-activities-step2-large.png | Bin 0 -> 176900 bytes
 .../ops/gui/images/my-db-activities-step2.png   | Bin 0 -> 97061 bytes
 .../gui/images/my-db-activities-step3-large.png | Bin 0 -> 162986 bytes
 .../ops/gui/images/my-db-activities-step3.png   | Bin 0 -> 84365 bytes
 .../ops/gui/images/my-web-cluster-starting.png  | Bin 0 -> 32948 bytes
 .../my-web-cluster-stop-confirm-large.png       | Bin 0 -> 148155 bytes
 .../gui/images/my-web-cluster-stop-confirm.png  | Bin 0 -> 79280 bytes
 docs/guide/ops/gui/images/my-web-large.png      | Bin 0 -> 104519 bytes
 .../ops/gui/images/my-web-summary-large.png     | Bin 0 -> 178785 bytes
 docs/guide/ops/gui/images/my-web-summary.png    | Bin 0 -> 80583 bytes
 .../my-web-validating-app-endpoint-large.png    | Bin 0 -> 123007 bytes
 .../images/my-web-validating-app-endpoint.png   | Bin 0 -> 68969 bytes
 docs/guide/ops/gui/images/my-web.png            | Bin 0 -> 58849 bytes
 docs/guide/ops/gui/index.md                     |  11 +
 docs/guide/ops/gui/managing.md                  |  70 +++++++
 docs/guide/ops/gui/policies.md                  |  49 +++++
 docs/guide/ops/gui/running.md                   |  50 +++++
 docs/guide/ops/index.md                         |   3 +-
 docs/guide/ops/server-cli-reference.md          | 201 +++++++++++++++++++
 33 files changed, 505 insertions(+), 202 deletions(-)
----------------------------------------------------------------------



[7/9] incubator-brooklyn git commit: This closes #1074

Posted by he...@apache.org.
This closes #1074


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/fdffad6f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/fdffad6f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/fdffad6f

Branch: refs/heads/master
Commit: fdffad6f25c73d20a6aa588a2537865e3c16f749
Parents: 0aef0c7 0f2061c
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Fri Nov 27 09:35:49 2015 +0000
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Fri Nov 27 09:35:49 2015 +0000

----------------------------------------------------------------------
 .../ssh/SshToolAbstractIntegrationTest.java     | 79 +++++++++++++++-----
 1 file changed, 61 insertions(+), 18 deletions(-)
----------------------------------------------------------------------



[3/9] incubator-brooklyn git commit: Add an overview guide for using the web based GUI to the Operations Guide.

Posted by he...@apache.org.
Add an overview guide for using the web based GUI to the Operations Guide.

With the introduction of a CLI tool for Brooklyn, the Getting Started Guide will
be updated to document using the CLI instead of the GUI.  This change is to copy
the content related to using the existing web based GUI from the Getting Started
Guide to the Operations Guide.  Incorporates some re-wording and changing of links
to reflect the new location.


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/c9608c77
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/c9608c77
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/c9608c77

Branch: refs/heads/master
Commit: c9608c77d6a42b3cd375925137b5a235421b52d9
Parents: 11b08da
Author: lloyddave <da...@lloyds.org.uk>
Authored: Thu Nov 26 10:32:56 2015 +0000
Committer: lloyddave <da...@lloyds.org.uk>
Committed: Thu Nov 26 10:32:56 2015 +0000

----------------------------------------------------------------------
 docs/guide/ops/cli-reference.md                 | 201 -------------------
 docs/guide/ops/gui/_my-web-cluster.yaml         |  23 +++
 docs/guide/ops/gui/_my-web-cluster2.yaml        |  31 +++
 docs/guide/ops/gui/blueprints.md                |  68 +++++++
 ...cation-catalog-web-cluster-with-db-large.png | Bin 0 -> 165148 bytes
 ...talog-web-cluster-with-db-location-large.png | Bin 0 -> 152721 bytes
 ...ion-catalog-web-cluster-with-db-location.png | Bin 0 -> 86425 bytes
 ...-application-catalog-web-cluster-with-db.png | Bin 0 -> 70109 bytes
 .../images/add-application-modal-yaml-large.png | Bin 0 -> 124297 bytes
 .../gui/images/add-application-modal-yaml.png   | Bin 0 -> 55183 bytes
 .../ops/gui/images/home-app-starting-large.png  | Bin 0 -> 490707 bytes
 docs/guide/ops/gui/images/home-app-starting.png | Bin 0 -> 188754 bytes
 .../gui/images/my-db-activities-step1-large.png | Bin 0 -> 99671 bytes
 .../ops/gui/images/my-db-activities-step1.png   | Bin 0 -> 57813 bytes
 .../gui/images/my-db-activities-step2-large.png | Bin 0 -> 176900 bytes
 .../ops/gui/images/my-db-activities-step2.png   | Bin 0 -> 97061 bytes
 .../gui/images/my-db-activities-step3-large.png | Bin 0 -> 162986 bytes
 .../ops/gui/images/my-db-activities-step3.png   | Bin 0 -> 84365 bytes
 .../ops/gui/images/my-web-cluster-starting.png  | Bin 0 -> 32948 bytes
 .../my-web-cluster-stop-confirm-large.png       | Bin 0 -> 148155 bytes
 .../gui/images/my-web-cluster-stop-confirm.png  | Bin 0 -> 79280 bytes
 docs/guide/ops/gui/images/my-web-large.png      | Bin 0 -> 104519 bytes
 .../ops/gui/images/my-web-summary-large.png     | Bin 0 -> 178785 bytes
 docs/guide/ops/gui/images/my-web-summary.png    | Bin 0 -> 80583 bytes
 .../my-web-validating-app-endpoint-large.png    | Bin 0 -> 123007 bytes
 .../images/my-web-validating-app-endpoint.png   | Bin 0 -> 68969 bytes
 docs/guide/ops/gui/images/my-web.png            | Bin 0 -> 58849 bytes
 docs/guide/ops/gui/index.md                     |  11 +
 docs/guide/ops/gui/managing.md                  |  70 +++++++
 docs/guide/ops/gui/policies.md                  |  49 +++++
 docs/guide/ops/gui/running.md                   |  50 +++++
 docs/guide/ops/index.md                         |   3 +-
 docs/guide/ops/server-cli-reference.md          | 201 +++++++++++++++++++
 33 files changed, 505 insertions(+), 202 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/cli-reference.md
----------------------------------------------------------------------
diff --git a/docs/guide/ops/cli-reference.md b/docs/guide/ops/cli-reference.md
deleted file mode 100644
index c4fd929..0000000
--- a/docs/guide/ops/cli-reference.md
+++ /dev/null
@@ -1,201 +0,0 @@
----
-title: CLI Reference
-layout: website-normal
----
-
-## Launch command
-
-To launch Brooklyn, from the directory where Brooklyn is unpacked, run:
-
-{% highlight bash %}
-% nohup bin/brooklyn launch > /dev/null 2&>1 &
-{% endhighlight %}
-
-With no configuration, this will launch the Brooklyn web console and REST API on [`http://localhost:8081/`](http://localhost:8081/).
-No password is set, but the server is listening only on the loopback network interface for security.
-Once [security is configured](brooklyn_properties.html), Brooklyn will listen on all network interfaces by default.
-By default, Brooklyn will write log messages at the INFO level or above to `brooklyn.info.log` and messgages at the
-DEBUG level or above to `brooklyn.debug.log`. Redirecting the output to `/dev/null` prevents the default console output
-being written to `nohup.out`.
-
-You may wish to [add Brooklyn to your path](#path-setup);
-assuming you've done this, to get information the supported CLI options 
-at any time, just run `brooklyn help`:
-
-{% highlight bash %}
-% bin/brooklyn help
-
-usage: brooklyn [(-q | --quiet)] [(-v | --verbose)] <command> [<args>]
-
-The most commonly used brooklyn commands are:
-    help     Display help information about brooklyn
-    info     Display information about brooklyn
-    launch   Starts a brooklyn application. Note that a BROOKLYN_CLASSPATH environment variable needs to be set up beforehand to point to the user application classpath.
-
-See 'brooklyn help <command>' for more information on a specific command.
-{% endhighlight %}
-
-It is important that Brooklyn is launched with either `nohup ... &` or `... & disown`, to ensure 
-it keeps running after the shell terminates.
-
-
-### Other CLI Arguments
-
-The CLI arguments for [persistence and HA](persistence/) are described separately.
-
-
-### Path Setup
-
-In order to have easy access to the cli it is useful to configure the PATH environment 
-variable to also point to the cli's bin directory:
-
-{% highlight bash %}
-BROOKLYN_HOME=/path/to/brooklyn/
-export PATH=$PATH:$BROOKLYN_HOME/usage/dist/target/brooklyn-dist/bin/
-{% endhighlight %}
-
-
-### Memory Usage
-
-The amount of memory required by the Brooklyn process depends on the usage 
-- for example the number of entities/VMs under management.
-
-For a standard Brooklyn deployment, the defaults are to start with 256m, and to grow to 1g of memory.
-These numbers can be overridden by setting the environment variable `JAVA_OPTS` before launching
-the `brooklyn script`:
-
-    JAVA_OPTS=-Xms1g -Xmx1g -XX:MaxPermSize=256m
-
-Brooklyn stores a task history in-memory using [soft references](http://docs.oracle.com/javase/7/docs/api/java/lang/ref/SoftReference.html).
-This means that, once the task history is large, Brooklyn will continually use the maximum allocated 
-memory. It will only expunge tasks from memory when this space is required for other objects within the
-Brooklyn process.
-
-
-## Configuration
-
-### Configuration Files
-
-Brooklyn reads configuration from a variety of places. It aggregates the configuration.
-The list below shows increasing precedence (i.e. the later ones will override values
-from earlier ones, if exactly the same property is specified multiple times).
-
-1. `classpath://brooklyn/location-metadata.properties` is shipped as part of Brooklyn, containing 
-   generic metadata such as jurisdiction and geographic information about Cloud providers.        
-1. The file `~/.brooklyn/location-metadata.properties` (unless `--noGlobalBrooklynProperties` is specified).
-   This is intended to contain custom metadata about additional locations.
-1. The file `~/.brooklyn/brooklyn.properties` (unless `--noGlobalBrooklynProperties` is specified).
-1. Another properties file, if the `--localBrooklynProperties <local brooklyn.properties file>` is specified.
-1. Shell environment variables
-1. System properties, supplied with ``-D`` on the brooklyn (Java) command-line.
-
-These properties are described in more detail [here](brooklyn_properties.html).
-
-
-### Extending the Classpath
-
-The default Brooklyn directory structure includes:
-
-* `./conf/`: for configuration resources.
-* `./lib/patch/`: for Jar files containing patches.
-* `./lib/brooklyn/`: for the brooklyn libraries.
-* `./lib/dropins/`: for additional Jars.
-
-Resources added to `conf/` will be available on the classpath.
-
-A patch can be applied by adding a Jar to the `lib/patch/` directory, and restarting Brooklyn.
-All jars in this directory will be at the head of the classpath.
-
-Additional Jars should be added to `lib/dropins/`, prior to starting Brooklyn. These jars will 
-be at the end of the classpath.
-
-The initial classpath, as set in the `brooklyn` script, is:
-
-    conf:lib/patch/*:lib/brooklyn/*:lib/dropins/*
-
-Additional entries can be added at the head of the classpath by setting the environment variable 
-`BROOKLYN_CLASSPATH` before running the `brooklyn` script. 
-
-
-### Replacing the web-console
-
-*Work in progress.*
-
-The Brooklyn web-console is loaded from the classpath as the resource `classpath://brooklyn.war`.
-
-To replace this, an alternative WAR with that name can be added at the head of the classpath.
-However, this approach is likely to change in a future release - consider this feature as "beta".
-
-
-## Cloud Explorer
-
-The `brooklyn` command line tool includes support for querying (and managing) cloud
-compute resources and blob-store resources. 
-
-For example, `brooklyn cloud-compute list-instances --location aws-ec2:eu-west-1`
-will use the AWS credentials from `brooklyn.properties` and list the VM instances
-running in the given EC2 region.
-
-Use `brooklyn help` and `brooklyn help cloud-compute` to find out more information.
-
-This functionality is not intended as a generic cloud management CLI, but instead 
-solves specific Brooklyn use-cases. The main use-case is discovering the valid 
-configuration options on a given cloud, such as for `imageId` and `hardwareId`.
-
-
-### Cloud Compute
-
-The command `brooklyn cloud-compute` has the following options:
-
-* `list-images`: lists VM images within the given cloud, which can be chosen when
-  provisioning new VMs.
-  This is useful for finding the possible values for the `imageId` configuration.
-
-* `get-image <imageId1> <imageId2> ...`: retrieves metadata about the specific images.
-
-* `list-hardware-profiles`: lists the ids and the details of the hardware profiles
-  available when provisioning. 
-  This is useful for finding the possible values for the `hardwareId` configuration.
-
-* `default-template`: retrieves metadata about the image and hardware profile that will
-  be used by Brooklyn for that location, if no additional configuration options
-  are supplied.
-
-* `list-instances`: lists the VM instances within the given cloud.
-
-* `terminate-instances <instanceId1> <instanceId2> ...`: Terminates the instances with
-  the given ids.
-
-
-### Blob Store
-
-The command `brooklyn cloud-blobstore` is used to access a given object store, such as S3
-or Swift. It has the following options:
-
-* `list-containers`: lists the containers (i.e. buckets in S3 terminology) within the 
-  given object store.
-
-* `list-container <containerName>`: lists all the blobs (i.e. objects) contained within 
-  the given container.
-
-* `blob --container <containerName> --blob <blobName>`: retrieves the given blob
-  (i.e. object), including metadata and its contents.
-
-  
-## Running from a Source Build
-
-Here is an example of the commands you might run to get the Brooklyn code, 
-compile it and launch an application:
-
-{% highlight bash %}
-git clone https://github.com/apache/incubator-brooklyn.git
-cd brooklyn
-mvn clean install -DskipTests
-BROOKLYN_HOME=$(pwd)
-export PATH=${PATH}:${BROOKLYN_HOME}/usage/dist/target/brooklyn-dist/bin/
-export BROOKLYN_CLASSPATH=${BROOKLYN_HOME}/examples/simple-web-cluster/target/classes
-nohup brooklyn launch --app brooklyn.demo.SingleWebServerExample --location localhost &
-{% endhighlight %}
-
-
-  

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/_my-web-cluster.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/_my-web-cluster.yaml b/docs/guide/ops/gui/_my-web-cluster.yaml
new file mode 100644
index 0000000..a3295b9
--- /dev/null
+++ b/docs/guide/ops/gui/_my-web-cluster.yaml
@@ -0,0 +1,23 @@
+name: My Web Cluster
+
+location:
+  jclouds:aws-ec2:
+    identity: ABCDEFGHIJKLMNOPQRST
+    credential: s3cr3tsq1rr3ls3cr3tsq1rr3ls3cr3tsq1rr3l
+
+services:
+- type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
+  name: My Web
+  id: webappcluster
+  brooklyn.config:
+    wars.root: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.6.0/brooklyn-example-hello-world-sql-webapp-0.6.0.war
+    java.sysprops:
+      brooklyn.example.db.url: >
+        $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
+        component("db").attributeWhenReady("datastore.url"),
+        "visitors", "brooklyn", "br00k11n")
+- type: org.apache.brooklyn.entity.database.mysql.MySqlNode
+  name: My DB
+  id: db
+  brooklyn.config:
+    creationScriptUrl: https://bit.ly/brooklyn-visitors-creation-script
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/_my-web-cluster2.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/_my-web-cluster2.yaml b/docs/guide/ops/gui/_my-web-cluster2.yaml
new file mode 100644
index 0000000..33723ab
--- /dev/null
+++ b/docs/guide/ops/gui/_my-web-cluster2.yaml
@@ -0,0 +1,31 @@
+name: My Web Cluster
+
+location: localhost
+
+services:
+
+- type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
+  name: My Web
+  brooklyn.config:
+    wars.root: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.6.0/brooklyn-example-hello-world-sql-webapp-0.6.0.war
+    java.sysprops:
+      brooklyn.example.db.url: >
+        $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
+        component("db").attributeWhenReady("datastore.url"),
+        "visitors", "brooklyn", "br00k11n")
+  brooklyn.policies:
+  - type: org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy
+    brooklyn.config:
+      metric: webapp.reqs.perSec.windowed.perNode
+      metricLowerBound: 0.1
+      metricUpperBound: 10
+      minPoolSize: 1
+      maxPoolSize: 4
+      resizeUpStabilizationDelay: 10s
+      resizeDownStabilizationDelay: 1m
+
+- type: org.apache.brooklyn.entity.database.mysql.MySqlNode
+  id: db
+  name: My DB
+  brooklyn.config:
+    creationScriptUrl: https://bit.ly/brooklyn-visitors-creation-script

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/blueprints.md
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/blueprints.md b/docs/guide/ops/gui/blueprints.md
new file mode 100644
index 0000000..8c67f9b
--- /dev/null
+++ b/docs/guide/ops/gui/blueprints.md
@@ -0,0 +1,68 @@
+---
+title: Deploying Blueprints
+layout: website-normal
+menu_parent: index.md
+children:
+- { section: Launching from a Blueprint, title: Launching from a Blueprint } 
+- { section: Launching from the Catalog, title: Launching from the Catalog } 
+---
+
+{% include fields.md %}
+
+
+## Launching from a Blueprint
+
+When you first access the web console on [http://127.0.0.1:8081](http://127.0.0.1:8081) you will be requested to create your first application.
+
+We'll start by deploying an application via a YAML blueprint consisting of the following layers.
+
+- MySQL DB
+- Dynamic web application cluster
+  - Nginx load balancer
+  - Tomcat app server cluster
+
+[![Brooklyn web console, showing the YAML tab of the Add Application dialog.](images/add-application-modal-yaml.png)](images/add-application-modal-yaml-large.png)
+
+Switch to the YAML tab and copy the blueprint below into the large text box. 
+
+But *before* you submit it, modify the YAML to specify the location where the application will be deployed.
+
+{% highlight yaml %}
+{% readj _my-web-cluster.yaml %}
+{% endhighlight %}
+
+Replace the `location:` element with values for your chosen target environment, for example to use SoftLayer rather than AWS (updating with your own credentials): 
+
+{% highlight yaml %}
+location:
+  jclouds:softlayer:
+    identity: ABCDEFGHIJKLMNOPQRST
+    credential: s3cr3tsq1rr3ls3cr3tsq1rr3ls3cr3tsq1rr3l
+{% endhighlight %}
+
+**NOTE**: See __[Locations](../locations)__ in the Operations section of the User Guide for instructions on setting up alternate cloud providers, bring-your-own-nodes, or localhost targets, and storing credentials/locations in a file on disk rather than in the blueprint.
+
+With the modified YAML in the dialog, click "Finish". The dialog will close and Brooklyn will begin deploying your
+application. Your application will be shown as "Starting" on the web console's front page.
+
+[![Brooklyn web console, showing the application starting.](images/home-app-starting.png)](images/home-app-starting-large.png)
+
+Depending on your choice of location it may take some time for the application nodes to start, the next page describes how you can monitor the progress of the application deployment and verify its successful deployment.
+
+## Launching from the Catalog
+
+Instead of pasting the YAML blueprint each time, it can be added to the Brooklyn Catalog where it will be accessible from the Catalog tab of the Create Application dialog.
+
+[![Viewing Catalog entries in Add Application dialog.](images/add-application-catalog-web-cluster-with-db.png)](images/add-application-catalog-web-cluster-with-db-large.png)
+
+<!-- TODO: more detail for adding to catalog? but wait for persistence to be the default, 
+     rather than extensively document default.catalog.bom.
+     also need to include instructions on stopping (currently in help, including stopping apps) -->
+
+See __[Catalog](../catalog/)__ in the Operations section of the User Guide for instructions on creating a new Catalog entry from your Blueprint YAML.
+
+
+## Next 
+
+So far we have touched on Brooklyn's ability to *deploy* an application blueprint to a cloud provider.  
+The next section will show how to **[Monitor and Manage Applications](managing.html)**.

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/add-application-catalog-web-cluster-with-db-large.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/add-application-catalog-web-cluster-with-db-large.png b/docs/guide/ops/gui/images/add-application-catalog-web-cluster-with-db-large.png
new file mode 100644
index 0000000..1e1cf4e
Binary files /dev/null and b/docs/guide/ops/gui/images/add-application-catalog-web-cluster-with-db-large.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/add-application-catalog-web-cluster-with-db-location-large.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/add-application-catalog-web-cluster-with-db-location-large.png b/docs/guide/ops/gui/images/add-application-catalog-web-cluster-with-db-location-large.png
new file mode 100644
index 0000000..05e9b0c
Binary files /dev/null and b/docs/guide/ops/gui/images/add-application-catalog-web-cluster-with-db-location-large.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/add-application-catalog-web-cluster-with-db-location.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/add-application-catalog-web-cluster-with-db-location.png b/docs/guide/ops/gui/images/add-application-catalog-web-cluster-with-db-location.png
new file mode 100644
index 0000000..c13fdd8
Binary files /dev/null and b/docs/guide/ops/gui/images/add-application-catalog-web-cluster-with-db-location.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/add-application-catalog-web-cluster-with-db.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/add-application-catalog-web-cluster-with-db.png b/docs/guide/ops/gui/images/add-application-catalog-web-cluster-with-db.png
new file mode 100644
index 0000000..0a7d985
Binary files /dev/null and b/docs/guide/ops/gui/images/add-application-catalog-web-cluster-with-db.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/add-application-modal-yaml-large.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/add-application-modal-yaml-large.png b/docs/guide/ops/gui/images/add-application-modal-yaml-large.png
new file mode 100644
index 0000000..57c9e5c
Binary files /dev/null and b/docs/guide/ops/gui/images/add-application-modal-yaml-large.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/add-application-modal-yaml.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/add-application-modal-yaml.png b/docs/guide/ops/gui/images/add-application-modal-yaml.png
new file mode 100644
index 0000000..a9b2c35
Binary files /dev/null and b/docs/guide/ops/gui/images/add-application-modal-yaml.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/home-app-starting-large.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/home-app-starting-large.png b/docs/guide/ops/gui/images/home-app-starting-large.png
new file mode 100644
index 0000000..5b92e31
Binary files /dev/null and b/docs/guide/ops/gui/images/home-app-starting-large.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/home-app-starting.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/home-app-starting.png b/docs/guide/ops/gui/images/home-app-starting.png
new file mode 100644
index 0000000..5394498
Binary files /dev/null and b/docs/guide/ops/gui/images/home-app-starting.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/my-db-activities-step1-large.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/my-db-activities-step1-large.png b/docs/guide/ops/gui/images/my-db-activities-step1-large.png
new file mode 100644
index 0000000..c715ba3
Binary files /dev/null and b/docs/guide/ops/gui/images/my-db-activities-step1-large.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/my-db-activities-step1.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/my-db-activities-step1.png b/docs/guide/ops/gui/images/my-db-activities-step1.png
new file mode 100644
index 0000000..382a198
Binary files /dev/null and b/docs/guide/ops/gui/images/my-db-activities-step1.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/my-db-activities-step2-large.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/my-db-activities-step2-large.png b/docs/guide/ops/gui/images/my-db-activities-step2-large.png
new file mode 100644
index 0000000..3a6d1e3
Binary files /dev/null and b/docs/guide/ops/gui/images/my-db-activities-step2-large.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/my-db-activities-step2.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/my-db-activities-step2.png b/docs/guide/ops/gui/images/my-db-activities-step2.png
new file mode 100644
index 0000000..e771a06
Binary files /dev/null and b/docs/guide/ops/gui/images/my-db-activities-step2.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/my-db-activities-step3-large.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/my-db-activities-step3-large.png b/docs/guide/ops/gui/images/my-db-activities-step3-large.png
new file mode 100644
index 0000000..7f484a2
Binary files /dev/null and b/docs/guide/ops/gui/images/my-db-activities-step3-large.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/my-db-activities-step3.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/my-db-activities-step3.png b/docs/guide/ops/gui/images/my-db-activities-step3.png
new file mode 100644
index 0000000..0e1b508
Binary files /dev/null and b/docs/guide/ops/gui/images/my-db-activities-step3.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/my-web-cluster-starting.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/my-web-cluster-starting.png b/docs/guide/ops/gui/images/my-web-cluster-starting.png
new file mode 100644
index 0000000..c389b0b
Binary files /dev/null and b/docs/guide/ops/gui/images/my-web-cluster-starting.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/my-web-cluster-stop-confirm-large.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/my-web-cluster-stop-confirm-large.png b/docs/guide/ops/gui/images/my-web-cluster-stop-confirm-large.png
new file mode 100644
index 0000000..c9bdab6
Binary files /dev/null and b/docs/guide/ops/gui/images/my-web-cluster-stop-confirm-large.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/my-web-cluster-stop-confirm.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/my-web-cluster-stop-confirm.png b/docs/guide/ops/gui/images/my-web-cluster-stop-confirm.png
new file mode 100644
index 0000000..179b00a
Binary files /dev/null and b/docs/guide/ops/gui/images/my-web-cluster-stop-confirm.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/my-web-large.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/my-web-large.png b/docs/guide/ops/gui/images/my-web-large.png
new file mode 100644
index 0000000..8954441
Binary files /dev/null and b/docs/guide/ops/gui/images/my-web-large.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/my-web-summary-large.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/my-web-summary-large.png b/docs/guide/ops/gui/images/my-web-summary-large.png
new file mode 100644
index 0000000..fc4bffe
Binary files /dev/null and b/docs/guide/ops/gui/images/my-web-summary-large.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/my-web-summary.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/my-web-summary.png b/docs/guide/ops/gui/images/my-web-summary.png
new file mode 100644
index 0000000..e85752f
Binary files /dev/null and b/docs/guide/ops/gui/images/my-web-summary.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/my-web-validating-app-endpoint-large.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/my-web-validating-app-endpoint-large.png b/docs/guide/ops/gui/images/my-web-validating-app-endpoint-large.png
new file mode 100644
index 0000000..69005c4
Binary files /dev/null and b/docs/guide/ops/gui/images/my-web-validating-app-endpoint-large.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/my-web-validating-app-endpoint.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/my-web-validating-app-endpoint.png b/docs/guide/ops/gui/images/my-web-validating-app-endpoint.png
new file mode 100644
index 0000000..d775717
Binary files /dev/null and b/docs/guide/ops/gui/images/my-web-validating-app-endpoint.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/images/my-web.png
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/images/my-web.png b/docs/guide/ops/gui/images/my-web.png
new file mode 100644
index 0000000..a370606
Binary files /dev/null and b/docs/guide/ops/gui/images/my-web.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/index.md
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/index.md b/docs/guide/ops/gui/index.md
new file mode 100644
index 0000000..48bd620
--- /dev/null
+++ b/docs/guide/ops/gui/index.md
@@ -0,0 +1,11 @@
+---
+layout: website-normal
+title: GUI Guide
+children:
+- running.md
+- blueprints.md
+- managing.md
+- policies.md
+---
+
+{% include list-children.html %}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/managing.md
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/managing.md b/docs/guide/ops/gui/managing.md
new file mode 100644
index 0000000..a972622
--- /dev/null
+++ b/docs/guide/ops/gui/managing.md
@@ -0,0 +1,70 @@
+---
+title: Monitoring and Managing Applications
+title_in_menu: Monitoring and Managing Applications
+layout: website-normal
+menu_parent: index.md
+---
+
+From the Home page, click on the application name or open the Applications tab.
+
+We can explore the management hierarchy of the application, which will show us the entities it is composed of.  Starting from the application use the arrows to expand out the list of entities, or hover over the arrow until a menu popup is displayed so that you can select `Expand All`.  
+
+ * My Web Cluster (A `BasicApplication`)
+     * My DB (A `MySqlNode`)
+     * My Web (A `ControlledDynamicWebAppCluster`)
+        * Cluster of TomcatServer (A `DynamicWebAppCluster`)
+           * quarantine (A `QuarantineGroup`)
+           * TomcatServer (A `TomcatServer`)
+        * NginxController (An `NginxController`)
+
+Clicking on the "My Web Cluster" entity will show the "Summary" tab,
+giving a very high level of what that component is doing. 
+Click on each of the child components in turn for more detail on that component. 
+Note that the cluster of web servers includes a "quarantine group", to which members of the 
+cluster that fail will be added. These are excluded from the load-balancer's targets.
+
+[![Exploring My Web.](images/my-web.png)](images/my-web-large.png)
+
+
+## Activities
+
+The Activity tab allows us to drill down into the tasks each entity is currently executing or has recently completed. It is possible to drill down through all child tasks, and view the commands issued, along with any errors or warnings that occurred.
+
+For example clicking on the NginxController in the left hand tree and opening its Activity tab you can observe the 'start' task is 'In progress'.
+
+**Note**: You may observe different tasks depending on how far your deployment has progressed).
+
+[![My DB Activities Step 1.](images/my-db-activities-step1.png)](images/my-db-activities-step1-large.png)
+
+Clicking on the 'start' task you can discover more details on the actions being carried out by that task (a task may consist of additional subtasks).
+
+[![My DB Activities Step 2.](images/my-db-activities-step2.png)](images/my-db-activities-step2-large.png)
+
+Continuing to drill down into the 'In progress' tasks you will eventually reach the currently active task where you can investigate the ssh command executed on the target node including the current stdin, stdout and stderr output.
+
+[![My DB Activities Step 3.](images/my-db-activities-step3.png)](images/my-db-activities-step3-large.png)
+
+
+## Sensors
+
+Now click on the "Sensors" tab:
+these data feeds drive the real-time picture of the application.
+As you navigate in the tree at the left, you can see more targeted statistics coming in in real-time.
+
+Explore the sensors and the tree to find the URL where the _NginxController_ for the webapp we just deployed is running. This can be found in '**My Web Cluster** -> **My Web** -> **NginxController** -> **_main.uri_**'.
+
+Quickly return to the **‘Brooklyn JS REST client’** web browser
+tab showing the "Sensors" and observe the '**My Web Cluster** -> **My Web** -> **Cluster of TomcatServer** -> **_webapp.reqs.perSec.last_**' sensor value increase.  
+
+
+
+## Stopping the Application
+
+To stop an application, select the application in the tree view (the top/root entity), click on the Effectors tab, and invoke the "Stop" effector. This will cleanly shutdown all components in the application and return any cloud machines that were being used.
+
+[![My DB Activities.](images/my-web-cluster-stop-confirm.png)](images/my-web-cluster-stop-confirm-large.png)
+
+
+## Next
+
+Brooklyn's real power is in using **[Policies](policies.html)**  to automatically *manage* applications. 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/policies.md
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/policies.md b/docs/guide/ops/gui/policies.md
new file mode 100644
index 0000000..e35c6f2
--- /dev/null
+++ b/docs/guide/ops/gui/policies.md
@@ -0,0 +1,49 @@
+---
+title: Using Policies
+title_in_menu: Using Policies
+layout: website-normal
+---
+
+## Exploring and Testing Policies
+
+To see an example of policy based management, please deploy the following blueprint (changing 
+the location details as for the example shown earlier):
+
+{% highlight yaml %}
+{% readj _my-web-cluster2.yaml %}
+{% endhighlight %}
+
+The app server cluster has an `AutoScalerPolicy`, and the loadbalancer has a `targets` policy.
+
+Use the Applications tab in the web console to drill down into the Policies section of the ControlledDynamicWebAppCluster. You will see that the `AutoScalerPolicy` is running.
+
+
+This policy automatically scales the cluster up or down to be the right size for the cluster's current load. One server is the minimum size allowed by the policy.
+
+The loadbalancer's `targets` policy ensures that the loadbalancer is updated as the cluster size changes.
+
+Sitting idle, this cluster will only contain one server, but you can use a tool like [jmeter](http://jmeter.apache.org/) pointed at the nginx endpoint to create load on the cluster. Download a jmeter test plan [here](https://github.com/apache/incubator-brooklyn/blob/master/examples/simple-web-cluster/resources/jmeter-test-plan.jmx).
+
+As load is added, Apache Brooklyn requests a new cloud machine, creates a new app server, and adds it to the cluster. As load is removed, servers are removed from the cluster, and the infrastructure is handed back to the cloud.
+
+
+## Under the Covers
+
+The `AutoScalerPolicy` here is configured to respond to the sensor
+reporting requests per second per node, invoking the default `resize` effector.
+By clicking on the policy, you can configure it to respond to a much lower threshhold
+or set long stabilization delays (the period before it scales out or back).
+
+An even simpler test is to manually suspend the policy, by clicking "Suspend" in the policies list.
+You can then switch to the "Effectors" tab and manually trigger a `resize`.
+On resize, new nodes are created and configured, 
+and in this case a policy on the nginx node reconfigures nginx whenever the set of active
+targets changes.
+
+
+## Next
+
+This guide has given a quick overview of using the Apache Brooklyn GUI to deploy, monitor and manage applications. The GUI also allows you to perform various Advanced management tasks and to explore and use the REST API (from the Script tab).  Please take some time now to become more familiar with the GUI.
+
+Then continue to read through the [Operations Guide](../).
+

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/gui/running.md
----------------------------------------------------------------------
diff --git a/docs/guide/ops/gui/running.md b/docs/guide/ops/gui/running.md
new file mode 100644
index 0000000..ef8edca
--- /dev/null
+++ b/docs/guide/ops/gui/running.md
@@ -0,0 +1,50 @@
+---
+title: Launching
+title_in_menu: Launching
+layout: website-normal
+menu_parent: index.md
+---
+
+This guide will walk you through connecting to the Brooklyn Server Graphical User Interface and performing various tasks.
+
+For an explanation of common Brooklyn Concepts see the [Brooklyn Concepts Quickstart](../../start/concept-quickstart.html) or see the  full guide in the [Brooklyn Concepts](../../concepts) chapter of the [User Guide](../../).
+
+This guide assumes that you are using Linux or Mac OS X and that Brooklyn Server will be running on your local system.
+
+## Launch Apache Brooklyn
+
+If you haven't already done so, you will need to start Brooklyn Server using the commands shown below.  
+It is not necessary at this time, but depending on what you are going to do, 
+you may wish to set up some other configuration options first,
+ 
+* [Security](../brooklyn_properties.html)
+* [Persistence](../persistence/)
+
+Now start Brooklyn with the following command:
+
+{% highlight bash %}
+$ cd apache-brooklyn-{{ site.brooklyn.version }}
+$ bin/brooklyn launch
+{% endhighlight %}
+
+Please refer to the [Server CLI Reference](../server-cli-reference.html) for details of other possible command line options.
+
+Brooklyn will output the address of the management interface:
+
+<pre>
+INFO  No security provider options specified. ...
+INFO  Starting Brooklyn web-console with passwordless access on localhost ...
+INFO  Starting brooklyn web-console on loopback interface because no security config is set
+INFO  Started Brooklyn console at http://127.0.0.1:8081/, running classpath://brooklyn.war
+</pre>
+
+## Connect with Browser
+
+Next, open the web console on [http://127.0.0.1:8081](http://127.0.0.1:8081). 
+No applications have been deployed yet, so the "Create Application" dialog opens automatically.
+
+[![Brooklyn web console, showing the YAML tab of the Add Application dialog.](images/add-application-catalog-web-cluster-with-db.png)](images/add-application-catalog-web-cluster-with-db-large.png)
+
+
+## Next
+The next section will show how to **[deploy a blueprint](blueprints.html)**.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/index.md
----------------------------------------------------------------------
diff --git a/docs/guide/ops/index.md b/docs/guide/ops/index.md
index bf40c1b..0c2b14b 100644
--- a/docs/guide/ops/index.md
+++ b/docs/guide/ops/index.md
@@ -2,7 +2,8 @@
 title: Operations
 layout: website-normal
 children:
-- cli-reference.md
+- server-cli-reference.md
+- gui/
 - brooklyn_properties.md
 - locations/
 - persistence/

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9608c77/docs/guide/ops/server-cli-reference.md
----------------------------------------------------------------------
diff --git a/docs/guide/ops/server-cli-reference.md b/docs/guide/ops/server-cli-reference.md
new file mode 100644
index 0000000..b964b26
--- /dev/null
+++ b/docs/guide/ops/server-cli-reference.md
@@ -0,0 +1,201 @@
+---
+title: Server CLI Reference
+layout: website-normal
+---
+
+## Launch command
+
+To launch Brooklyn, from the directory where Brooklyn is unpacked, run:
+
+{% highlight bash %}
+% nohup bin/brooklyn launch > /dev/null 2&>1 &
+{% endhighlight %}
+
+With no configuration, this will launch the Brooklyn web console and REST API on [`http://localhost:8081/`](http://localhost:8081/).
+No password is set, but the server is listening only on the loopback network interface for security.
+Once [security is configured](brooklyn_properties.html), Brooklyn will listen on all network interfaces by default.
+By default, Brooklyn will write log messages at the INFO level or above to `brooklyn.info.log` and messgages at the
+DEBUG level or above to `brooklyn.debug.log`. Redirecting the output to `/dev/null` prevents the default console output
+being written to `nohup.out`.
+
+You may wish to [add Brooklyn to your path](#path-setup);
+assuming you've done this, to get information the supported CLI options 
+at any time, just run `brooklyn help`:
+
+{% highlight bash %}
+% bin/brooklyn help
+
+usage: brooklyn [(-q | --quiet)] [(-v | --verbose)] <command> [<args>]
+
+The most commonly used brooklyn commands are:
+    help     Display help information about brooklyn
+    info     Display information about brooklyn
+    launch   Starts a brooklyn application. Note that a BROOKLYN_CLASSPATH environment variable needs to be set up beforehand to point to the user application classpath.
+
+See 'brooklyn help <command>' for more information on a specific command.
+{% endhighlight %}
+
+It is important that Brooklyn is launched with either `nohup ... &` or `... & disown`, to ensure 
+it keeps running after the shell terminates.
+
+
+### Other Server CLI Arguments
+
+The Server CLI arguments for [persistence and HA](persistence/) are described separately.
+
+
+### Path Setup
+
+In order to have easy access to the server cli it is useful to configure the PATH environment 
+variable to also point to the cli's bin directory:
+
+{% highlight bash %}
+BROOKLYN_HOME=/path/to/brooklyn/
+export PATH=$PATH:$BROOKLYN_HOME/usage/dist/target/brooklyn-dist/bin/
+{% endhighlight %}
+
+
+### Memory Usage
+
+The amount of memory required by the Brooklyn process depends on the usage 
+- for example the number of entities/VMs under management.
+
+For a standard Brooklyn deployment, the defaults are to start with 256m, and to grow to 1g of memory.
+These numbers can be overridden by setting the environment variable `JAVA_OPTS` before launching
+the `brooklyn script`:
+
+    JAVA_OPTS=-Xms1g -Xmx1g -XX:MaxPermSize=256m
+
+Brooklyn stores a task history in-memory using [soft references](http://docs.oracle.com/javase/7/docs/api/java/lang/ref/SoftReference.html).
+This means that, once the task history is large, Brooklyn will continually use the maximum allocated 
+memory. It will only expunge tasks from memory when this space is required for other objects within the
+Brooklyn process.
+
+
+## Configuration
+
+### Configuration Files
+
+Brooklyn reads configuration from a variety of places. It aggregates the configuration.
+The list below shows increasing precedence (i.e. the later ones will override values
+from earlier ones, if exactly the same property is specified multiple times).
+
+1. `classpath://brooklyn/location-metadata.properties` is shipped as part of Brooklyn, containing 
+   generic metadata such as jurisdiction and geographic information about Cloud providers.        
+1. The file `~/.brooklyn/location-metadata.properties` (unless `--noGlobalBrooklynProperties` is specified).
+   This is intended to contain custom metadata about additional locations.
+1. The file `~/.brooklyn/brooklyn.properties` (unless `--noGlobalBrooklynProperties` is specified).
+1. Another properties file, if the `--localBrooklynProperties <local brooklyn.properties file>` is specified.
+1. Shell environment variables
+1. System properties, supplied with ``-D`` on the brooklyn (Java) command-line.
+
+These properties are described in more detail [here](brooklyn_properties.html).
+
+
+### Extending the Classpath
+
+The default Brooklyn directory structure includes:
+
+* `./conf/`: for configuration resources.
+* `./lib/patch/`: for Jar files containing patches.
+* `./lib/brooklyn/`: for the brooklyn libraries.
+* `./lib/dropins/`: for additional Jars.
+
+Resources added to `conf/` will be available on the classpath.
+
+A patch can be applied by adding a Jar to the `lib/patch/` directory, and restarting Brooklyn.
+All jars in this directory will be at the head of the classpath.
+
+Additional Jars should be added to `lib/dropins/`, prior to starting Brooklyn. These jars will 
+be at the end of the classpath.
+
+The initial classpath, as set in the `brooklyn` script, is:
+
+    conf:lib/patch/*:lib/brooklyn/*:lib/dropins/*
+
+Additional entries can be added at the head of the classpath by setting the environment variable 
+`BROOKLYN_CLASSPATH` before running the `brooklyn` script. 
+
+
+### Replacing the web-console
+
+*Work in progress.*
+
+The Brooklyn web-console is loaded from the classpath as the resource `classpath://brooklyn.war`.
+
+To replace this, an alternative WAR with that name can be added at the head of the classpath.
+However, this approach is likely to change in a future release - consider this feature as "beta".
+
+
+## Cloud Explorer
+
+The `brooklyn` command line tool includes support for querying (and managing) cloud
+compute resources and blob-store resources. 
+
+For example, `brooklyn cloud-compute list-instances --location aws-ec2:eu-west-1`
+will use the AWS credentials from `brooklyn.properties` and list the VM instances
+running in the given EC2 region.
+
+Use `brooklyn help` and `brooklyn help cloud-compute` to find out more information.
+
+This functionality is not intended as a generic cloud management CLI, but instead 
+solves specific Brooklyn use-cases. The main use-case is discovering the valid 
+configuration options on a given cloud, such as for `imageId` and `hardwareId`.
+
+
+### Cloud Compute
+
+The command `brooklyn cloud-compute` has the following options:
+
+* `list-images`: lists VM images within the given cloud, which can be chosen when
+  provisioning new VMs.
+  This is useful for finding the possible values for the `imageId` configuration.
+
+* `get-image <imageId1> <imageId2> ...`: retrieves metadata about the specific images.
+
+* `list-hardware-profiles`: lists the ids and the details of the hardware profiles
+  available when provisioning. 
+  This is useful for finding the possible values for the `hardwareId` configuration.
+
+* `default-template`: retrieves metadata about the image and hardware profile that will
+  be used by Brooklyn for that location, if no additional configuration options
+  are supplied.
+
+* `list-instances`: lists the VM instances within the given cloud.
+
+* `terminate-instances <instanceId1> <instanceId2> ...`: Terminates the instances with
+  the given ids.
+
+
+### Blob Store
+
+The command `brooklyn cloud-blobstore` is used to access a given object store, such as S3
+or Swift. It has the following options:
+
+* `list-containers`: lists the containers (i.e. buckets in S3 terminology) within the 
+  given object store.
+
+* `list-container <containerName>`: lists all the blobs (i.e. objects) contained within 
+  the given container.
+
+* `blob --container <containerName> --blob <blobName>`: retrieves the given blob
+  (i.e. object), including metadata and its contents.
+
+  
+## Running from a Source Build
+
+Here is an example of the commands you might run to get the Brooklyn code, 
+compile it and launch an application:
+
+{% highlight bash %}
+git clone https://github.com/apache/incubator-brooklyn.git
+cd brooklyn
+mvn clean install -DskipTests
+BROOKLYN_HOME=$(pwd)
+export PATH=${PATH}:${BROOKLYN_HOME}/usage/dist/target/brooklyn-dist/bin/
+export BROOKLYN_CLASSPATH=${BROOKLYN_HOME}/examples/simple-web-cluster/target/classes
+nohup brooklyn launch --app brooklyn.demo.SingleWebServerExample --location localhost &
+{% endhighlight %}
+
+
+  



[9/9] incubator-brooklyn git commit: This closes #1071

Posted by he...@apache.org.
This closes #1071


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/1337affe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/1337affe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/1337affe

Branch: refs/heads/master
Commit: 1337affeb0e9999fd93198ab9326dad2915321b7
Parents: 0832db4 af36c7f
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Fri Nov 27 09:43:58 2015 +0000
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Fri Nov 27 09:43:58 2015 +0000

----------------------------------------------------------------------
 .../core/ssh/BashCommandsIntegrationTest.java   | 29 ++++++++++++++++++++
 .../resources/brooklyn/util/ssh/test_sudoers    | 24 ++++++++++++++++
 .../apache/brooklyn/util/ssh/BashCommands.java  | 10 ++++++-
 3 files changed, 62 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[4/9] incubator-brooklyn git commit: Fix SoftwareProcess.dontRequireTtyForSudo

Posted by he...@apache.org.
Fix SoftwareProcess.dontRequireTtyForSudo

- it doesn't directly edit /etc/sudoers
- uses visudo to verify the prepared file
- added integration test


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/af36c7f7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/af36c7f7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/af36c7f7

Branch: refs/heads/master
Commit: af36c7f77621a428179646210302080f766b89c1
Parents: b03f77e
Author: Yavor Yanchev <ya...@yanchev.com>
Authored: Thu Nov 26 11:30:58 2015 +0200
Committer: Yavor Yanchev <ya...@yanchev.com>
Committed: Thu Nov 26 13:02:39 2015 +0200

----------------------------------------------------------------------
 .../core/ssh/BashCommandsIntegrationTest.java   | 29 ++++++++++++++++++++
 .../resources/brooklyn/util/ssh/test_sudoers    | 24 ++++++++++++++++
 .../apache/brooklyn/util/ssh/BashCommands.java  | 10 ++++++-
 3 files changed, 62 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/af36c7f7/core/src/test/java/org/apache/brooklyn/util/core/ssh/BashCommandsIntegrationTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/util/core/ssh/BashCommandsIntegrationTest.java b/core/src/test/java/org/apache/brooklyn/util/core/ssh/BashCommandsIntegrationTest.java
index b067bd8..3ef0337 100644
--- a/core/src/test/java/org/apache/brooklyn/util/core/ssh/BashCommandsIntegrationTest.java
+++ b/core/src/test/java/org/apache/brooklyn/util/core/ssh/BashCommandsIntegrationTest.java
@@ -36,6 +36,7 @@ import java.util.List;
 import org.apache.brooklyn.api.mgmt.ManagementContext;
 import org.apache.brooklyn.core.entity.Entities;
 import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests;
+import org.apache.brooklyn.util.core.ResourceUtils;
 import org.apache.brooklyn.util.core.task.BasicExecutionContext;
 import org.apache.brooklyn.util.core.task.ssh.SshTasks;
 import org.apache.brooklyn.util.core.task.system.ProcessTaskWrapper;
@@ -72,6 +73,7 @@ public class BashCommandsIntegrationTest {
     private File sourceNonExistantFile;
     private File sourceFile1;
     private File sourceFile2;
+    private File tmpSudoersFile;
     private String sourceNonExistantFileUrl;
     private String sourceFileUrl1;
     private String sourceFileUrl2;
@@ -108,6 +110,11 @@ public class BashCommandsIntegrationTest {
         localRepoEntityBasePath.mkdirs();
         Files.write("mylocal1".getBytes(), localRepoEntityFile);
 
+        tmpSudoersFile = Os.newTempFile(getClass(), "sudoers" + Identifiers.makeRandomId(8));
+
+        String sudoers = ResourceUtils.create(this).getResourceAsString("classpath://brooklyn/util/ssh/test_sudoers");
+        Files.write(sudoers.getBytes(), tmpSudoersFile);
+        
         loc = mgmt.getLocationManager().createLocation(LocalhostMachineProvisioningLocation.spec()).obtain();
     }
     
@@ -117,12 +124,34 @@ public class BashCommandsIntegrationTest {
         if (sourceFile2 != null) sourceFile2.delete();
         if (destFile != null) destFile.delete();
         if (localRepoEntityFile != null) localRepoEntityFile.delete();
+        if (tmpSudoersFile != null) tmpSudoersFile.delete();
         if (localRepoEntityBasePath != null) FileUtils.deleteDirectory(localRepoEntityBasePath);
         if (loc != null) loc.close();
         if (mgmt != null) Entities.destroyAll(mgmt);
     }
     
     @Test(groups="Integration")
+    public void testRemoveRequireTtyFromSudoersFile() throws Exception {
+        String cmds = BashCommands.dontRequireTtyForSudo();
+
+        
+        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+        ByteArrayOutputStream errStream = new ByteArrayOutputStream();
+
+        String cmdsWithReplacedSudoersName = Strings.replaceAllNonRegex(cmds, "/etc/sudoers", tmpSudoersFile.getAbsolutePath());
+        int exitcode = loc.execCommands(ImmutableMap.of("out", outStream, "err", errStream), "removeRequireTtyFromSudoersFile", ImmutableList.of(cmdsWithReplacedSudoersName));
+
+        String outstr = new String(outStream.toByteArray());
+        String errstr = new String(errStream.toByteArray());
+
+        assertEquals(0, exitcode);
+        
+        // visudo returns "parsed OK"
+        assertTrue(outstr.contains("parsed OK"), "out="+outstr+"; err="+errstr);
+        assertTrue(errstr.isEmpty(), "out="+outstr+"; err="+errstr);
+    }
+    
+    @Test(groups="Integration")
     public void testSudo() throws Exception {
         ByteArrayOutputStream outStream = new ByteArrayOutputStream();
         ByteArrayOutputStream errStream = new ByteArrayOutputStream();

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/af36c7f7/core/src/test/resources/brooklyn/util/ssh/test_sudoers
----------------------------------------------------------------------
diff --git a/core/src/test/resources/brooklyn/util/ssh/test_sudoers b/core/src/test/resources/brooklyn/util/ssh/test_sudoers
new file mode 100644
index 0000000..fe2fa74
--- /dev/null
+++ b/core/src/test/resources/brooklyn/util/ssh/test_sudoers
@@ -0,0 +1,24 @@
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements.  See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership.  The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License.  You may obtain a copy of the License at
+#    
+#     http://www.apache.org/licenses/LICENSE-2.0
+#    
+#    Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#   KIND, either express or implied.  See the License for the
+#   specific language governing permissions and limitations
+#    under the License.
+
+# Defaults specification
+
+#
+# Disable "ssh hostname sudo <cmd>", because it will show the password in clear. 
+#         You have to run "ssh -t hostname sudo <cmd>".
+#
+Defaults    requiretty

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/af36c7f7/utils/common/src/main/java/org/apache/brooklyn/util/ssh/BashCommands.java
----------------------------------------------------------------------
diff --git a/utils/common/src/main/java/org/apache/brooklyn/util/ssh/BashCommands.java b/utils/common/src/main/java/org/apache/brooklyn/util/ssh/BashCommands.java
index eb082c2..f73ebc2 100644
--- a/utils/common/src/main/java/org/apache/brooklyn/util/ssh/BashCommands.java
+++ b/utils/common/src/main/java/org/apache/brooklyn/util/ssh/BashCommands.java
@@ -162,7 +162,15 @@ public class BashCommands {
      * (having a tty for sudo seems like another case of imaginary security which is just irritating.
      * like water restrictions at airport security.) */
     public static String dontRequireTtyForSudo() {
-        return ifFileExistsElse0("/etc/sudoers", sudo("sed -i.brooklyn.bak 's/.*requiretty.*/#brooklyn-removed-require-tty/' /etc/sudoers"));
+        String sudoersFileName =  "/etc/sudoers";
+
+        // Visudo's quiet mode (-q) is not enabled. visudo's output is used for diagnostic purposes 
+        return ifFileExistsElse0(sudoersFileName, 
+                chainGroup(
+                  sudo(format("cp %1$s %1$s.tmp", sudoersFileName)),
+                  sudo(format("sed -i.brooklyn.bak 's/.*requiretty.*/#brooklyn-removed-require-tty/' %1$s.tmp", sudoersFileName)),
+                  sudo(format("visudo -c -f %1$s.tmp", sudoersFileName)), 
+                  sudo(format("mv %1$s.tmp %1$s", sudoersFileName))));
     }
 
     /** generates ~/.ssh/id_rsa if that file does not exist */