diff --git a/doc/source/architecture.rst b/doc/source/architecture.rst index de465b701..2696658c4 100644 --- a/doc/source/architecture.rst +++ b/doc/source/architecture.rst @@ -171,12 +171,12 @@ This component is responsible for computing a set of potential optimization :ref:`Actions ` in order to fulfill the :ref:`Goal ` of an :ref:`Audit `. -It first reads the parameters of the :ref:`Audit ` from the -associated :ref:`Audit Template ` and knows the -:ref:`Goal ` to achieve. +It first reads the parameters of the :ref:`Audit ` to know +the :ref:`Goal ` to achieve. -It then selects the most appropriate :ref:`Strategy ` -from the list of available strategies achieving this goal. +Unless specified, it then selects the most appropriate :ref:`strategy +` from the list of available strategies achieving this +goal. The :ref:`Strategy ` is then dynamically loaded (via `stevedore `_). The @@ -290,7 +290,7 @@ the Audit parameters from the :ref:`Watcher Database `. It instantiates the appropriate :ref:`strategy ` (using entry points) given both the :ref:`goal ` and the strategy associated to the -parent :ref:`audit template ` of the :ref:`Audit +parent :ref:`audit template ` of the :ref:`audit `. If no strategy is associated to the audit template, the strategy is dynamically selected by the Decision Engine. diff --git a/doc/source/image_src/plantuml/watcher_db_schema_diagram.txt b/doc/source/image_src/plantuml/watcher_db_schema_diagram.txt index 823e442e8..b97d1ee20 100644 --- a/doc/source/image_src/plantuml/watcher_db_schema_diagram.txt +++ b/doc/source/image_src/plantuml/watcher_db_schema_diagram.txt @@ -5,11 +5,12 @@ hide methods hide stereotypes -table(goal) { +table(goals) { primary_key(id: Integer) uuid : String[36] name : String[63] display_name : String[63] + efficacy_specification : JSONEncodedList, nullable created_at : DateTime updated_at : DateTime @@ -18,12 +19,13 @@ table(goal) { } -table(strategy) { +table(strategies) { primary_key(id: Integer) foreign_key(goal_id : Integer) uuid : String[36] name : String[63] display_name : String[63] + parameters_spec : JSONEncodedDict, nullable created_at : DateTime updated_at : DateTime @@ -32,7 +34,7 @@ table(strategy) { } -table(audit_template) { +table(audit_templates) { primary_key(id: Integer) foreign_key("goal_id : Integer") foreign_key("strategy_id : Integer, nullable") @@ -50,14 +52,17 @@ table(audit_template) { } -table(audit) { +table(audits) { primary_key(id: Integer) - foreign_key("audit_template_id : Integer") + foreign_key("goal_id : Integer") + foreign_key("strategy_id : Integer, nullable") uuid : String[36] audit_type : String[20] state : String[20], nullable - deadline :DateTime, nullable + deadline : DateTime, nullable interval : Integer, nullable + parameters : JSONEncodedDict, nullable + host_aggregate : Integer, nullable created_at : DateTime updated_at : DateTime @@ -66,9 +71,10 @@ table(audit) { } -table(action_plan) { +table(action_plans) { primary_key(id: Integer) foreign_key("audit_id : Integer, nullable") + foreign_key("strategy_id : Integer") uuid : String[36] first_action_id : Integer state : String[20], nullable @@ -81,7 +87,7 @@ table(action_plan) { } -table(action) { +table(actions) { primary_key(id: Integer) foreign_key("action_plan_id : Integer") uuid : String[36] @@ -97,7 +103,7 @@ table(action) { } -table(efficacy_indicator) { +table(efficacy_indicators) { primary_key(id: Integer) foreign_key("action_plan_id : Integer") uuid : String[36] @@ -112,12 +118,27 @@ table(efficacy_indicator) { deleted : Integer } - "goal" <.. "strategy" : Foreign Key - "goal" <.. "audit_template" : Foreign Key - "strategy" <.. "audit_template" : Foreign Key - "audit_template" <.. "audit" : Foreign Key - "action_plan" <.. "action" : Foreign Key - "action_plan" <.. "efficacy_indicator" : Foreign Key - "audit" <.. "action_plan" : Foreign Key +table(scoring_engines) { + primary_key(id: Integer) + uuid : String[36] + name : String[63] + description : String[255], nullable + metainfo : Text, nullable + + created_at : DateTime + updated_at : DateTime + deleted_at : DateTime + deleted : Integer +} + + "goals" <.. "strategies" : Foreign Key + "goals" <.. "audit_templates" : Foreign Key + "strategies" <.. "audit_templates" : Foreign Key + "goals" <.. "audits" : Foreign Key + "strategies" <.. "audits" : Foreign Key + "action_plans" <.. "actions" : Foreign Key + "action_plans" <.. "efficacy_indicators" : Foreign Key + "strategies" <.. "action_plans" : Foreign Key + "audits" <.. "action_plans" : Foreign Key @enduml diff --git a/doc/source/images/watcher_db_schema_diagram.png b/doc/source/images/watcher_db_schema_diagram.png index f85758dac..971d7679b 100644 Binary files a/doc/source/images/watcher_db_schema_diagram.png and b/doc/source/images/watcher_db_schema_diagram.png differ