Abstract Plugin API
- class zambeze.orchestration.plugin_modules.abstract_plugin.Plugin(name: str, logger: Optional[Logger] = None)
Abstract base class for ensuring that all registered plugins have the same interface
- Parameters
logger (Optional[logging.Logger]) – The logger where to log information/warning or errors.
- abstract check(arguments: list[dict]) list[dict]
Determine if the proposed arguments can be executed by this instance.
- Parameters
arguments – The arguments are checked to ensure their types and
formats are valid :type arguments: list[dict] :return: Returns the list of actions that are vaid :rtype: list[dict] with the actions valid actions listed with bool set to True and invalid ones False, along with a message.
- Example
>>> arguments = >>> [ >>> { "action1": { "dothis": ...} }, >>> { "action2": { "dothat": ...} }, >>> ] >>> checked_actions = plugin.check(arguments) >>> for action in checked_actions: >>> print(f"{action}: {checked_actions[action]}") >>> # Should print >>> # action1 True, "" >>> # action2 False, "This was the problem"
- abstract configure(config: dict) None
Configure this set up the plugin.
- abstract property info: dict
This method is to be used after configuration step and will return information about the plugin such as configuration settings and defaults.
- property name: str
Returns the name of the plugin.
The name of the plugin, should be lower case
- Returns
Name of the plugin
- Return type
string
- abstract process(arguments: list[dict]) dict
Will run the plugin with the provided arguments