brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Valentin Aitken <valentin.ait...@cloudsoftcorp.com>
Subject [PROPOSAL] BROOKLYN-460 Brooklyn Camp syntax for adding tags to an entity spec
Date Fri, 31 Mar 2017 08:49:39 GMT
Hi,

I'd like to bring attention to a new feature I suggested in BROOKLYN-460 
[1] and [2].
Current requirement is to be able to supply String tags in an entity 
spec in YAML so it can be then retrieved via REST API with GET 
/v1/applications/<appId>/entities/<entityId>/tags.

Example usage in a YAML blueprint:
services:
- type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
   brooklyn.tags:
   - tag1
   - "2"
   - hello world

Please shout if you have further requirements for brooklyn.tags.

Main concern raised in [2] comments is whether that syntax should 
support any Object as a tag.

My concern is that although Object is allowed
in Apache Brooklyn only classes defined in 
org.apache.brooklyn.core.mgmt.BrooklynTags are used as a tag.
Every entity has this tag at the moment:
[{"kind":"yaml_spec","contents":"services:\n- type......"}]

That is good since REST query for tags in every entity will have "kind" 
field which someone can rely on.
Good use case is to very easy filter out kind -> yaml_spec and making 
sure user can retrieve only tags assigned in YAML.
That's why I decided to follow the same pattern and in YAML and accept
string values only which are then passed to 
org.apache.brooklyn.core.mgmt.BrooklynTags.newNotesTag
in order to keep existing pattern with "kind" and "contents" fields for 
every tag.


[1] https://issues.apache.org/jira/browse/BROOKLYN-460
[2] https://github.com/apache/brooklyn-server/pull/612

-- 
Valentin Aitken
Software Engineer
Cloudsoft Corporation Ltd.
www.cloudsoft.io


Mime
View raw message