The watcher.decision_engine.solution.base Module

The watcher.decision_engine.solution.base Module

A Solution is the result of execution of a strategy (i.e., an algorithm). Each solution is composed of many pieces of information:

  • A set of actions generated by the strategy in order to achieve the goal of an associated audit.
  • A set of efficacy indicators as defined by the associated goal
  • A global efficacy which is computed by the associated goal using the aforementioned efficacy indicators.

A Solution is different from an Action Plan because it contains the non-scheduled list of Actions which is produced by a Strategy. In other words, the list of Actions in a Solution has not yet been re-ordered by the Watcher Planner.

Note that some algorithms (i.e. Strategies) may generate several Solutions. This gives rise to the problem of determining which Solution should be applied.

Two approaches to dealing with this can be envisaged:

class watcher.decision_engine.solution.base.BaseSolution(goal, strategy)[source]

Bases: object

add_action(action_type, resource_id, input_parameters=None)[source]

Add a new Action in the Solution

Parameters:
  • action_type – the unique id of an action type defined in entry point ‘watcher_actions’
  • resource_id – the unique id of the resource to which the Action applies.
  • 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.
compute_global_efficacy()[source]

Compute the global efficacy given a map of efficacy indicators

set_efficacy_indicators(**indicators_map)[source]

Set the efficacy indicators mapping (no validation)

Parameters:indicators_map (dict {str: object}) – mapping between the indicator name and its value
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.