+0.5
I like the idea but I'm afraid it is too specific (i.e for DynamicClusters
only) whereas enrichers are supposed to be generic.
I would then do something like this:
- You can have this for the generic case:
```
brooklyn.enrichers:
- type: org.apache.brooklyn.enricher.stock.ListGenerator
brooklyn.config:
uniqueTag: member-address-list-generator
enricher.sourceSensors:
- $brooklyn:entity("entity1").sensor("member.host.address")
- $brooklyn:entity("entity2").sensor("member.host.address")
- $brooklyn:entity("entity3").sensor("member.host.address")
enricher.targetSensor: $brooklyn:sensor("member.host.address.list")
```
- Or this for a cluster:
```
brooklyn.enrichers:
- type: org.apache.brooklyn.enricher.stock.ListGenerator
brooklyn.config:
uniqueTag: member-address-list-generator
enricher.sourceCluster: $brooklyn:entity("my-cluster")
enricher.sourceSensor: $brooklyn:sensor("member.host.address")
enricher.targetSensor: $brooklyn:sensor("member.host.address.list")
```
WDYT?
On Fri, 6 May 2016 at 06:52 David Bush <[email protected]> wrote:
> +1
>
> Using this in a couple of blueprints at the moment and would be really
> nice to have a concise method.
>
> --
> David Bush • Systems Integrator • Cloudsoft Corporation •
> http://www.cloudsoftcorp.com <http://www.cloudsoftcorp.com/>
> T: 07834 127195 • SKYPE: david.c.bush
>
> > On 6 May 2016, at 01:44, Mike Zaccardo <[email protected]>
> wrote:
> >
> > Hi all,
> >
> > I've encountered the following task numerous times when authoring
> > `DynamicCluster` blueprints: write a sensor that returns a comma
> separated
> > list of values for each member of a cluster (e.g. the host address of
> each
> > member).
> >
> > This is currently how to achieve such a task:
> >
> > brooklyn.enrichers:
> > - type: org.apache.brooklyn.enricher.stock.Aggregator
> > brooklyn.config:
> > uniqueTag: member-address-aggregator
> > enricher.aggregator.excludeBlank: true
> > enricher.aggregating.fromMembers: true
> > enricher.sourceSensor: $brooklyn:sensor("member.host.address")
> > enricher.targetSensor:
> > $brooklyn:sensor("member.host.address.list")
> >
> > - type: org.apache.brooklyn.enricher.stock.Joiner
> > brooklyn.config:
> > uniqueTag: member-address-joiner
> > enricher.sourceSensor:
> > $brooklyn:sensor("member.host.address.list")
> > enricher.targetSensor:
> > $brooklyn:sensor("member.host.address.list.comma_separated")
> > minimum: $brooklyn:config("cluster.size")
> > separator: ","
> > quote: false
> >
> > And here[1] is a specific example in a real blueprint.
> >
> > That's pretty verbose for a commonly required task. Instead, it would be
> > nice to have something resembling the following:
> >
> > brooklyn.enrichers:
> > - type: org.apache.brooklyn.enricher.stock.ClusterListGenerator
> > brooklyn.config:
> > uniqueTag: member-address-list-generator
> > enricher.sourceSensor: $brooklyn:sensor("member.host.address")
> > enricher.targetSensor:
> > $brooklyn:sensor("member.host.address.list")
> >
> > Short and sweet! WDYT?
> >
> > -Mike
> >
> > [1]
> >
> https://github.com/cloudsoft/brooklyn-tendermint/blob/master/tendermint-mintnet.bom#L82
>
> --
Thomas Bouron • Software Engineer @ Cloudsoft Corporation •
http://www.cloudsoftcorp.com/
Github: https://github.com/tbouron
Twitter: https://twitter.com/eltibouron