From 397bb3497e02b14c704e77597f9d238a5f02a2c0 Mon Sep 17 00:00:00 2001 From: Larry Rensing Date: Thu, 24 Mar 2016 15:14:42 +0000 Subject: [PATCH] Invalid states for Action Plan in the glossary The list of possible states for Action Plan objects was outdated, and was updated to match the state machine diagram. A reference to the state machines for Audits and Action Plans were added to the glossary, and the descriptions of each state were moved to the sections containing the state machines within the Architecture page. Change-Id: I27043ad864c02fff50fb31868b27dc4b4897dbd4 Closes-Bug: #1558464 --- doc/source/architecture.rst | 47 +++++++++++++++++++++++ watcher/api/controllers/v1/action_plan.py | 21 ++-------- watcher/api/controllers/v1/audit.py | 24 +----------- 3 files changed, 52 insertions(+), 40 deletions(-) diff --git a/doc/source/architecture.rst b/doc/source/architecture.rst index 6a9c66140..df7cfa94e 100644 --- a/doc/source/architecture.rst +++ b/doc/source/architecture.rst @@ -361,6 +361,28 @@ State Machine diagrams Audit State Machine ------------------- +An :ref:`Audit ` has a life-cycle and its current state may +be one of the following: + +- **PENDING** : a request for an :ref:`Audit ` has been + submitted (either manually by the + :ref:`Administrator ` or automatically via some + event handling mechanism) and is in the queue for being processed by the + :ref:`Watcher Decision Engine ` +- **ONGOING** : the :ref:`Audit ` is currently being + processed by the + :ref:`Watcher Decision Engine ` +- **SUCCEEDED** : the :ref:`Audit ` has been executed + successfully and at least one solution was found +- **FAILED** : an error occured while executing the + :ref:`Audit ` +- **DELETED** : the :ref:`Audit ` is still stored in the + :ref:`Watcher database ` but is not returned + any more through the Watcher APIs. +- **CANCELLED** : the :ref:`Audit ` was in **PENDING** or + **ONGOING** state and was cancelled by the + :ref:`Administrator ` + The following diagram shows the different possible states of an :ref:`Audit ` and what event makes the state change to a new value: @@ -373,6 +395,31 @@ value: Action Plan State Machine ------------------------- +An :ref:`Action Plan ` has a life-cycle and its current +state may be one of the following: + +- **RECOMMENDED** : the :ref:`Action Plan ` is waiting + for a validation from the :ref:`Administrator ` +- **PENDING** : a request for an :ref:`Action Plan ` + has been submitted (due to an + :ref:`Administrator ` executing an + :ref:`Audit `) and is in the queue for + being processed by the :ref:`Watcher Applier ` +- **ONGOING** : the :ref:`Action Plan ` is currently + being processed by the :ref:`Watcher Applier ` +- **SUCCEEDED** : the :ref:`Action Plan ` has been + executed successfully (i.e. all :ref:`Actions ` that it + contains have been executed successfully) +- **FAILED** : an error occured while executing the + :ref:`Action Plan ` +- **DELETED** : the :ref:`Action Plan ` is still + stored in the :ref:`Watcher database ` but is + not returned any more through the Watcher APIs. +- **CANCELLED** : the :ref:`Action Plan ` was in + **PENDING** or **ONGOING** state and was cancelled by the + :ref:`Administrator ` + + The following diagram shows the different possible states of an :ref:`Action Plan ` and what event makes the state change to a new value: diff --git a/watcher/api/controllers/v1/action_plan.py b/watcher/api/controllers/v1/action_plan.py index adcd74468..d7e5924c7 100644 --- a/watcher/api/controllers/v1/action_plan.py +++ b/watcher/api/controllers/v1/action_plan.py @@ -49,24 +49,9 @@ standard workflow model description formats such as `Business Process Model and Notation 2.0 (BPMN 2.0) `_ or `Unified Modeling Language (UML) `_. -An :ref:`Action Plan ` has a life-cycle and its current -state may be one of the following: - -- **RECOMMENDED** : the :ref:`Action Plan ` is waiting - for a validation from the :ref:`Administrator ` -- **ONGOING** : the :ref:`Action Plan ` is currently - being processed by the :ref:`Watcher Applier ` -- **SUCCEEDED** : the :ref:`Action Plan ` has been - executed successfully (i.e. all :ref:`Actions ` that it - contains have been executed successfully) -- **FAILED** : an error occured while executing the - :ref:`Action Plan ` -- **DELETED** : the :ref:`Action Plan ` is still - stored in the :ref:`Watcher database ` but is - not returned any more through the Watcher APIs. -- **CANCELLED** : the :ref:`Action Plan ` was in - **PENDING** or **ONGOING** state and was cancelled by the - :ref:`Administrator ` +To see the life-cycle and description of +:ref:`Action Plan ` states, visit :ref:`the Action Plan state +machine `. """ # noqa import datetime diff --git a/watcher/api/controllers/v1/audit.py b/watcher/api/controllers/v1/audit.py index 296e0adf9..8cee072cf 100644 --- a/watcher/api/controllers/v1/audit.py +++ b/watcher/api/controllers/v1/audit.py @@ -25,28 +25,8 @@ on a given :ref:`Cluster `. For each :ref:`Audit `, the Watcher system generates an :ref:`Action Plan `. -An :ref:`Audit ` has a life-cycle and its current state may -be one of the following: - -- **PENDING** : a request for an :ref:`Audit ` has been - submitted (either manually by the - :ref:`Administrator ` or automatically via some - event handling mechanism) and is in the queue for being processed by the - :ref:`Watcher Decision Engine ` -- **ONGOING** : the :ref:`Audit ` is currently being - processed by the - :ref:`Watcher Decision Engine ` -- **SUCCEEDED** : the :ref:`Audit ` has been executed - successfully (note that it may not necessarily produce a - :ref:`Solution `). -- **FAILED** : an error occured while executing the - :ref:`Audit ` -- **DELETED** : the :ref:`Audit ` is still stored in the - :ref:`Watcher database ` but is not returned - any more through the Watcher APIs. -- **CANCELLED** : the :ref:`Audit ` was in **PENDING** or - **ONGOING** state and was cancelled by the - :ref:`Administrator ` +To see the life-cycle and description of an :ref:`Audit ` +states, visit :ref:`the Audit State machine `. """ import datetime