brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreaturli <...@git.apache.org>
Subject [GitHub] brooklyn-docs pull request #194: Feature/effectors
Date Wed, 07 Jun 2017 08:24:38 GMT
Github user andreaturli commented on a diff in the pull request:

    https://github.com/apache/brooklyn-docs/pull/194#discussion_r120562822
  
    --- Diff: guide/blueprints/effectors.md ---
    @@ -0,0 +1,167 @@
    +---
    +title: Effectors
    +layout: website-normal
    +---
    +
    +Effectors perform an operation of some kind, carried out by a Brooklyn Entity.
    +They can be manually invoked or triggered by a Policy.
    +
    +Common uses of a effector include the following:
    +
    +*	perform a command on a remote machine,
    +*	collect data and publish them to sensors.
    +
    +Entities have default effectors, the lifecycle management effectors like ``start``, ``stop``,
``restart``, and clearly more ``Effectors`` can be attached to them.
    +
    +Off-the-Shelf Effectors
    +----------------------
    +
    +Effectors are highly reusable as their inputs, thresholds and targets are customizable.
    +
    +### SSHCommandEffector
    +
    +An ```Effector``` to invoke a command on a node accessible via SSH.
    +
    +It allows to execute a ```command``` in a specific ```execution director``` (executionDir)
by using a custom ```shell environment` (shellEnv).
    +By default, the specified command will be executed on the entity where the effector is
attached or on all *children* or all *members* (if it is a group) by configuring ```executionTarget```.
    +
    +Here a simple example of an ```SshCommandEffector``` definition:
    +
    +{% highlight yaml %}
    +  brooklyn.initializers:
    +  - type: org.apache.brooklyn.core.effector.ssh.SshCommandEffector
    +    brooklyn.config:
    +      name: sayHiNetcat
    +      description: Echo a small hello string to the netcat entity
    +      command: |
    +        echo $message | nc $TARGET_HOSTNAME 4321
    +      parameters:
    +        message:
    +          description: The string to pass to netcat
    +          defaultValue: hi netcat
    +{% endhighlight %}
    +
    +See [```here```](https://brooklyn.apache.org/v/latest/misc/javadoc/org/apache/brooklyn/core/effector/ssh/SshCommandEffector.html)
for more details.
    +
    +### HTTPCommandEffector
    +
    +An ```Effector``` to invoke REST endpoints.
    +
    +It allows to specify the URI, the HTTP verb, credentials for authentication and HTTP
headers.
    --- End diff --
    
    I've added tables, thanks!


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

Mime
View raw message