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, **kwargs)[source]

Bases: watcher.objects.base.WatcherObject

create(context=None)[source]

Create a Action record in the DB.

Parameters:context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: Action(context)
destroy(context=None)[source]

Delete the action plan from the DB.

Parameters:context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: Action(context)
classmethod get(context, action_plan_id)[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.
Returns:a Action object.
classmethod get_by_id(context, action_plan_id)[source]

Find a action_plan based on its integer id and return a Action object.

Parameters:action_plan_id – the id of a action_plan.
Returns:a Action object.
classmethod get_by_uuid(context, uuid)[source]

Find a action_plan based on uuid and return a Action object.

Parameters:
  • uuid – the uuid of a action_plan.
  • context – Security context
Returns:

a Action object.

classmethod list(context, limit=None, marker=None, filters=None, sort_key=None, sort_dir=None)[source]

Return a list of Action 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”.
Returns:

a list of ActionPlan object.

refresh(context=None)[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.

Parameters:context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: Action(context)
save(context=None)[source]

Save updates to this Action plan.

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

Parameters:context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: Action(context)
soft_delete(context=None)[source]

Soft Delete the Action plan from the DB.

Parameters:context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: Audit(context)
class watcher.objects.action_plan.State[source]

Bases: object

Previous topic

The watcher.objects.action Module

Next topic

The watcher.objects.audit Module

Project Source

This Page