brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aled Sage (JIRA)" <j...@apache.org>
Subject [jira] [Created] (BROOKLYN-495) CompositeEffector: using results of first call as arg to next call
Date Thu, 27 Apr 2017 14:10:04 GMT
Aled Sage created BROOKLYN-495:
----------------------------------

             Summary: CompositeEffector: using results of first call as arg to next call
                 Key: BROOKLYN-495
                 URL: https://issues.apache.org/jira/browse/BROOKLYN-495
             Project: Brooklyn
          Issue Type: Improvement
            Reporter: Aled Sage
            Priority: Minor


When using {{CompositeEffector}} in yaml, I'd like to use the result of one effector as an
argument to the next effector in the chain.

If we had https://issues.apache.org/jira/browse/BROOKLYN-494, then a workaround could be to
have the first effector set a sensor. For example:

{noformat}
location: localhost
   
services:
- type: org.apache.brooklyn.entity.machine.MachineEntity
  brooklyn.initializers:
  - type: org.apache.brooklyn.core.effector.http.HttpCommandEffector
    brooklyn.config:
      name: httpEffector
  - type: org.apache.brooklyn.core.effector.ssh.SshCommandEffector
    brooklyn.config:
      name: execCommand
  - type: org.apache.brooklyn.core.effector.CompositeEffector
    brooklyn.config:
      name: start
      effectors:
      - name: httpEffector
        args:
          uri:
            $brooklyn:formatString:
            - http://%s:8081/initSomething
            - $brooklyn:attributeWhenReady("host.name")
          httpVerb: POST
          httpPayload: someHttpBody
          jsonPath: "$.myKey"
          publishSensor: someIdentity
      - name: execCommand
        args:
          command: doSomething.sh ${SOME_IDENTITY}
          env:
            SOME_IDENTITY: $brooklyn:attributeWhenReady("someIdentity")
{noformat}

However, not all such effectors support the {{publishSensor}} (e.g. it is not supported by
{{SshCommandEffector}}.




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message