mistral/doc/source/writing_a_plugin_action.rst
Angus Salkeld fc46164d5f Make plugins easier to use
This removes the need for editing mistral.conf and
makes the naming of the plugin more obvious.

Change-Id: Ie6e043eacfd0e413d81690f7c5978fd7bbec171d
2014-07-03 18:24:57 -10:00

39 lines
723 B
ReStructuredText

How to write an Action Plugin
=============================
1. Write a class based on mistral.actions.base.Actions
::
from mistral.actions import base
class RunnerAction(base.Action):
def __init__(self, param):
# store the incomming params
self.param = param
def run(self):
# return your results here
return {'status': 0}
2. Publish the class in a namespace
(in your setup.cfg)
::
[entry_points]
mistral.actions =
example.runner = my.mistral_plugins.somefile:RunnerAction
3. Use your plugin
* Now you can call the action "example.runner"
::
Workflow:
tasks:
myaction:
action: example.runner
parameters:
param: avalue_to_pass_in