Add a generic and extensible way to describe the flow of actions

In watcher, an audit generates a set of actions which
aims at achieving a given goal (lower energy consumption, ...).
It is possible to configure different strategies in order to achieve
each goal. Each strategy is written as a Python class which produces
a set of actions. Today, the set of possible actions is fixed for a
given version of Watcher and enables optimization algorithms to
include actions such as instance migration, changing hypervisor state,
changing power state (ACPI level, ...).

This patchset propose a generic and extensible way to describe
the actions and his parameters that we want to add to Action Plan.
It also remove the static actions because they are now deprecated.

The documentation regarding strategy plugin need to be
updated (plugins.rst).

DocImpact
Partially implements: blueprint watcher-add-actions-via-conf

Change-Id: I3d641080e8ad89786abca79a942c8deb2d53355b
This commit is contained in:
Jean-Emile DARTOIS
2016-01-08 12:03:55 +01:00
parent 47759202a8
commit 86d3c2ff89
20 changed files with 191 additions and 524 deletions

View File

@@ -52,7 +52,21 @@ class BaseSolution(object):
self._origin = m
@abc.abstractmethod
def add_change_request(self, r):
def add_action(self,
action_type,
applies_to,
input_parameters=None):
"""Add a new Action in the Action Plan
:param action_type: the unique id of an action type defined in
entry point 'watcher_actions'
:param applies_to: the unique id of the resource to which the
`Action` applies.
:param input_parameters: An array of input parameters provided as
key-value pairs of strings.
Each key-pair contains names and values that match what was previously
defined in the `Action` type schema.
"""
raise NotImplementedError()
@abc.abstractproperty