[doc] Update rule engine document

This commit is contained in:
Oleg Gelbukh
2013-10-22 12:30:24 +00:00
parent 94f35651d7
commit 619b99fc34
3 changed files with 39 additions and 14 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@@ -0,0 +1,23 @@
@startuml
package "common.py" {
class "Inspection" {
}
class "Issue" {
}
class "Mark" {
}
class "Error" {
}
class "Version" {
}
}
package "model.py" {
class "Model" {
}
}
Inspection --|> Issue
@enduml

View File

@@ -36,8 +36,8 @@ currently they are defined in "steps.py" file in the directory:
``ostack_validator/inspections/lettuce``. They are based on lettuce framework -
bdd framework for python.
Store, extend and reuse rules
-----------------------------
Store and reuse rules
---------------------
First version of Rubick project stores rules to text files and loads them to
memory at runtime. You can add your own rules to the set using web UI, and those
@@ -51,12 +51,15 @@ by putting them in text files in directory
``ostack_validator/inspections/lettuce``.
Rules file must have name in the following format::
\*.feature.
\*.feature
The main requirement is that all rule conditions and actions in those files must
be written in accordance with code of rule steps in
``ostack-validator/inspections/lettuce/steps.py``.
Extending rules
---------------
Also you can extend rules definition by adding your own steps to steps.py. As
an example::
@@ -77,13 +80,12 @@ find many adapters to OpenStack services configuration data and all additional
information collected from OpenStack nodes. After that you can use you brand
new rule in the scenarios as described above.
In ``common.py`` you can find ``Inspection``, ``Issue``, ``Mark``, ``Error`` and
``Version`` classes for your convenience in rule defining. ``Model.py`` contains
Openstack model based on configuration schemas.
In module ``ostack_validator/common.py`` you can find ``Inspection``, ``Issue``,
``Mark``, ``Error`` and ``Version`` classes for your convenience in rule
defining. Module ``model.py`` contains Openstack model based on configuration
schemas.
putting it in directory ostack_validator/inspections/lettuce with name like
this: *.feature. The main requirement is that all you actions in those files
must be written according to the rules in steps.py.
.. image:: image/rules_engine_class_model.png
Default rule sets
-----------------