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