diff --git a/WHATSNEW.md b/WHATSNEW.md index 6b5dca8..d26d880 100644 --- a/WHATSNEW.md +++ b/WHATSNEW.md @@ -1,5 +1,7 @@ ### Added +- Add the layers of fotoobo into the architecture documentation + ### Changed ### Removed diff --git a/docs/source/developer/architecture/5_building_block_view.rst b/docs/source/developer/architecture/5_building_block_view.rst index 526b6f7..1fd15cf 100644 --- a/docs/source/developer/architecture/5_building_block_view.rst +++ b/docs/source/developer/architecture/5_building_block_view.rst @@ -7,10 +7,65 @@ 5. Building Block View ====================== +The layers of fotoobo +--------------------- + +There are three designated layers in **fotoobo**. These are the interface layer, the business logic +layer and the infrastructure layer. + +.. image:: diagrams/fotoobo_layers.drawio.svg + :width: 100% + :alt: The layers of fotoobo visualized + +In this diagram you see the designated paths to use when accessing a Fortinet device. Although these +are the recommended ways to use it, you may also access the layers in other ways. Just keep in mind +there always should be a rational and understandable approach. + + +The Interface Layer +^^^^^^^^^^^^^^^^^^^ + +This is the main entry point for interaction with **fotoobo** when you installed it as an +application on your system. It acts as a frontend for users and automation tools. At the Moment only +the CLI part is implemented. In future version a REST API may be available if there is a need for +it. + +Call **fotoobo** with its command(s) directly from the command line or from any automation engine +like cron jobs, Rundeck or others. + +The Business Logic Layer +^^^^^^^^^^^^^^^^^^^^^^^^ + +At this level you have access to specific use cases. These are called **tools** in **fotoobo**. Any +CLI command or API endpoint should point to such a **tool** which then interacts with the +infrastructure layer. + +Whenever you use **fotoobo** as a module in your own code (instead of using it as an installed +application) you may directly access this layer. + +The Infrastructure Layer +^^^^^^^^^^^^^^^^^^^^^^^^ + +In this lowest level of **fotoobo** we directly interact with the infrastructure, meaning we handle +the authentication and API calls to the devices like FortiGate, FortiManger and others. The +interface layer should not directly access this infrastructure layer. Instead there should always +be a **tool** in the business logic layer which connects these two. No other layer than the +infrastructure layer should directly access any fortinet device. + +As a module in your own code you may also directly use the infrastructure layer. + + Package structure ----------------- -The package structure describes the internal structure of **fotoobo**. +The package structure describes the internal structure of **fotoobo**. The following diagram +visualizes the top level modules in the code. There are direct associations for these modules to +the layers of **fotoobo**: + +* cli: Interface Layer +* tools: Business Logic Layer +* fortinet: Infrastructure Layer + .. image:: diagrams/package_structure.drawio.svg :width: 100% diff --git a/docs/source/developer/architecture/diagrams/fotoobo_layers.drawio.svg b/docs/source/developer/architecture/diagrams/fotoobo_layers.drawio.svg new file mode 100644 index 0000000..b20fa78 --- /dev/null +++ b/docs/source/developer/architecture/diagrams/fotoobo_layers.drawio.svg @@ -0,0 +1,540 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + Infrastructure + +
+
+ + Layer + +
+
+
+
+
+ + Infrastructure... + +
+
+ + + + +
+
+
+ + Interface + +
+
+ + Layer + +
+
+
+
+
+ + Interface... + +
+
+ + + + +
+
+
+ + Business Logic +
+
+ + Layer + +
+
+
+
+
+
+ + Business Logic... + +
+
+ + + + + + + +
+
+
+
+ + CLI + +
+
+
+
+
+ + CLI + +
+
+ + + + +
+
+
+
+ + REST API + +
+
+
+
+
+ + REST API + +
+
+ + + + +
+
+
+ Returns: output to console or file +
+
+
+
+ + Returns: output to console or f... + +
+
+ + + + +
+
+
+ GET /fgt/version +
+ DELETE /fmg/global/address +
+
+
+
+ + GET /fgt/version... + +
+
+ + + + +
+
+
+ fgt get version +
+ fgt monitor hamaster +
+
+
+
+ + fgt get version... + +
+
+ + + + +
+
+
+ Returns: json +
+
+
+
+ + Returns: json + +
+
+ + + + +
+
+
+
+ + High Level Methods + +
+
+
+
+
+ + High Level Methods + +
+
+ + + + +
+
+
+
+ + Low Level Methods + +
+
+
+
+
+ + Low Level Methods + +
+
+ + + + +
+
+
+
+ + Native Methods + +
+
+
+
+
+ + Native Methods + +
+
+ + + + +
+
+
+ fgt/get/version() +
+ fgt/monitor/hamaster() +
+
+
+
+ + fgt/get/version()... + +
+
+ + + + +
+
+
+ fortigate/get_version() +
+ fortimanager/get_adoms() +
+
+
+
+ + fortigate/get_version()... + +
+
+ + + + +
+
+
+ fortigate/api() +
+ fortimanager/api_get() +
+
+
+
+ + fortigate/api()... + +
+
+ + + + +
+
+
+ Returns: fotoobo Result +
+
+
+
+ + Returns: fotoobo Result + +
+
+ + + + +
+
+
+ Returns: Datastructure +
+
+
+
+ + Returns: Datastructure + +
+
+ + + + +
+
+
+ Returns: requests.Response +
+
+
+
+ + Returns: requests.Response + +
+
+ + + + + + + + + +
+
+
+ + User + +
+
+
+
+ + User + +
+
+ + + + +
+
+
+
+ + Machine + +
+
+
+
+
+ + Machine + +
+
+ + + + + + + + +
+
+
+
+ + External + +
+
+ + Scripts + +
+
+
+
+
+ + External... + +
+
+ + + + + +
+
+
+ FortiGate +
+
+
+
+ + FortiGate + +
+
+ + + + + + + +
+
+
+ FortiManager +
+
+
+
+ + FortiManager + +
+
+ + + + +
+
+
+ FortiAnalyzer +
+
+
+
+ + FortiAnalyzer + +
+
+ + + + +
+
+
+ FortiClientEMS +
+
+
+
+ + FortiClientEMS + +
+
+
+ + + + + Text is not SVG - cannot display + + + +
\ No newline at end of file diff --git a/docs/source/developer/architecture/diagrams/package_structure.drawio.svg b/docs/source/developer/architecture/diagrams/package_structure.drawio.svg index f23a534..8a916d9 100644 --- a/docs/source/developer/architecture/diagrams/package_structure.drawio.svg +++ b/docs/source/developer/architecture/diagrams/package_structure.drawio.svg @@ -1,4 +1,4 @@ - + @@ -43,13 +43,13 @@
- Fortinet + fortinet
- Fortinet + fortinet @@ -145,13 +145,13 @@
- Fortinet + fortinet
- Fortinet + fortinet @@ -162,13 +162,13 @@
- FortiAnalyzer + fortianalyzer
- FortiAnalyzer + fortianalyzer @@ -179,13 +179,13 @@
- FortiGate + fortigate
- FortiGate + fortigate @@ -196,13 +196,13 @@
- FortiManager + fortimanager
- FortiManager + fortimanager @@ -281,13 +281,13 @@
- FortiClientEMS + forticlientems
- FortiClientEMS + forticlientems @@ -361,7 +361,7 @@ -
+
tools @@ -369,7 +369,7 @@
- + tools @@ -417,7 +417,7 @@ -
+
inventory @@ -425,7 +425,7 @@
- + inventory @@ -471,7 +471,7 @@ -
+
exceptions @@ -479,7 +479,7 @@
- + exceptions