brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Downer <rich...@apache.org>
Subject Re: Attributes with entity as value; accessing its attributes
Date Mon, 01 May 2017 15:42:15 GMT
Thanks Thomas and Mark.

I've tried Thomas' suggestion and it has done the job.

I'll give Mark's suggestion a try later - if it's fewer characters and
looks neater (and works!) then great :-)

Cheers
Richard.


On 1 May 2017 at 16:01, Mark McKenna <m4rkmckenna@apache.org> wrote:

> Hi Richard,
> Have you tried entity instead of component ... I had a similar blueprint a
> few weeks ago and I think that's how I solved it, but I'm nowhere near my
> laptop at the minute to verify so YMMV.
>
> M
>
> On Mon, 1 May 2017, 15:26 Richard Downer, <richard@apache.org> wrote:
>
> > Hi all,
> >
> > In my blueprint, I have a group of MariaDBs, and I want to get the
> > host.name
> > of one entity in the group. The group exposes a sensor
> > `cluster.first.entity`, so I want to get that entity, and then get its
> > sensor `host.name`.
> >
> > Here's a fragment of my blueprint where I try to do this (reduced to as
> > simple a blueprint as will demonstrate the problem):
> >
> >   - type:
> > 'org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess:4.5.0'
> >     location: localhost
> >     brooklyn.config:
> >       example: $brooklyn:formatString("mysql://%s",
> >
> > component("group").attributeWhenReady("cluster.first.entity").
> attributeWhenReady("
> > host.name"))
> >       install.command: echo $EXAMPLE
> >       shell.env:
> >         EXAMPLE: '$brooklyn:config("example")'
> >
> > So I would expect this to echo out a valid hostname, if I go into the
> > Activity view and find the SSH task stdout.
> >
> > What I actually get is something like this:
> >
> >
> > mysql://$brooklyn:entity(org.apache.brooklyn.camp.brooklyn.
> spi.dsl.methods.BrooklynDslCommon$DslFacades$EntitySupplier@30c91bfc
> > ).attributeWhenReady("host.name")
> >
> > Is this kind of thing supposed to work? Am I doing something wrong?
> >
> > Thanks
> > Richard.
> >
> --
>
> *Mark McKenna*
>
>   *twitter:* @m4rkmckenna <https://twitter.com/m4rkmckenna>
>
> *  pgp:* A7A9 24DE 638C 681A 8DEA FAD4 2B5D C759 B1EB 76A7
> <https://pgp.mit.edu/pks/lookup?op=get&search=0x2B5DC759B1EB76A7>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message