Skip to content

Commit

Permalink
Add documentation for pipescript event handler
Browse files Browse the repository at this point in the history
  • Loading branch information
isbm committed Oct 24, 2024
1 parent 6b0bad7 commit 49e877f
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/evthandlers/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Event Handlers

console_logger
outcome_logger
pipescript

Overview
--------
Expand Down
80 changes: 80 additions & 0 deletions docs/evthandlers/pipescript.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
Pipe Script
===========

.. note::

This document explains how to use **pipescript** event handler.

Synopsis
--------

.. code-block:: text
:caption: Initialisation
handler:
- pipescript
*Pipescript* handler is used to pipe action's response through any script, using STDIN.
User can define what to do with this information further.

.. important::

This handler will react only if action contains return code ``0``, i.e. handler has
a proper response data structure. Otherwise handler will skip the process and
will log an error.

Options
-------

``program``
^^^^^^^^^^

A full command line what needs to be called in event of writing STDIN to the program. Example:

.. code-block:: yaml
:caption: Program definition
program: "/path/to/my/script.pl --some=argument --quiet"
``quiet``
^^^^^^^^^^^

**Optional.** Mute logging. Example:

.. code-block:: yaml
:caption: Mute logging
quiet: true
``format``
^^^^^^^^^^

In what format output needs to be sent to the target program. Options:

- ``yaml``
- ``json``

Example:

.. code-block:: yaml
:caption: Format definition
format: json # or "yaml"
Example
-------

.. code-block:: yaml
:caption: Setup example
events:
# React only on action-wise successful events
$/$/$/0:
handlers:
pipescript
pipescript:
program: /opt/bin/extra-logger.pl
quiet: false
format: json

0 comments on commit 49e877f

Please sign in to comment.