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:

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.
destroy(*args, **kwargs)[source]

Delete the action plan from the DB

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)

save(*args, **kwargs)[source]

Save updates to this Action plan.

Updates will be made column by column based on the result of self.what_changed().

soft_delete(*args, **kwargs)[source]

Soft Delete the Action plan from the DB

class watcher.objects.action_plan.State[source]

Bases: object

class watcher.objects.action_plan.StateManager[source]

Bases: object

check_expired(context)[source]