brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahgittin <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Docs: separate ops/launching page...
Date Mon, 19 Jan 2015 23:25:11 GMT
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/456#discussion_r23193769
  
    --- Diff: docs/guide/ops/catalog/index.md ---
    @@ -0,0 +1,163 @@
    +---
    +title: Catalog
    +layout: website-normal
    +---
    +
    +Brooklyn has a 'catalog', which is a collection of versioned blueprints. 
    +These 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.
    +
    +
    +<!--
    +TODO: Clean up confusion in terminology between Catalog item and Blueprint (and Java
blueprint?)?
    +-->
    +
    +### Catalog items
    +
    +An item to be added to the catalog is defined in YAML. This looks like any other 
    +YAML blueprint, but also has a `brooklyn.catalog` section giving appropriate metadata.
    +
    +An example is shown below.
    +
    +{% highlight yaml %}
    +brooklyn.catalog:
    +  id: org.example.MySQL
    +  version: 1.0
    +  iconUrl: classpath://mysql.png
    +  description: MySql is an open source relational database management system (RDBMS)
    +  libraries:
    +    - url: http://example.com/path/to/my-dependency-1.2.3.jar
    +    - url: http://example.com/path/to/my-other-dependency-4.5.6.jar
    +
    +services:
    +- type: brooklyn.entity.database.mysql.MySqlNode
    +{% endhighlight %}
    +
    +To explain the `brooklyn.catalog` section:
    +
    +- The `id: MySQL` section specifies a unique ID used by Brooklyn to identify the catalog
item. 
    +  Other blueprints can reference the catalog item using this id.
    +- 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 recommended, section that allows
you to provide the URL of a graphic to be 
    +displayed in the 'Add Application' dialog alongside the blueprint name. If using a URL
of the form `classpath://...`, then
    +the image should be on Brooklyn's classpath (e.g. in the `conf` folder of the Brooklyn
distro).
    +- The `description: ...` section allows you to give a free-format description of the
blueprint, which is displayed in the 
    +'Add Application' dialog.
    +
    +The `libraries` section references OSGi bundles required for the blueprint. It can be
omitted if everything
    +required by the blueprint is already on the Brooklyn classpath. The URLs should be to
stable OSGi bundles -
    +if the bundle at this URL changes then this could impact applications if the Brooklyn
server is restarted
    +or fails over to a standby node.
    +
    +
    +To reference a catalog item in another blueprint, simply use its id and optionally its
version number.
    +For example: 
    +
    +{% highlight yaml %}
    +services:
    +- type: org.example.MySQL:1.0
    +{% endhighlight %}
    +
    +
    +### Adding to the Catalog
    +
    +To add a catalog item to the catalog, post the YAML file to Brooklyn's REST API by using
the `curl` command as
    +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 @/path/to/mysql-catalog.yaml
    +{% endhighlight %}
    +
    +
    +
    +### Deleting from the Catalog
    +
    +You can delete a versioned item from the catalog using the REST API. For example, to
delete
    +the item with id `org.example.MySQL` and version `1.0`:
    +
    +{% 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.
    +
    +
    +### Versioning
    +
    +Version numbers follow the OSGi convention. This can have a major, minor, micro and qualifier
part.
    +For example, `1.0`. `1.0.1` or `1.0.1-20150101`.
    +
    +If you attempt to deploy the same version of a catalog item 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
and then
    +POST the new YAML file.
    --- End diff --
    
    and "post" / "POST" -- have fixed both


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message