brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <>
Subject [GitHub] incubator-brooklyn pull request: Make YAML more powerful
Date Thu, 16 Apr 2015 21:05:24 GMT
Github user aledsage commented on a diff in the pull request:
    --- Diff: docs/guide/yaml/example_yaml/test-app-with-enrichers-slightly-simpler.yaml ---
    @@ -0,0 +1,57 @@
    +# example showing how enrichers can be set 
    +name: test-app-with-enrichers
    +description: Testing many enrichers
    +- type:
    +  id: cluster
    +  initialSize: 3
    +  location: localhost
    +  memberSpec:
    +    $brooklyn:entitySpec:
    +      type: brooklyn.test.entity.TestEntity
    +      brooklyn.enrichers:
    +      - type: brooklyn.enricher.basic.Transformer
    +        # transform "ip" (which we expect a feed, not shown here, to set) to a URL;
    +        # you can curl an address string to the sensors/ip endpoint an entity to trigger
these enrichers 
    +        brooklyn.config:
    +          enricher.sourceSensor: $brooklyn:sensor("ip")
    +          enricher.targetSensor: $brooklyn:sensor("url")
    +          enricher.targetValue: $brooklyn:formatString("http://%s/", $brooklyn:attributeWhenReady("ip"))
    --- End diff --
    Great examples, and great that we can now support all of these. I like the yaml here.
    Rambling thoughts follow, not pertinent to this PR!
    I wonder about things like `$brooklyn:sensor("brooklyn.entity.basic.Attributes", "main.uri")`.
As long as people hardly ever write it, then I'm ok. Otherwise, need to think of the trade-off
for letting them just create a new untyped sensor with the same name, versus it finding the
statically defined sensor. The untyped obviously wouldn't have the description and type metadata,
but would be simpler in the yaml.

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 or file a JIRA ticket
with INFRA.

View raw message