You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by "Aled Sage (JIRA)" <ji...@apache.org> on 2017/04/27 14:10:04 UTC

[jira] [Created] (BROOKLYN-495) CompositeEffector: using results of first call as arg to next call

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)