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/06/24 09:38:31 UTC
[01/12] incubator-brooklyn git commit: clean up how locations are
rendered in the js gui, and expand "delete"
Repository: incubator-brooklyn
Updated Branches:
refs/heads/master d2beaa7de -> b08fe4eca
clean up how locations are rendered in the js gui, and expand "delete"
there was (is) confusion between catalog name and location displayName and a named location.
it deserves a major sort-out, i think treating location defs as catalog items and location instances as entities;
and only using the catalog api, not a dedicated locations api (or if there is, it delegates to catalog),
also removing all the LocationManager blah.
but until then we needed something which avoided confusion where catalog item names for locations
aren't rendered, and magic display names from location-metadata were being showed so it looked
like nothing was being added, though the location worked.
for locations, a catalog item name now does nothing, but the location's name (i.e. human-readable ID aka catalog item ID, not the display name)
is shown in the catalog accordion list (the "IdentifierName"), better info (but not the full yaml yet) is shown in the detail,
and versions are at least handled without bugs, even if only one version for location is really supported in the gui.
also adds delete for entity and apps and policies, and fixes delete for locations.
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/91532f39
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/91532f39
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/91532f39
Branch: refs/heads/master
Commit: 91532f39a43bdf6c1d46210c599503c1166c2215
Parents: 3650dfa
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Sun Jun 21 12:21:21 2015 -0700
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Sun Jun 21 14:30:07 2015 -0700
----------------------------------------------------------------------
.../catalog/internal/BasicBrooklynCatalog.java | 4 ++
.../assets/js/model/catalog-item-summary.js | 7 +--
.../src/main/webapp/assets/js/model/location.js | 6 +++
.../src/main/webapp/assets/js/view/catalog.js | 46 +++++++++++++++++---
.../assets/tpl/catalog/details-entity.html | 5 +++
.../assets/tpl/catalog/details-generic.html | 4 ++
.../assets/tpl/catalog/details-location.html | 22 ++++++----
.../main/java/brooklyn/rest/api/CatalogApi.java | 13 ++++++
.../rest/resources/CatalogResource.java | 5 +++
.../rest/resources/LocationResource.java | 34 +++++++++++++--
10 files changed, 124 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/91532f39/core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java b/core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java
index 421794c..31458f5 100644
--- a/core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java
+++ b/core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java
@@ -355,6 +355,10 @@ public class BasicBrooklynCatalog implements BrooklynCatalog {
default: throw new RuntimeException("Only entity, policy & location catalog items are supported. Unsupported catalog item type " + item.getCatalogItemType());
}
((AbstractBrooklynObjectSpec<?, ?>)spec).catalogItemId(item.getId());
+
+ if (Strings.isBlank( ((AbstractBrooklynObjectSpec<?, ?>)spec).getDisplayName() ))
+ ((AbstractBrooklynObjectSpec<?, ?>)spec).displayName(item.getDisplayName());
+
return spec;
}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/91532f39/usage/jsgui/src/main/webapp/assets/js/model/catalog-item-summary.js
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/js/model/catalog-item-summary.js b/usage/jsgui/src/main/webapp/assets/js/model/catalog-item-summary.js
index 2d8da58..60d1eda 100644
--- a/usage/jsgui/src/main/webapp/assets/js/model/catalog-item-summary.js
+++ b/usage/jsgui/src/main/webapp/assets/js/model/catalog-item-summary.js
@@ -19,8 +19,9 @@
define(["underscore", "backbone"], function (_, Backbone) {
// NB: THIS IS NOT USED CURRENTLY
- // the logic in application-add-wizard.js simply loads and manipulates json
- // TODO change that so that it uses this backbone model + collection
+ // the logic in application-add-wizard.js simply loads and manipulates json;
+ // logic in catalog.js (view) defines its own local model
+ // TODO change those so that they use this backbone model + collection,
// allowing a way to specify on creation what we are looking up in the catalog -- apps or entities or policies
var CatalogItem = {}
@@ -40,7 +41,7 @@ define(["underscore", "backbone"], function (_, Backbone) {
CatalogItem.Collection = Backbone.Collection.extend({
model:CatalogItem.Model,
- url:'/v1/catalog' // TODO is this application or entities or policies?
+ url:'/v1/catalog' // TODO is this application or entities or policies? (but note THIS IS NOT USED)
})
return CatalogItem
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/91532f39/usage/jsgui/src/main/webapp/assets/js/model/location.js
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/js/model/location.js b/usage/jsgui/src/main/webapp/assets/js/model/location.js
index 3bb3db2..4e33860 100644
--- a/usage/jsgui/src/main/webapp/assets/js/model/location.js
+++ b/usage/jsgui/src/main/webapp/assets/js/model/location.js
@@ -69,6 +69,12 @@ define(["underscore", "backbone"], function (_, Backbone) {
name = this.get('name')
if (name!=null && name.length>0) return name
return this.get('spec')
+ },
+ getIdentifierName: function() {
+ var name = null;
+ name = this.get('name')
+ if (name!=null && name.length>0) return name
+ return this.get('spec')
}
})
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/91532f39/usage/jsgui/src/main/webapp/assets/js/view/catalog.js
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/js/view/catalog.js b/usage/jsgui/src/main/webapp/assets/js/view/catalog.js
index 68b3c6f..51d8a0a 100644
--- a/usage/jsgui/src/main/webapp/assets/js/view/catalog.js
+++ b/usage/jsgui/src/main/webapp/assets/js/view/catalog.js
@@ -113,9 +113,16 @@ define([
// Could use wait flag to block removal of model from collection
// until server confirms deletion and success handler to perform
// removal. Useful if delete fails for e.g. lack of entitlement.
- this.activeModel.destroy();
- var displayName = $(event.currentTarget).data("name");
- this.renderEmpty(displayName ? "Deleted " + displayName : "");
+ var that = this;
+ var displayName = $(event.currentTarget).data("name") || "item";
+ this.activeModel.destroy({
+ success: function() {
+ that.renderEmpty("Deleted " + displayName);
+ },
+ error: function(info) {
+ that.renderEmpty("Unable to permanently delete " + displayName+". Deletion is temporary, client-side only.");
+ }
+ });
}
});
@@ -259,6 +266,11 @@ define([
}
var Catalog = Backbone.Collection.extend({
+ modelX: Backbone.Model.extend({
+ url: function() {
+ return "/v1/catalog/" + this.name + "/" + this.id + "?allVersions=true";
+ }
+ }),
initialize: function(models, options) {
this.name = options["name"];
if (!this.name) {
@@ -267,7 +279,12 @@ define([
//this.model is a constructor so it shouldn't be _.bind'ed to this
//It actually works when a browser provided .bind is used, but the
//fallback implementation doesn't support it.
- var model = this.model;
+ var that = this;
+ var model = this.model.extend({
+ url: function() {
+ return "/v1/catalog/" + that.name + "/" + this.id.split(":").join("/");
+ }
+ });
_.bindAll(this);
this.model = model;
},
@@ -466,7 +483,7 @@ define([
autoOpen: this.options.kind == "locations",
entryTemplateArgs: function (location, index) {
return {
- type: location.getPrettyName(),
+ type: location.getIdentifierName(),
id: location.getLinkByName("self")
};
}
@@ -536,13 +553,28 @@ define([
.then(function() {
var model = accordion.collection.get(id);
if (!model) {
- // caller probably passed the wrong kind (in case of entity v app, the caller might try both)
- } else {
+ // if a version is supplied, try it without a version - needed for locations, navigating after deletion
+ if (id && id.split(":").length>1) {
+ model = accordion.collection.get( id.split(":")[0] );
+ }
+ }
+ if (!model) {
+ // if an ID is supplied without a version, look for first matching version (should be newest)
+ if (id && id.split(":").length==1 && accordion.collection.models) {
+ model = _.find(accordion.collection.models, function(m) {
+ return m && m.id && m.id.startsWith(id+":");
+ });
+ }
+ }
+ // TODO could look in collection for any starting with ID
+ if (model) {
Backbone.history.navigate("/v1/catalog/"+kind+"/"+id);
activeDetailsView = kind;
accordion.activeCid = model.cid;
accordion.options.onItemSelected(kind, model);
accordion.show();
+ } else {
+ // catalog item not found, or not found yet (it might be reloaded and another callback will try again)
}
});
}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/91532f39/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-entity.html
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-entity.html b/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-entity.html
index f123913..2e43fe5 100644
--- a/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-entity.html
+++ b/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-entity.html
@@ -16,8 +16,13 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
+
<div class="catalog-details">
+ <div class="float-right">
+ <button data-name="<%= model.id %>" class="btn btn-danger delete">Delete</button>
+ </div>
+
<% if (model.get("name") != model.get("symbolicName")) { %>
<h2><%- model.get("name") %></h2>
<p><%- model.getVersionedAttr("symbolicName") %></p>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/91532f39/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-generic.html
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-generic.html b/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-generic.html
index f57500e..49a29a0 100644
--- a/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-generic.html
+++ b/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-generic.html
@@ -19,6 +19,10 @@ under the License.
<div class="catalog-details">
+ <div class="float-right">
+ <button data-name="<%= model.id %>" class="btn btn-danger delete">Delete</button>
+ </div>
+
<% if (model.get("name") !== undefined) { %>
<h2><%= model.get("name") %></h2>
<% } else if (model.get("type") !== undefined) { %>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/91532f39/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-location.html
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-location.html b/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-location.html
index 27fe3e2..03dd596 100644
--- a/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-location.html
+++ b/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-location.html
@@ -16,26 +16,30 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
+
<div class="catalog-details">
- <h3><%- model.getPrettyName() %></h3>
+ <h3><%- model.getIdentifierName() %></h3>
<div class="float-right">
- <button data-name="<%= model.getPrettyName() %>" class="btn btn-danger delete">Delete</button>
+ <button data-name="<%= model.getIdentifierName() %>" class="btn btn-danger delete">Delete</button>
</div>
-<% if (!model.get("config") || _.isEmpty(model.get("config"))) { %>
- <em>No special configuration</em>
-<% } else { %>
-
<br/>
<table>
- <tr><td><strong>ID:</strong> </td><td><%- model.get("id") || "" %></td></tr>
- <tr><td><strong>Name:</strong> </td><td><%- model.get("name") || "" %></td></tr>
- <tr><td><strong>Spec:</strong> </td><td><%- model.get("spec") || "" %></td></tr>
+ <tr><td><strong>Display Name:</strong> </td><td><%- model.getPrettyName() || "" %></td></tr>
+ <tr><td><strong>Reference Name:</strong> </td><td><%- model.get("name") || "" %></td></tr>
+ <tr><td><strong>Internal ID:</strong> </td><td><%- model.get("id") || "" %></td></tr>
+ <tr><td><strong>Implementation Spec:</strong> </td><td><%- model.get("spec") || "" %></td></tr>
</table>
<br/>
+
+<% if (!model.get("config") || _.isEmpty(model.get("config"))) { %>
+ <!-- either no config or it comes from a yaml plan and config not yet available;
+ TODO need to use the /v1/catalog/location API not the /v1/locations/ API -->
+<% } else { %>
+
<table class="table table-striped table-condensed nonDatatables">
<thead><tr>
<th>Configuration Key</th>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/91532f39/usage/rest-api/src/main/java/brooklyn/rest/api/CatalogApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/brooklyn/rest/api/CatalogApi.java b/usage/rest-api/src/main/java/brooklyn/rest/api/CatalogApi.java
index d96de81..f757310 100644
--- a/usage/rest-api/src/main/java/brooklyn/rest/api/CatalogApi.java
+++ b/usage/rest-api/src/main/java/brooklyn/rest/api/CatalogApi.java
@@ -94,6 +94,19 @@ public interface CatalogApi {
@PathParam("entityId") String entityId) throws Exception;
@DELETE
+ @Path("/applications/{applicationId}/{version}")
+ @ApiOperation(value = "Deletes a specific version of an application's definition from the catalog")
+ @ApiErrors(value = {
+ @ApiError(code = 404, reason = "Entity not found")
+ })
+ public void deleteApplication(
+ @ApiParam(name = "applicationId", value = "The ID of the application or template to delete", required = true)
+ @PathParam("applicationId") String entityId,
+
+ @ApiParam(name = "version", value = "The version identifier of the application or template to delete", required = true)
+ @PathParam("version") String version) throws Exception;
+
+ @DELETE
@Path("/entities/{entityId}/{version}")
@ApiOperation(value = "Deletes a specific version of an entity's definition from the catalog")
@ApiErrors(value = {
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/91532f39/usage/rest-server/src/main/java/brooklyn/rest/resources/CatalogResource.java
----------------------------------------------------------------------
diff --git a/usage/rest-server/src/main/java/brooklyn/rest/resources/CatalogResource.java b/usage/rest-server/src/main/java/brooklyn/rest/resources/CatalogResource.java
index 1e1bc28..344e939 100644
--- a/usage/rest-server/src/main/java/brooklyn/rest/resources/CatalogResource.java
+++ b/usage/rest-server/src/main/java/brooklyn/rest/resources/CatalogResource.java
@@ -160,6 +160,11 @@ public class CatalogResource extends AbstractBrooklynRestResource implements Cat
}
@Override
+ public void deleteApplication(String applicationId, String version) throws Exception {
+ deleteEntity(applicationId, version);
+ }
+
+ @Override
public void deleteEntity(String entityId, String version) throws Exception {
if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), Entitlements.MODIFY_CATALOG_ITEM, StringAndArgument.of(entityId+(Strings.isBlank(version) ? "" : ":"+version), "delete"))) {
throw WebResourceUtils.unauthorized("User '%s' is not authorized to modify catalog",
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/91532f39/usage/rest-server/src/main/java/brooklyn/rest/resources/LocationResource.java
----------------------------------------------------------------------
diff --git a/usage/rest-server/src/main/java/brooklyn/rest/resources/LocationResource.java b/usage/rest-server/src/main/java/brooklyn/rest/resources/LocationResource.java
index 74185d7..5909182 100644
--- a/usage/rest-server/src/main/java/brooklyn/rest/resources/LocationResource.java
+++ b/usage/rest-server/src/main/java/brooklyn/rest/resources/LocationResource.java
@@ -19,6 +19,7 @@
package brooklyn.rest.resources;
import java.net.URI;
+import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -29,13 +30,14 @@ import javax.ws.rs.core.Response;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import brooklyn.catalog.CatalogItem;
+import brooklyn.catalog.internal.CatalogUtils;
import brooklyn.location.Location;
import brooklyn.location.LocationDefinition;
import brooklyn.location.basic.LocationConfigKeys;
import brooklyn.rest.api.LocationApi;
import brooklyn.rest.domain.LocationSpec;
import brooklyn.rest.domain.LocationSummary;
-import brooklyn.rest.domain.SummaryComparators;
import brooklyn.rest.filter.HaHotStateRequired;
import brooklyn.rest.transform.LocationTransformer;
import brooklyn.rest.transform.LocationTransformer.LocationDetailLevel;
@@ -43,6 +45,8 @@ import brooklyn.rest.util.EntityLocationUtils;
import brooklyn.rest.util.WebResourceUtils;
import brooklyn.util.collections.MutableMap;
import brooklyn.util.exceptions.Exceptions;
+import brooklyn.util.text.NaturalOrderComparator;
+import brooklyn.util.text.Strings;
import com.google.common.base.Function;
import com.google.common.base.Joiner;
@@ -82,7 +86,22 @@ public class LocationResource extends AbstractBrooklynRestResource implements Lo
return FluentIterable.from(brooklyn().getLocationRegistry().getDefinedLocations().values())
.transform(transformer)
.filter(LocationSummary.class)
- .toSortedList(SummaryComparators.displayNameComparator());
+ .toSortedList(nameOrSpecComparator());
+ }
+
+ private static NaturalOrderComparator COMPARATOR = new NaturalOrderComparator();
+ private static Comparator<LocationSummary> nameOrSpecComparator() {
+ return new Comparator<LocationSummary>() {
+ @Override
+ public int compare(LocationSummary o1, LocationSummary o2) {
+ return COMPARATOR.compare(getNameOrSpec(o1).toLowerCase(), getNameOrSpec(o2).toLowerCase());
+ }
+ };
+ }
+ private static String getNameOrSpec(LocationSummary o) {
+ if (Strings.isNonBlank(o.getName())) return o.getName();
+ if (Strings.isNonBlank(o.getSpec())) return o.getSpec();
+ return o.getId();
}
// this is here to support the web GUI's circles
@@ -152,6 +171,15 @@ public class LocationResource extends AbstractBrooklynRestResource implements Lo
@Override
@Deprecated
public void delete(String locationId) {
- brooklyn().getCatalog().deleteCatalogItem(locationId);
+ // TODO make all locations be part of the catalog, then flip the JS GUI to use catalog api
+ if (deleteAllVersions(locationId)>0) return;
+ throw WebResourceUtils.notFound("No catalog item location matching %s; only catalog item locations can be deleted", locationId);
+ }
+
+ private int deleteAllVersions(String locationId) {
+ CatalogItem<?, ?> item = CatalogUtils.getCatalogItemOptionalVersion(mgmt(), locationId);
+ if (item==null) return 0;
+ brooklyn().getCatalog().deleteCatalogItem(item.getSymbolicName(), item.getVersion());
+ return 1 + deleteAllVersions(locationId);
}
}
[02/12] incubator-brooklyn git commit: fix test of catalog rest
resource (method count)
Posted by he...@apache.org.
fix test of catalog rest resource (method count)
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/3388fde7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/3388fde7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/3388fde7
Branch: refs/heads/master
Commit: 3388fde785ef655039b9de4d6f36cf46d7d355f5
Parents: 91532f3
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Sun Jun 21 15:19:35 2015 -0700
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Sun Jun 21 15:20:22 2015 -0700
----------------------------------------------------------------------
.../src/test/java/brooklyn/rest/resources/ApiDocResourceTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3388fde7/usage/rest-server/src/test/java/brooklyn/rest/resources/ApiDocResourceTest.java
----------------------------------------------------------------------
diff --git a/usage/rest-server/src/test/java/brooklyn/rest/resources/ApiDocResourceTest.java b/usage/rest-server/src/test/java/brooklyn/rest/resources/ApiDocResourceTest.java
index bbd96a3..8e2f36d 100644
--- a/usage/rest-server/src/test/java/brooklyn/rest/resources/ApiDocResourceTest.java
+++ b/usage/rest-server/src/test/java/brooklyn/rest/resources/ApiDocResourceTest.java
@@ -98,7 +98,7 @@ public class ApiDocResourceTest extends BrooklynRestResourceTest {
@Test
public void testCatalogDetails() throws Exception {
ApidocRoot response = client().resource("/v1/apidoc/brooklyn.rest.resources.CatalogResource").get(ApidocRoot.class);
- assertEquals(countOperations(response), 21, "ops="+getOperations(response));
+ assertEquals(countOperations(response), 22, "ops="+getOperations(response));
}
@SuppressWarnings("rawtypes")
[03/12] incubator-brooklyn git commit: Add TestResourceUnavailable
check in 2 new tests
Posted by he...@apache.org.
Add TestResourceUnavailable check in 2 new tests
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/a92ff140
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/a92ff140
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/a92ff140
Branch: refs/heads/master
Commit: a92ff140c69c2ae502e3c77ce0f4ac5f4de29888
Parents: 3650dfa
Author: Richard Downer <ri...@apache.org>
Authored: Tue Jun 23 13:09:15 2015 +0100
Committer: Richard Downer <ri...@apache.org>
Committed: Tue Jun 23 13:09:15 2015 +0100
----------------------------------------------------------------------
.../entity/rebind/persister/XmlMementoSerializerTest.java | 3 +++
.../io/brooklyn/camp/brooklyn/catalog/AbstractCatalogXmlTest.java | 2 ++
2 files changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a92ff140/core/src/test/java/brooklyn/entity/rebind/persister/XmlMementoSerializerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/entity/rebind/persister/XmlMementoSerializerTest.java b/core/src/test/java/brooklyn/entity/rebind/persister/XmlMementoSerializerTest.java
index 0aeaa86..7f0f3c9 100644
--- a/core/src/test/java/brooklyn/entity/rebind/persister/XmlMementoSerializerTest.java
+++ b/core/src/test/java/brooklyn/entity/rebind/persister/XmlMementoSerializerTest.java
@@ -30,6 +30,8 @@ import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
+import brooklyn.management.osgi.OsgiTestResources;
+import brooklyn.test.TestResourceUnavailableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.BeforeMethod;
@@ -212,6 +214,7 @@ public class XmlMementoSerializerTest {
@Test
public void testEntitySpecFromOsgi() throws Exception {
+ TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiTestResources.BROOKLYN_TEST_MORE_ENTITIES_V1_PATH);
ManagementContext mgmt = LocalManagementContextForTests.builder(true).disableOsgi(false).build();
try {
CatalogItem<?, ?> ci = OsgiVersionMoreEntityTest.addMoreEntityV1(mgmt, "1.0");
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a92ff140/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/AbstractCatalogXmlTest.java
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/AbstractCatalogXmlTest.java b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/AbstractCatalogXmlTest.java
index 44ea9a8..4de4cf1 100644
--- a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/AbstractCatalogXmlTest.java
+++ b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/AbstractCatalogXmlTest.java
@@ -18,6 +18,7 @@
*/
package io.brooklyn.camp.brooklyn.catalog;
+import brooklyn.test.TestResourceUnavailableException;
import io.brooklyn.camp.brooklyn.AbstractYamlTest;
import java.io.File;
@@ -79,6 +80,7 @@ public class AbstractCatalogXmlTest extends AbstractYamlTest {
}
private File createJar(ResourceUtils ru) {
+ TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiTestResources.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
File tmpJar = Os.newTempFile("osgi-entities-", ".jar");
InputStream in = ru.getResourceFromUrl("classpath://" + OsgiTestResources.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
copy(in, tmpJar);
[08/12] incubator-brooklyn git commit: This closes #709
Posted by he...@apache.org.
This closes #709
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/842e8300
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/842e8300
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/842e8300
Branch: refs/heads/master
Commit: 842e8300c5ce56e99759a38cb496fb6a01a23e3b
Parents: 3a65255 0b842eb
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Wed Jun 24 00:29:15 2015 -0700
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Wed Jun 24 00:29:15 2015 -0700
----------------------------------------------------------------------
.../entity/rebind/persister/XmlMementoSerializerTest.java | 3 +++
usage/camp/pom.xml | 8 +++++++-
.../camp/brooklyn/catalog/AbstractCatalogXmlTest.java | 2 ++
usage/dist/pom.xml | 4 ++--
4 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
[04/12] incubator-brooklyn git commit: Fix dependency convergence
error
Posted by he...@apache.org.
Fix dependency convergence error
Version conflict around commons-logging 1.1 and 1.2
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/effb97ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/effb97ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/effb97ee
Branch: refs/heads/master
Commit: effb97ee06e39e79601bb758af3345d3eb787d08
Parents: a92ff14
Author: Richard Downer <ri...@apache.org>
Authored: Tue Jun 23 13:09:47 2015 +0100
Committer: Richard Downer <ri...@apache.org>
Committed: Tue Jun 23 13:09:47 2015 +0100
----------------------------------------------------------------------
usage/camp/pom.xml | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/effb97ee/usage/camp/pom.xml
----------------------------------------------------------------------
diff --git a/usage/camp/pom.xml b/usage/camp/pom.xml
index 2ac11e6..7df716e 100644
--- a/usage/camp/pom.xml
+++ b/usage/camp/pom.xml
@@ -59,7 +59,13 @@
<groupId>org.apache.brooklyn.camp</groupId>
<artifactId>camp-base</artifactId>
<version>${project.version}</version>
- </dependency>
+ <exclusions>
+ <!-- Dependency versions mismatch between transitive dependencies, declare explicitly -->
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions> </dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
[05/12] incubator-brooklyn git commit: Rename dist to
"apache-brooklyn-..."
Posted by he...@apache.org.
Rename dist to "apache-brooklyn-..."
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/0b842eb5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/0b842eb5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/0b842eb5
Branch: refs/heads/master
Commit: 0b842eb57a6f134e26840e803ff393a19652a629
Parents: effb97e
Author: Richard Downer <ri...@apache.org>
Authored: Tue Jun 23 13:13:00 2015 +0100
Committer: Richard Downer <ri...@apache.org>
Committed: Tue Jun 23 13:13:00 2015 +0100
----------------------------------------------------------------------
usage/dist/pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/0b842eb5/usage/dist/pom.xml
----------------------------------------------------------------------
diff --git a/usage/dist/pom.xml b/usage/dist/pom.xml
index 5b42073..2fc5268 100644
--- a/usage/dist/pom.xml
+++ b/usage/dist/pom.xml
@@ -118,12 +118,12 @@
<configuration>
<artifacts>
<artifact>
- <file>${project.build.directory}/brooklyn-${project.version}-dist.tar.gz</file>
+ <file>${project.build.directory}/apache-brooklyn-${project.version}-dist.tar.gz</file>
<type>tar.gz</type>
<classifier>dist</classifier>
</artifact>
<artifact>
- <file>${project.build.directory}/brooklyn-${project.version}-dist.zip</file>
+ <file>${project.build.directory}/apache-brooklyn-${project.version}-dist.zip</file>
<type>zip</type>
<classifier>dist</classifier>
</artifact>
[07/12] incubator-brooklyn git commit: This closes #711
Posted by he...@apache.org.
This closes #711
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/3a65255e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/3a65255e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/3a65255e
Branch: refs/heads/master
Commit: 3a65255ec3fa1e9b14f0ef23054f971608b89408
Parents: 3650dfa a89773b
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Wed Jun 24 00:29:12 2015 -0700
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Wed Jun 24 00:29:12 2015 -0700
----------------------------------------------------------------------
docs/guide/ops/locations/index.md | 38 ++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
----------------------------------------------------------------------
[12/12] incubator-brooklyn git commit: remove overflow-y where it
doesn't belong
Posted by he...@apache.org.
remove overflow-y where it doesn't belong
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/b08fe4ec
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/b08fe4ec
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/b08fe4ec
Branch: refs/heads/master
Commit: b08fe4ecaf79d644f7dabbef1a62af7ededcbe58
Parents: 3c11304
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Wed Jun 24 00:37:08 2015 -0700
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Wed Jun 24 00:37:08 2015 -0700
----------------------------------------------------------------------
usage/jsgui/src/main/webapp/assets/css/base.css | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/b08fe4ec/usage/jsgui/src/main/webapp/assets/css/base.css
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/css/base.css b/usage/jsgui/src/main/webapp/assets/css/base.css
index c33d015..745540c 100644
--- a/usage/jsgui/src/main/webapp/assets/css/base.css
+++ b/usage/jsgui/src/main/webapp/assets/css/base.css
@@ -1114,7 +1114,6 @@ tr.app-add-wizard-config-entry {
margin-bottom: 6px;
background-color: #F0F0F0;
border-radius: 5px;
- overflow-y: scroll;
}
.catalog-accordion-wrapper .accordion-nav-row {
white-space: pre;
[11/12] incubator-brooklyn git commit: Merge remote-tracking branch
'apache-gh/master'
Posted by he...@apache.org.
Merge remote-tracking branch 'apache-gh/master'
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/3c11304c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/3c11304c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/3c11304c
Branch: refs/heads/master
Commit: 3c11304c9429160f7dde04b53aca789f029f0a5c
Parents: 772ec02 d2beaa7
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Wed Jun 24 00:36:47 2015 -0700
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Wed Jun 24 00:36:47 2015 -0700
----------------------------------------------------------------------
.../brooklyn/entity/basic/AbstractEntity.java | 14 ++-
.../event/feed/function/FunctionFeedTest.java | 33 ++++++
.../location/jclouds/JcloudsLocation.java | 29 +++++-
.../ha/ConnectionFailureDetectorTest.java | 2 +-
.../java/brooklyn/entity/java/JmxSupport.java | 3 +-
.../BrooklynNodeIntegrationTest.java | 19 +++-
...SoftwareProcessSshDriverIntegrationTest.java | 70 +++++--------
.../AbstractWebAppFixtureIntegrationTest.java | 15 +--
...Boss7ServerNonInheritingIntegrationTest.java | 40 +++----
usage/jsgui/src/main/webapp/assets/css/base.css | 5 +
.../webapp/assets/js/util/brooklyn-utils.js | 26 +++++
.../assets/js/view/application-add-wizard.js | 4 +-
.../main/webapp/assets/js/view/entity-config.js | 33 +++---
.../webapp/assets/js/view/entity-sensors.js | 33 +++---
.../webapp/assets/tpl/apps/config-name.html | 12 ++-
.../webapp/assets/tpl/apps/sensor-name.html | 12 ++-
.../brooklyn/util/ssh/IptablesCommands.java | 57 ++++++++++
.../util/ssh/IptablesCommandsFirewalldTest.java | 104 +++++++++++++++++++
18 files changed, 392 insertions(+), 119 deletions(-)
----------------------------------------------------------------------
[09/12] incubator-brooklyn git commit: fix formatting from #709
Posted by he...@apache.org.
fix formatting from #709
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/d496393b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/d496393b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/d496393b
Branch: refs/heads/master
Commit: d496393bed23ccc03b2eff67f803e4e6b5889d57
Parents: 842e830
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Wed Jun 24 00:31:03 2015 -0700
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Wed Jun 24 00:31:03 2015 -0700
----------------------------------------------------------------------
usage/camp/pom.xml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d496393b/usage/camp/pom.xml
----------------------------------------------------------------------
diff --git a/usage/camp/pom.xml b/usage/camp/pom.xml
index 7df716e..00a46b7 100644
--- a/usage/camp/pom.xml
+++ b/usage/camp/pom.xml
@@ -65,7 +65,8 @@
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
- </exclusions> </dependency>
+ </exclusions>
+ </dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
[06/12] incubator-brooklyn git commit: Describes AWS VPC issue
Posted by he...@apache.org.
Describes AWS VPC issue
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/a89773b3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/a89773b3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/a89773b3
Branch: refs/heads/master
Commit: a89773b3897f9d1d0d10e27ac0aa16f40838e67c
Parents: 3650dfa
Author: Duncan Grant <du...@cloudsoftcorp.com>
Authored: Tue Jun 23 14:31:33 2015 +0100
Committer: Duncan Grant <du...@cloudsoftcorp.com>
Committed: Tue Jun 23 14:31:33 2015 +0100
----------------------------------------------------------------------
docs/guide/ops/locations/index.md | 38 ++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a89773b3/docs/guide/ops/locations/index.md
----------------------------------------------------------------------
diff --git a/docs/guide/ops/locations/index.md b/docs/guide/ops/locations/index.md
index 78f185d..e6c7035 100644
--- a/docs/guide/ops/locations/index.md
+++ b/docs/guide/ops/locations/index.md
@@ -210,6 +210,44 @@ For more keys and more detail on the keys below, see
This setting prevents scripts executed on the VMs from being deleted on completion.
Note that some scripts run periodically so this can eventually fill a disk; it should only be used for dev/test.
+### AWS VPC issues which may affect users with older AWS accounts
+
+AWS now has different default behaviour depending on the age of your AWS account and whether you used the target region before, or during, 2013.
+In this case VM provisioning may fail with an error like:
+
+{% highlight text %}
+
+Detected that your EC2 account is a legacy 'classic' account, but the recommended instance type requires VPC.
+You can specify the 'eu-central-1' region to avoid this problem, or you can specify a classic-compatible instance type,
+or you can specify a subnet to use with 'networkName'
+taking care that the subnet auto-assigns public IP's and allows ingress on all ports,
+as Brooklyn does not currently configure security groups for non-default VPC's;
+or setting up Brooklyn to be in the subnet or have a jump host or other subnet access configuration).
+For more information on VPC vs classic see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-vpc.html.
+
+{% endhighlight %}
+
+Specifically, there are issues with the certain AMIs and instance types. If these are specified or a recommended
+by brooklyn then you may see the above error. There are a few options for fixing this:
+
+- specify a different region which does not support EC2-classic.
+ You can check this on the AWS console under "Supported Platforms.
+ Frankfurt (eu-central-1) is guaranteed to be VPC only.
+
+- specify an instance type that is compatible with ec2-classic.
+ Instance types C4, M4, T2 are only supported in VPC so should not be used.
+ This is described [here](index.html#vm-creation)
+
+- create a subnet to use with the instance. Ensure that the subnet is set to auto-assign public IPs
+ and allows ingress on all ports. Brooklyn cannot currently do this for you.
+ Use the networkName parameter to specify this value in your blueprint.
+
+See the following resources for more information:
+
+- [Amazon EC2 and Amazon Virtual Private Cloud](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-vpc.html#vpc-only-instance-types)
+- [Your Default VPC and Subnets](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/default-vpc.html)
+- [Amazon VPC FAQs](http://aws.amazon.com/vpc/faqs/#Default_VPCs)
+
### Inheritance and Named Locations
[10/12] incubator-brooklyn git commit: This closes #704
Posted by he...@apache.org.
This closes #704
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/772ec021
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/772ec021
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/772ec021
Branch: refs/heads/master
Commit: 772ec021dcc30f6d18690d3afbce5f8766b08e04
Parents: d496393 3388fde
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Wed Jun 24 00:34:59 2015 -0700
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Wed Jun 24 00:34:59 2015 -0700
----------------------------------------------------------------------
.../catalog/internal/BasicBrooklynCatalog.java | 4 ++
.../assets/js/model/catalog-item-summary.js | 7 +--
.../src/main/webapp/assets/js/model/location.js | 6 +++
.../src/main/webapp/assets/js/view/catalog.js | 46 +++++++++++++++++---
.../assets/tpl/catalog/details-entity.html | 5 +++
.../assets/tpl/catalog/details-generic.html | 4 ++
.../assets/tpl/catalog/details-location.html | 22 ++++++----
.../main/java/brooklyn/rest/api/CatalogApi.java | 13 ++++++
.../rest/resources/CatalogResource.java | 5 +++
.../rest/resources/LocationResource.java | 34 +++++++++++++--
.../rest/resources/ApiDocResourceTest.java | 2 +-
11 files changed, 125 insertions(+), 23 deletions(-)
----------------------------------------------------------------------