[doc] Update rule engine document
This commit is contained in:
		
							
								
								
									
										
											BIN
										
									
								
								doc/source/images/rules_engine_class_model.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								doc/source/images/rules_engine_class_model.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 8.6 KiB  | 
							
								
								
									
										23
									
								
								doc/source/images/src/rules_engine_class_model.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								doc/source/images/src/rules_engine_class_model.txt
									
									
									
									
									
										Normal 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
 | 
			
		||||
@@ -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
 | 
			
		||||
-----------------
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user