You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by al...@apache.org on 2014/12/23 16:10:52 UTC
[1/6] incubator-brooklyn git commit: Adds basic instructions for
adding blueprints to and removing blueprints from the catalog
Repository: incubator-brooklyn
Updated Branches:
refs/heads/master f6f389840 -> 2cfe9386d
Adds basic instructions for adding blueprints to and removing blueprints from the catalog
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/79cbc96e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/79cbc96e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/79cbc96e
Branch: refs/heads/master
Commit: 79cbc96e0e7154ef78bbb4b1c925102126d38f26
Parents: d26463b
Author: Martin Harris <gi...@nakomis.com>
Authored: Tue Dec 16 16:22:47 2014 +0000
Committer: Martin Harris <gi...@nakomis.com>
Committed: Fri Dec 19 12:01:36 2014 +0000
----------------------------------------------------------------------
.../catalog-maintenance.md | 97 +++++++++++++++++++
.../mysql-in-catalog-w700.png | Bin 0 -> 92767 bytes
.../defining-applications/mysql-in-catalog.png | Bin 0 -> 168831 bytes
docs/use/guide/defining-applications/toc.json | 21 ++++
4 files changed, 118 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/79cbc96e/docs/use/guide/defining-applications/catalog-maintenance.md
----------------------------------------------------------------------
diff --git a/docs/use/guide/defining-applications/catalog-maintenance.md b/docs/use/guide/defining-applications/catalog-maintenance.md
new file mode 100644
index 0000000..f60fc8e
--- /dev/null
+++ b/docs/use/guide/defining-applications/catalog-maintenance.md
@@ -0,0 +1,97 @@
+---
+title: Catalog Maintenance
+layout: page
+toc: ../guide_toc.json
+categories: [use, guide, catalog-maintenance]
+---
+
+In addition to deploying [YAML blueprints](creating-yaml.md) directly through the web console, it is possible
+to add YAML blueprints to the catalog, which can then be deployed by selecting them from the 'Catalog' section of
+the 'Create Application' dialog.
+
+In order to add a YAML blueprint to the catalog, the root entity must ultimately extend `brooklyn.entity.Application`,
+and the blueprint must contain a `brooklyn.catalog` section. Once this has been done, we can add the blueprint to the
+catalog via Brooklyn's REST API.
+
+Let's take the following YAML as a starting point:
+
+```
+name: MySQL Database
+
+location: localhost
+
+services:
+- type: brooklyn.entity.database.mysql.MySqlNode
+ brooklyn.config:
+ datastore.creation.script.url: classpath://visitors-creation-script.sql
+```
+
+The first thing we need to do is add a root element that extends `brooklyn.entity.Application`. As we don't require any
+custom application-specific logic, we can use the `brooklyn.entity.basic.BasicApplication` class. We can then add our
+MySqlNode as a child of the BasicApplication. When deploying a YAML blueprint via the YAML page of the 'Add Application'
+modal, Brooklyn will do this automatically, however, in order to add our blueprint to the catalog, we will need to this
+manually as follows:
+
+```
+name: MySQL Database
+
+location: localhost
+
+services:
+- type: brooklyn.entity.basic.BasicApplication
+ brooklyn.children:
+ - type: brooklyn.entity.database.mysql.MySqlNode
+ brooklyn.config:
+ datastore.creation.script.url: classpath://visitors-creation-script.sql
+
+```
+
+The next step is to remove the location (as the user will select the location in the GUI), and add a brooklyn.catalog
+section to tell Brooklyn how the blueprint should be displayed in the 'Add Application' modal:
+
+```
+name: MySQL Database
+
+brooklyn.catalog:
+ id: MySQL
+ version: 1.0
+ iconUrl: classpath://mysql.png
+ description: MySql is an open source relational database management system (RDBMS)
+
+services:
+- type: brooklyn.entity.basic.BasicApplication
+ brooklyn.children:
+ - type: brooklyn.entity.database.mysql.MySqlNode
+ brooklyn.config:
+ datastore.creation.script.url: classpath://visitors-creation-script.sql
+```
+
+- The `id: MySQL` section specifies a unique ID used by Brooklyn to identify the catalog item. This ID is also passed to
+`UsageManager.UsageListener.onApplicationEvent` for metering purposes.
+- The `version: 1.0` section provides a unique version for the *blueprint*. NOTE: This is *not* the version of the software
+being installed (in this case MySQL).
+- The `iconUrl: classpath://...` is an optional, but recommened, section that allows you to provide a graphic to be
+displayed in the 'Add Application' modal alongside the blueprint name. These image files should be placed in the
+`conf` folder to make them available at runtime.
+- The `description: ...` section allows you to give a free-format description of the blueprint, which is displayed in the
+'Add Application' modal.
+
+To add the blueprint to the catalog, post the YAML file to Brooklyn's REST API by using the `curl` command as
+follows:
+
+```
+curl -u admin:password http://127.0.0.1:8081/v1/catalog --data-binary @/Users/martin/Desktop/ms.yaml
+```
+
+This will add the blueprint to the catalog as shown here:
+[](mysql-in-catalog.png)
+
+If you attempt to run the curl command a second time, you will receive an error stating `Updating existing catalog entries is forbidden`.
+To update the blueprint, you will need to change the version number in your yaml file before running the curl command
+again. This will create a second blueprint - you can then delete the old version via the REST API, using its ID and version
+as follows:
+
+```
+curl -u admin:password -X DELETE http://127.0.0.1:8081/v1/catalog/entities/MySQL/1.0
+```
+
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/79cbc96e/docs/use/guide/defining-applications/mysql-in-catalog-w700.png
----------------------------------------------------------------------
diff --git a/docs/use/guide/defining-applications/mysql-in-catalog-w700.png b/docs/use/guide/defining-applications/mysql-in-catalog-w700.png
new file mode 100644
index 0000000..f370249
Binary files /dev/null and b/docs/use/guide/defining-applications/mysql-in-catalog-w700.png differ
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/79cbc96e/docs/use/guide/defining-applications/mysql-in-catalog.png
----------------------------------------------------------------------
diff --git a/docs/use/guide/defining-applications/mysql-in-catalog.png b/docs/use/guide/defining-applications/mysql-in-catalog.png
new file mode 100644
index 0000000..685455d
Binary files /dev/null and b/docs/use/guide/defining-applications/mysql-in-catalog.png differ
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/79cbc96e/docs/use/guide/defining-applications/toc.json
----------------------------------------------------------------------
diff --git a/docs/use/guide/defining-applications/toc.json b/docs/use/guide/defining-applications/toc.json
new file mode 100644
index 0000000..9f4c6eb
--- /dev/null
+++ b/docs/use/guide/defining-applications/toc.json
@@ -0,0 +1,21 @@
+[{ "title": "Basic Concepts",
+ "file": "{{ site.url }}/use/guide/defining-applications/basic-concepts.html" },
+{ "title": "Advanced Concepts",
+ "file": "{{ site.url }}/use/guide/defining-applications/advanced-concepts.html" },
+{ "title": "Common Usage",
+ "file": "{{ site.url }}/use/guide/defining-applications/common-usage.html" },
+{ "title": "YAML Blueprints",
+ "file": "{{ site.url }}/use/guide/defining-applications/creating-yaml.html" },
+{ "title": "Chef Blueprints",
+ "file": "{{ site.url }}/use/guide/defining-applications/chef-blueprints.html" },
+{ "title": "Deploying YAML",
+ "file": "{{ site.url }}/use/guide/defining-applications/deploying-yaml.html" },
+{ "title": "YAML Reference",
+ "file": "{{ site.url }}/use/guide/defining-applications/yaml-reference.html" },
+{ "title": "Service State",
+ "file": "{{ site.url }}/use/guide/defining-applications/service-state.html" },
+{ "title": "Maven Archetype",
+ "file": "{{ site.url }}/use/guide/defining-applications/archetype.html" },
+{ "title": "Catalog Maintenance",
+ "file": "{{ site.url }}/use/guide/defining-applications/catalog-maintenance.html" }
+]
[5/6] incubator-brooklyn git commit: docs for catalog: Alex’s review comments
Posted by al...@apache.org.
docs for catalog: Alex’s review comments
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/d6b5fe16
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/d6b5fe16
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/d6b5fe16
Branch: refs/heads/master
Commit: d6b5fe1624ee40bef9f2e3c1013147de020fe664
Parents: 06102d8
Author: Aled Sage <al...@gmail.com>
Authored: Tue Dec 23 15:08:09 2014 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Tue Dec 23 15:08:09 2014 +0000
----------------------------------------------------------------------
.../catalog-maintenance.md | 48 ++++++++++----------
1 file changed, 24 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d6b5fe16/docs/guide/use/guide/defining-applications/catalog-maintenance.md
----------------------------------------------------------------------
diff --git a/docs/guide/use/guide/defining-applications/catalog-maintenance.md b/docs/guide/use/guide/defining-applications/catalog-maintenance.md
index b23450a..edba8e8 100644
--- a/docs/guide/use/guide/defining-applications/catalog-maintenance.md
+++ b/docs/guide/use/guide/defining-applications/catalog-maintenance.md
@@ -16,14 +16,14 @@ All YAML blueprints added to the catalog must also contain a `brooklyn.catalog`
For a blueprint to be accessible via the 'Create Application' dialog, it must be an Application
(i.e. the entity at the root of the blueprint must implement `brooklyn.entity.Application`).
+If just deploying via the REST API, then this is not necessary.
<!--
TODO: Add section that explains how to add plain entities to the catalog and use them either from the App Wizard,
(and entity UI) or embed the catalog id + version in another YAML
-->
-Let's take the following YAML as a starting point. We will convert it for adding to the catalog,
-such that it will usable through the 'Create Application' dialog.
+Let's take the following YAML as a starting point.
{% highlight yaml %}
location: localhost
@@ -35,26 +35,19 @@ services:
datastore.creation.script.url: classpath://visitors-creation-script.sql
{% endhighlight %}
-The first thing we need to do is add a root element that extends `brooklyn.entity.Application`. As we don't require any
-custom application-specific logic, we can use the `brooklyn.entity.basic.BasicApplication` class. We can then add our
-MySqlNode as a child of the BasicApplication. When deploying a YAML blueprint via the YAML page of the 'Add Application'
-dialog, Brooklyn will do this automatically, however, in order to add our blueprint to the catalog, we will need to this
-manually as follows:
+We will convert it for adding to the catalog, such that it will usable through the
+'Create Application' dialog.
-{% highlight yaml %}
-location: localhost
-
-name: MySQL Database
-services:
-- type: brooklyn.entity.basic.BasicApplication
- brooklyn.children:
- - type: brooklyn.entity.database.mysql.MySqlNode
- brooklyn.config:
- datastore.creation.script.url: classpath://visitors-creation-script.sql
-{% endhighlight %}
+The steps are therefore:
-The next step is to remove the location (as the user will select the location in the GUI), and add a brooklyn.catalog
-section to tell Brooklyn how the blueprint should be displayed in the 'Add Application' dialog:
+* Add a brooklyn.catalog section to give metadata about the version etc. This is also used
+ when displaying the blueprint in the 'Add Application' dialog.
+* Remove the explicit location (as the user will typically select the location in the GUI).
+* Add a root element that extends `brooklyn.entity.Application`. As we don't require any
+ custom application-specific logic, we can use the `brooklyn.entity.basic.BasicApplication`
+ class. We can then add our MySqlNode as a child of the BasicApplication.
+ (When deploying via YAML at the REST API, this is not necessary as Brooklyn will do this
+ automatically).
{% highlight yaml %}
brooklyn.catalog:
@@ -73,11 +66,13 @@ services:
{% endhighlight %}
<!--
-TODO: Add section to explain that the brooklyn.catalog section can contain a libraries array, each item pointing to
+TODO: Add documentation to explain that the brooklyn.catalog section can contain a libraries array, each item pointing to
an OSGi bundle where the code for the blueprint is hosted. Every type from the blueprint will be searched for in the
-libraries first and then on the standard Brooklyn classpath.
+libraries first and then on the standard Brooklyn classpath.*
-->
+To explain the `brooklyn.catalog` section:
+
- The `id: MySQL` section specifies a unique ID used by Brooklyn to identify the catalog item. This ID is also passed to
`UsageManager.UsageListener.onApplicationEvent` for metering purposes.
- The `version: 1.0` section provides a unique version for the *blueprint*. NOTE: This is *not* the version of the software
@@ -92,7 +87,7 @@ To add the blueprint to the catalog, post the YAML file to Brooklyn's REST API b
follows (substituting your own usename:password, URL and file path):
{% highlight bash %}
-curl -u admin:password http://127.0.0.1:8081/v1/catalog --data-binary @/Users/martin/Desktop/ms.yaml
+curl -u admin:password http://127.0.0.1:8081/v1/catalog --data-binary @/path/to/mysql-catalog.yaml
{% endhighlight %}
This will add the blueprint to the catalog as shown here:
@@ -111,5 +106,10 @@ curl -u admin:password -X DELETE http://127.0.0.1:8081/v1/catalog/entities/MySQL
rebinding the catalog item is used to reconstruct the entity.
<!--
-TODO: Add section policies to the catalog, and explaining how to add items to the UI using the plus icon on the catalog tab
+TODO: Add documentation about adding policies to the catalog, and explaining how to add items to
+the UI using the plus icon on the catalog tab*
+
+TODO: describe entity addition (this just covers app addition)
+
+TODO: describe how to use the web-console GUI
-->
[6/6] incubator-brooklyn git commit: This closes #423
Posted by al...@apache.org.
This closes #423
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/2cfe9386
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/2cfe9386
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/2cfe9386
Branch: refs/heads/master
Commit: 2cfe9386da1b464948c1d0afaef91a8fb1f274d1
Parents: f6f3898 d6b5fe1
Author: Aled Sage <al...@gmail.com>
Authored: Tue Dec 23 15:10:40 2014 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Tue Dec 23 15:10:40 2014 +0000
----------------------------------------------------------------------
.../catalog-maintenance.md | 115 +++++++++++++++++++
.../mysql-in-catalog-w700.png | Bin 0 -> 92767 bytes
.../defining-applications/mysql-in-catalog.png | Bin 0 -> 168831 bytes
.../use/guide/defining-applications/toc.json | 4 +-
docs/use/guide/defining-applications/toc.json | 21 ++++
5 files changed, 139 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
[4/6] incubator-brooklyn git commit: docs for catalog: review comments
Posted by al...@apache.org.
docs for catalog: review comments
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/06102d82
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/06102d82
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/06102d82
Branch: refs/heads/master
Commit: 06102d82bae34134159b8e85207a48e0e80e8e9a
Parents: d4b7be0
Author: Aled Sage <al...@gmail.com>
Authored: Tue Dec 23 14:29:43 2014 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Tue Dec 23 14:29:43 2014 +0000
----------------------------------------------------------------------
.../catalog-maintenance.md | 48 ++++++++++----------
1 file changed, 24 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/06102d82/docs/guide/use/guide/defining-applications/catalog-maintenance.md
----------------------------------------------------------------------
diff --git a/docs/guide/use/guide/defining-applications/catalog-maintenance.md b/docs/guide/use/guide/defining-applications/catalog-maintenance.md
index 818cece..b23450a 100644
--- a/docs/guide/use/guide/defining-applications/catalog-maintenance.md
+++ b/docs/guide/use/guide/defining-applications/catalog-maintenance.md
@@ -6,25 +6,29 @@ categories: [use, guide, catalog-maintenance]
---
In addition to deploying [YAML blueprints](creating-yaml.md) directly through the web console, it is possible
-to add YAML blueprints to the catalog, which can then be deployed by selecting them from the 'Catalog' section of
-the 'Create Application' dialog.
+to add YAML blueprints to the catalog via Brooklyn's REST API.
-In order to add a YAML blueprint to the catalog, the root entity must ultimately extend `brooklyn.entity.Application`,
-and the blueprint must contain a `brooklyn.catalog` section. Once this has been done, we can add the blueprint to the
-catalog via Brooklyn's REST API.
+The catalog is a collection of versioned blueprints, which can be deployed directly or referenced
+by other blueprints. Blueprints in the catalog can be deployed via the Brooklyn REST API, or from
+the web-console's 'Catalog' section of the 'Create Application' dialog box.
+
+All YAML blueprints added to the catalog must also contain a `brooklyn.catalog` section.
+
+For a blueprint to be accessible via the 'Create Application' dialog, it must be an Application
+(i.e. the entity at the root of the blueprint must implement `brooklyn.entity.Application`).
<!--
TODO: Add section that explains how to add plain entities to the catalog and use them either from the App Wizard,
(and entity UI) or embed the catalog id + version in another YAML
-->
-Let's take the following YAML as a starting point:
+Let's take the following YAML as a starting point. We will convert it for adding to the catalog,
+such that it will usable through the 'Create Application' dialog.
{% highlight yaml %}
-name: MySQL Database
-
location: localhost
+name: MySQL Database
services:
- type: brooklyn.entity.database.mysql.MySqlNode
brooklyn.config:
@@ -34,35 +38,32 @@ services:
The first thing we need to do is add a root element that extends `brooklyn.entity.Application`. As we don't require any
custom application-specific logic, we can use the `brooklyn.entity.basic.BasicApplication` class. We can then add our
MySqlNode as a child of the BasicApplication. When deploying a YAML blueprint via the YAML page of the 'Add Application'
-modal, Brooklyn will do this automatically, however, in order to add our blueprint to the catalog, we will need to this
+dialog, Brooklyn will do this automatically, however, in order to add our blueprint to the catalog, we will need to this
manually as follows:
{% highlight yaml %}
-name: MySQL Database
-
location: localhost
+name: MySQL Database
services:
- type: brooklyn.entity.basic.BasicApplication
brooklyn.children:
- type: brooklyn.entity.database.mysql.MySqlNode
brooklyn.config:
datastore.creation.script.url: classpath://visitors-creation-script.sql
-
{% endhighlight %}
The next step is to remove the location (as the user will select the location in the GUI), and add a brooklyn.catalog
-section to tell Brooklyn how the blueprint should be displayed in the 'Add Application' modal:
+section to tell Brooklyn how the blueprint should be displayed in the 'Add Application' dialog:
{% highlight yaml %}
-name: MySQL Database
-
brooklyn.catalog:
id: MySQL
version: 1.0
iconUrl: classpath://mysql.png
description: MySql is an open source relational database management system (RDBMS)
+name: MySQL Database
services:
- type: brooklyn.entity.basic.BasicApplication
brooklyn.children:
@@ -73,22 +74,22 @@ services:
<!--
TODO: Add section to explain that the brooklyn.catalog section can contain a libraries array, each item pointing to
-an OSGi bundle where the code for the blueprint is hosted. Evey type from the blueprint will be searched for in the
-libraries first and then on the standard brooklyn classpath
+an OSGi bundle where the code for the blueprint is hosted. Every type from the blueprint will be searched for in the
+libraries first and then on the standard Brooklyn classpath.
-->
- The `id: MySQL` section specifies a unique ID used by Brooklyn to identify the catalog item. This ID is also passed to
`UsageManager.UsageListener.onApplicationEvent` for metering purposes.
- The `version: 1.0` section provides a unique version for the *blueprint*. NOTE: This is *not* the version of the software
being installed (in this case MySQL).
-- The `iconUrl: classpath://...` is an optional, but recommened, section that allows you to provide a graphic to be
-displayed in the 'Add Application' modal alongside the blueprint name. These image files should be placed in the
+- The `iconUrl: classpath://...` is an optional, but recommended, section that allows you to provide a graphic to be
+displayed in the 'Add Application' dialog alongside the blueprint name. These image files should be placed in the
`conf` folder to make them available at runtime.
- The `description: ...` section allows you to give a free-format description of the blueprint, which is displayed in the
-'Add Application' modal.
+'Add Application' dialog.
To add the blueprint to the catalog, post the YAML file to Brooklyn's REST API by using the `curl` command as
-follows:
+follows (substituting your own usename:password, URL and file path):
{% highlight bash %}
curl -u admin:password http://127.0.0.1:8081/v1/catalog --data-binary @/Users/martin/Desktop/ms.yaml
@@ -99,7 +100,7 @@ This will add the blueprint to the catalog as shown here:
If you attempt to run the curl command a second time, you will receive an error stating `Updating existing catalog entries is forbidden`.
To update the blueprint, you will need to change the version number in your yaml file before running the curl command
-again. This will create a second blueprint - you can then delete the old version via the REST API, using its ID and version
+again. This will create a second blueprint. You can then delete the old version via the REST API, using its ID and version
as follows:
{% highlight bash %}
@@ -107,8 +108,7 @@ curl -u admin:password -X DELETE http://127.0.0.1:8081/v1/catalog/entities/MySQL
{% endhighlight %}
**Note** Catalog items should not be deleted if there are running apps which were created using the same item. During
-rebinding the catalog item is used to reconstruct the entity. A catalog item might also be used in another catalog item -
-it's not only about top-level application items.
+rebinding the catalog item is used to reconstruct the entity.
<!--
TODO: Add section policies to the catalog, and explaining how to add items to the UI using the plus icon on the catalog tab
[3/6] incubator-brooklyn git commit: Updated catalog maintenance docs
as per PR comments
Posted by al...@apache.org.
Updated catalog maintenance docs as per PR comments
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/d4b7be03
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/d4b7be03
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/d4b7be03
Branch: refs/heads/master
Commit: d4b7be03a3405c1aea1e946ddebab0901196733a
Parents: f6e69cc
Author: Martin Harris <gi...@nakomis.com>
Authored: Fri Dec 19 14:07:52 2014 +0000
Committer: Martin Harris <gi...@nakomis.com>
Committed: Fri Dec 19 14:07:52 2014 +0000
----------------------------------------------------------------------
.../catalog-maintenance.md | 40 ++++++++++++++------
.../use/guide/defining-applications/toc.json | 2 +-
2 files changed, 30 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d4b7be03/docs/guide/use/guide/defining-applications/catalog-maintenance.md
----------------------------------------------------------------------
diff --git a/docs/guide/use/guide/defining-applications/catalog-maintenance.md b/docs/guide/use/guide/defining-applications/catalog-maintenance.md
index f60fc8e..818cece 100644
--- a/docs/guide/use/guide/defining-applications/catalog-maintenance.md
+++ b/docs/guide/use/guide/defining-applications/catalog-maintenance.md
@@ -1,6 +1,6 @@
---
title: Catalog Maintenance
-layout: page
+layout: guide-normal
toc: ../guide_toc.json
categories: [use, guide, catalog-maintenance]
---
@@ -13,9 +13,14 @@ In order to add a YAML blueprint to the catalog, the root entity must ultimately
and the blueprint must contain a `brooklyn.catalog` section. Once this has been done, we can add the blueprint to the
catalog via Brooklyn's REST API.
+<!--
+TODO: Add section that explains how to add plain entities to the catalog and use them either from the App Wizard,
+(and entity UI) or embed the catalog id + version in another YAML
+-->
+
Let's take the following YAML as a starting point:
-```
+{% highlight yaml %}
name: MySQL Database
location: localhost
@@ -24,7 +29,7 @@ services:
- type: brooklyn.entity.database.mysql.MySqlNode
brooklyn.config:
datastore.creation.script.url: classpath://visitors-creation-script.sql
-```
+{% endhighlight %}
The first thing we need to do is add a root element that extends `brooklyn.entity.Application`. As we don't require any
custom application-specific logic, we can use the `brooklyn.entity.basic.BasicApplication` class. We can then add our
@@ -32,7 +37,7 @@ MySqlNode as a child of the BasicApplication. When deploying a YAML blueprint vi
modal, Brooklyn will do this automatically, however, in order to add our blueprint to the catalog, we will need to this
manually as follows:
-```
+{% highlight yaml %}
name: MySQL Database
location: localhost
@@ -44,12 +49,12 @@ services:
brooklyn.config:
datastore.creation.script.url: classpath://visitors-creation-script.sql
-```
+{% endhighlight %}
The next step is to remove the location (as the user will select the location in the GUI), and add a brooklyn.catalog
section to tell Brooklyn how the blueprint should be displayed in the 'Add Application' modal:
-```
+{% highlight yaml %}
name: MySQL Database
brooklyn.catalog:
@@ -64,7 +69,13 @@ services:
- type: brooklyn.entity.database.mysql.MySqlNode
brooklyn.config:
datastore.creation.script.url: classpath://visitors-creation-script.sql
-```
+{% endhighlight %}
+
+<!--
+TODO: Add section to explain that the brooklyn.catalog section can contain a libraries array, each item pointing to
+an OSGi bundle where the code for the blueprint is hosted. Evey type from the blueprint will be searched for in the
+libraries first and then on the standard brooklyn classpath
+-->
- The `id: MySQL` section specifies a unique ID used by Brooklyn to identify the catalog item. This ID is also passed to
`UsageManager.UsageListener.onApplicationEvent` for metering purposes.
@@ -79,9 +90,9 @@ displayed in the 'Add Application' modal alongside the blueprint name. These ima
To add the blueprint to the catalog, post the YAML file to Brooklyn's REST API by using the `curl` command as
follows:
-```
+{% highlight bash %}
curl -u admin:password http://127.0.0.1:8081/v1/catalog --data-binary @/Users/martin/Desktop/ms.yaml
-```
+{% endhighlight %}
This will add the blueprint to the catalog as shown here:
[](mysql-in-catalog.png)
@@ -91,7 +102,14 @@ To update the blueprint, you will need to change the version number in your yaml
again. This will create a second blueprint - you can then delete the old version via the REST API, using its ID and version
as follows:
-```
+{% highlight bash %}
curl -u admin:password -X DELETE http://127.0.0.1:8081/v1/catalog/entities/MySQL/1.0
-```
+{% endhighlight %}
+
+**Note** Catalog items should not be deleted if there are running apps which were created using the same item. During
+rebinding the catalog item is used to reconstruct the entity. A catalog item might also be used in another catalog item -
+it's not only about top-level application items.
+<!--
+TODO: Add section policies to the catalog, and explaining how to add items to the UI using the plus icon on the catalog tab
+-->
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d4b7be03/docs/guide/use/guide/defining-applications/toc.json
----------------------------------------------------------------------
diff --git a/docs/guide/use/guide/defining-applications/toc.json b/docs/guide/use/guide/defining-applications/toc.json
index 385e3b1..6f64ed5 100644
--- a/docs/guide/use/guide/defining-applications/toc.json
+++ b/docs/guide/use/guide/defining-applications/toc.json
@@ -15,7 +15,7 @@
{ "title": "Service State",
"file": "{{ site.path.guide }}/use/guide/defining-applications/service-state.html" },
{ "title": "Maven Archetype",
- "file": "{{ site.path.guide }}/use/guide/defining-applications/archetype.html" }
+ "file": "{{ site.path.guide }}/use/guide/defining-applications/archetype.html" },
{ "title": "Catalog Maintenance",
"file": "{{ site.path.guide }}/use/guide/defining-applications/catalog-maintenance.html" }
]
[2/6] incubator-brooklyn git commit: Rebased and relocated to new
guide locations
Posted by al...@apache.org.
Rebased and relocated to new guide 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/f6e69cc9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/f6e69cc9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/f6e69cc9
Branch: refs/heads/master
Commit: f6e69cc9d9d4038263543a41327f3192df9fc438
Parents: 79cbc96
Author: Martin Harris <gi...@nakomis.com>
Authored: Fri Dec 19 12:07:35 2014 +0000
Committer: Martin Harris <gi...@nakomis.com>
Committed: Fri Dec 19 12:07:35 2014 +0000
----------------------------------------------------------------------
.../catalog-maintenance.md | 97 +++++++++++++++++++
.../mysql-in-catalog-w700.png | Bin 0 -> 92767 bytes
.../defining-applications/mysql-in-catalog.png | Bin 0 -> 168831 bytes
.../use/guide/defining-applications/toc.json | 2 +
.../catalog-maintenance.md | 97 -------------------
.../mysql-in-catalog-w700.png | Bin 92767 -> 0 bytes
.../defining-applications/mysql-in-catalog.png | Bin 168831 -> 0 bytes
7 files changed, 99 insertions(+), 97 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f6e69cc9/docs/guide/use/guide/defining-applications/catalog-maintenance.md
----------------------------------------------------------------------
diff --git a/docs/guide/use/guide/defining-applications/catalog-maintenance.md b/docs/guide/use/guide/defining-applications/catalog-maintenance.md
new file mode 100644
index 0000000..f60fc8e
--- /dev/null
+++ b/docs/guide/use/guide/defining-applications/catalog-maintenance.md
@@ -0,0 +1,97 @@
+---
+title: Catalog Maintenance
+layout: page
+toc: ../guide_toc.json
+categories: [use, guide, catalog-maintenance]
+---
+
+In addition to deploying [YAML blueprints](creating-yaml.md) directly through the web console, it is possible
+to add YAML blueprints to the catalog, which can then be deployed by selecting them from the 'Catalog' section of
+the 'Create Application' dialog.
+
+In order to add a YAML blueprint to the catalog, the root entity must ultimately extend `brooklyn.entity.Application`,
+and the blueprint must contain a `brooklyn.catalog` section. Once this has been done, we can add the blueprint to the
+catalog via Brooklyn's REST API.
+
+Let's take the following YAML as a starting point:
+
+```
+name: MySQL Database
+
+location: localhost
+
+services:
+- type: brooklyn.entity.database.mysql.MySqlNode
+ brooklyn.config:
+ datastore.creation.script.url: classpath://visitors-creation-script.sql
+```
+
+The first thing we need to do is add a root element that extends `brooklyn.entity.Application`. As we don't require any
+custom application-specific logic, we can use the `brooklyn.entity.basic.BasicApplication` class. We can then add our
+MySqlNode as a child of the BasicApplication. When deploying a YAML blueprint via the YAML page of the 'Add Application'
+modal, Brooklyn will do this automatically, however, in order to add our blueprint to the catalog, we will need to this
+manually as follows:
+
+```
+name: MySQL Database
+
+location: localhost
+
+services:
+- type: brooklyn.entity.basic.BasicApplication
+ brooklyn.children:
+ - type: brooklyn.entity.database.mysql.MySqlNode
+ brooklyn.config:
+ datastore.creation.script.url: classpath://visitors-creation-script.sql
+
+```
+
+The next step is to remove the location (as the user will select the location in the GUI), and add a brooklyn.catalog
+section to tell Brooklyn how the blueprint should be displayed in the 'Add Application' modal:
+
+```
+name: MySQL Database
+
+brooklyn.catalog:
+ id: MySQL
+ version: 1.0
+ iconUrl: classpath://mysql.png
+ description: MySql is an open source relational database management system (RDBMS)
+
+services:
+- type: brooklyn.entity.basic.BasicApplication
+ brooklyn.children:
+ - type: brooklyn.entity.database.mysql.MySqlNode
+ brooklyn.config:
+ datastore.creation.script.url: classpath://visitors-creation-script.sql
+```
+
+- The `id: MySQL` section specifies a unique ID used by Brooklyn to identify the catalog item. This ID is also passed to
+`UsageManager.UsageListener.onApplicationEvent` for metering purposes.
+- The `version: 1.0` section provides a unique version for the *blueprint*. NOTE: This is *not* the version of the software
+being installed (in this case MySQL).
+- The `iconUrl: classpath://...` is an optional, but recommened, section that allows you to provide a graphic to be
+displayed in the 'Add Application' modal alongside the blueprint name. These image files should be placed in the
+`conf` folder to make them available at runtime.
+- The `description: ...` section allows you to give a free-format description of the blueprint, which is displayed in the
+'Add Application' modal.
+
+To add the blueprint to the catalog, post the YAML file to Brooklyn's REST API by using the `curl` command as
+follows:
+
+```
+curl -u admin:password http://127.0.0.1:8081/v1/catalog --data-binary @/Users/martin/Desktop/ms.yaml
+```
+
+This will add the blueprint to the catalog as shown here:
+[](mysql-in-catalog.png)
+
+If you attempt to run the curl command a second time, you will receive an error stating `Updating existing catalog entries is forbidden`.
+To update the blueprint, you will need to change the version number in your yaml file before running the curl command
+again. This will create a second blueprint - you can then delete the old version via the REST API, using its ID and version
+as follows:
+
+```
+curl -u admin:password -X DELETE http://127.0.0.1:8081/v1/catalog/entities/MySQL/1.0
+```
+
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f6e69cc9/docs/guide/use/guide/defining-applications/mysql-in-catalog-w700.png
----------------------------------------------------------------------
diff --git a/docs/guide/use/guide/defining-applications/mysql-in-catalog-w700.png b/docs/guide/use/guide/defining-applications/mysql-in-catalog-w700.png
new file mode 100644
index 0000000..f370249
Binary files /dev/null and b/docs/guide/use/guide/defining-applications/mysql-in-catalog-w700.png differ
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f6e69cc9/docs/guide/use/guide/defining-applications/mysql-in-catalog.png
----------------------------------------------------------------------
diff --git a/docs/guide/use/guide/defining-applications/mysql-in-catalog.png b/docs/guide/use/guide/defining-applications/mysql-in-catalog.png
new file mode 100644
index 0000000..685455d
Binary files /dev/null and b/docs/guide/use/guide/defining-applications/mysql-in-catalog.png differ
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f6e69cc9/docs/guide/use/guide/defining-applications/toc.json
----------------------------------------------------------------------
diff --git a/docs/guide/use/guide/defining-applications/toc.json b/docs/guide/use/guide/defining-applications/toc.json
index b4eeeef..385e3b1 100644
--- a/docs/guide/use/guide/defining-applications/toc.json
+++ b/docs/guide/use/guide/defining-applications/toc.json
@@ -16,4 +16,6 @@
"file": "{{ site.path.guide }}/use/guide/defining-applications/service-state.html" },
{ "title": "Maven Archetype",
"file": "{{ site.path.guide }}/use/guide/defining-applications/archetype.html" }
+{ "title": "Catalog Maintenance",
+ "file": "{{ site.path.guide }}/use/guide/defining-applications/catalog-maintenance.html" }
]
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f6e69cc9/docs/use/guide/defining-applications/catalog-maintenance.md
----------------------------------------------------------------------
diff --git a/docs/use/guide/defining-applications/catalog-maintenance.md b/docs/use/guide/defining-applications/catalog-maintenance.md
deleted file mode 100644
index f60fc8e..0000000
--- a/docs/use/guide/defining-applications/catalog-maintenance.md
+++ /dev/null
@@ -1,97 +0,0 @@
----
-title: Catalog Maintenance
-layout: page
-toc: ../guide_toc.json
-categories: [use, guide, catalog-maintenance]
----
-
-In addition to deploying [YAML blueprints](creating-yaml.md) directly through the web console, it is possible
-to add YAML blueprints to the catalog, which can then be deployed by selecting them from the 'Catalog' section of
-the 'Create Application' dialog.
-
-In order to add a YAML blueprint to the catalog, the root entity must ultimately extend `brooklyn.entity.Application`,
-and the blueprint must contain a `brooklyn.catalog` section. Once this has been done, we can add the blueprint to the
-catalog via Brooklyn's REST API.
-
-Let's take the following YAML as a starting point:
-
-```
-name: MySQL Database
-
-location: localhost
-
-services:
-- type: brooklyn.entity.database.mysql.MySqlNode
- brooklyn.config:
- datastore.creation.script.url: classpath://visitors-creation-script.sql
-```
-
-The first thing we need to do is add a root element that extends `brooklyn.entity.Application`. As we don't require any
-custom application-specific logic, we can use the `brooklyn.entity.basic.BasicApplication` class. We can then add our
-MySqlNode as a child of the BasicApplication. When deploying a YAML blueprint via the YAML page of the 'Add Application'
-modal, Brooklyn will do this automatically, however, in order to add our blueprint to the catalog, we will need to this
-manually as follows:
-
-```
-name: MySQL Database
-
-location: localhost
-
-services:
-- type: brooklyn.entity.basic.BasicApplication
- brooklyn.children:
- - type: brooklyn.entity.database.mysql.MySqlNode
- brooklyn.config:
- datastore.creation.script.url: classpath://visitors-creation-script.sql
-
-```
-
-The next step is to remove the location (as the user will select the location in the GUI), and add a brooklyn.catalog
-section to tell Brooklyn how the blueprint should be displayed in the 'Add Application' modal:
-
-```
-name: MySQL Database
-
-brooklyn.catalog:
- id: MySQL
- version: 1.0
- iconUrl: classpath://mysql.png
- description: MySql is an open source relational database management system (RDBMS)
-
-services:
-- type: brooklyn.entity.basic.BasicApplication
- brooklyn.children:
- - type: brooklyn.entity.database.mysql.MySqlNode
- brooklyn.config:
- datastore.creation.script.url: classpath://visitors-creation-script.sql
-```
-
-- The `id: MySQL` section specifies a unique ID used by Brooklyn to identify the catalog item. This ID is also passed to
-`UsageManager.UsageListener.onApplicationEvent` for metering purposes.
-- The `version: 1.0` section provides a unique version for the *blueprint*. NOTE: This is *not* the version of the software
-being installed (in this case MySQL).
-- The `iconUrl: classpath://...` is an optional, but recommened, section that allows you to provide a graphic to be
-displayed in the 'Add Application' modal alongside the blueprint name. These image files should be placed in the
-`conf` folder to make them available at runtime.
-- The `description: ...` section allows you to give a free-format description of the blueprint, which is displayed in the
-'Add Application' modal.
-
-To add the blueprint to the catalog, post the YAML file to Brooklyn's REST API by using the `curl` command as
-follows:
-
-```
-curl -u admin:password http://127.0.0.1:8081/v1/catalog --data-binary @/Users/martin/Desktop/ms.yaml
-```
-
-This will add the blueprint to the catalog as shown here:
-[](mysql-in-catalog.png)
-
-If you attempt to run the curl command a second time, you will receive an error stating `Updating existing catalog entries is forbidden`.
-To update the blueprint, you will need to change the version number in your yaml file before running the curl command
-again. This will create a second blueprint - you can then delete the old version via the REST API, using its ID and version
-as follows:
-
-```
-curl -u admin:password -X DELETE http://127.0.0.1:8081/v1/catalog/entities/MySQL/1.0
-```
-
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f6e69cc9/docs/use/guide/defining-applications/mysql-in-catalog-w700.png
----------------------------------------------------------------------
diff --git a/docs/use/guide/defining-applications/mysql-in-catalog-w700.png b/docs/use/guide/defining-applications/mysql-in-catalog-w700.png
deleted file mode 100644
index f370249..0000000
Binary files a/docs/use/guide/defining-applications/mysql-in-catalog-w700.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f6e69cc9/docs/use/guide/defining-applications/mysql-in-catalog.png
----------------------------------------------------------------------
diff --git a/docs/use/guide/defining-applications/mysql-in-catalog.png b/docs/use/guide/defining-applications/mysql-in-catalog.png
deleted file mode 100644
index 685455d..0000000
Binary files a/docs/use/guide/defining-applications/mysql-in-catalog.png and /dev/null differ