brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [3/6] incubator-brooklyn git commit: Updated catalog maintenance docs as per PR comments
Date Tue, 23 Dec 2014 15:10:54 GMT
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 <github@nakomis.com>
Authored: Fri Dec 19 14:07:52 2014 +0000
Committer: Martin Harris <github@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 Brooklyn Catalog](mysql-in-catalog-w700.png "MySQL in Brooklyn Catalog")](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"
}
 ]


Mime
View raw message