The watcher.objects.action_plan
Module¶
An Action Plan is a flow of Actions that should be executed in order to satisfy a given Goal.
An Action Plan is generated by Watcher when an Audit is successful which implies that the Strategy which was used has found a Solution to achieve the Goal of this Audit.
In the default implementation of Watcher, an Action Plan is only composed of successive Actions (i.e., a Workflow of Actions belonging to a unique branch).
However, Watcher provides abstract interfaces for many of its components, allowing other implementations to generate and handle more complex Action Plan(s) composed of two types of Action Item(s):
- simple Actions: atomic tasks, which means it can not be split into smaller tasks or commands from an OpenStack point of view.
- composite Actions: which are composed of several simple Actions ordered in sequential and/or parallel flows.
An Action Plan may be described using standard workflow model description formats such as Business Process Model and Notation 2.0 (BPMN 2.0) or Unified Modeling Language (UML).
An Action Plan has a life-cycle and its current state may be one of the following:
- RECOMMENDED : the Action Plan is waiting for a validation from the Administrator
- ONGOING : the Action Plan is currently being processed by the Watcher Applier
- SUCCEEDED : the Action Plan has been executed successfully (i.e. all Actions that it contains have been executed successfully)
- FAILED : an error occurred while executing the Action Plan
- DELETED : the Action Plan is still stored in the Watcher database but is not returned any more through the Watcher APIs.
- CANCELLED : the Action Plan was in PENDING or ONGOING state and was cancelled by the Administrator
- SUPERSEDED : the Action Plan was in RECOMMENDED state and was superseded by the Administrator
-
class
watcher.objects.action_plan.
ActionPlan
(context=None, **kwargs)[source]¶ Bases:
watcher.objects.base.WatcherPersistentObject
,watcher.objects.base.WatcherObject
,watcher.objects.base.WatcherObjectDictCompat
-
create
(*args, **kwargs)[source]¶ Create an
ActionPlan
record in the DB.Returns: An ActionPlan
object.
-
classmethod
get
(context, *args, **kwargs)[source]¶ Find a action_plan based on its id or uuid and return a Action object.
Parameters: - action_plan_id – the id or uuid of a action_plan.
- eager – Load object fields if True (Default: False)
Returns: a
Action
object.
-
classmethod
get_by_id
(context, *args, **kwargs)[source]¶ Find a action_plan based on its integer id and return a ActionPlan object.
Parameters: - action_plan_id – the id of a action_plan.
- eager – Load object fields if True (Default: False)
Returns: a
ActionPlan
object.
-
classmethod
get_by_uuid
(context, *args, **kwargs)[source]¶ Find a action_plan based on uuid and return a
ActionPlan
object.Parameters: - uuid – the uuid of a action_plan.
- context – Security context
- eager – Load object fields if True (Default: False)
Returns: a
ActionPlan
object.
-
classmethod
list
(context, *args, **kwargs)[source]¶ Return a list of ActionPlan objects.
Parameters: - context – Security context.
- limit – maximum number of resources to return in a single result.
- marker – pagination marker for large data sets.
- filters – Filters to apply. Defaults to None.
- sort_key – column to sort results by.
- sort_dir – direction to sort. “asc” or “desc”.
- eager – Load object fields if True (Default: False)
Returns: a list of
ActionPlan
object.
-
refresh
(*args, **kwargs)[source]¶ Loads updates for this Action plan.
Loads a action_plan with the same uuid from the database and checks for updated attributes. Updates are applied from the loaded action_plan column by column, if there are any updates. :param eager: Load object fields if True (Default: False)
-