From b337e4b85cd2fdae133a145dd083a5be13c647f0 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 24 Nov 2022 19:06:26 +0100 Subject: [PATCH] update API docs --- source/development/api/core/diagnostics.rst | 11 +++++++++++ source/development/api/core/firewall.rst | 9 +++++++++ source/development/api/core/firewall.rst.in | 2 +- source/development/api/core/interfaces.rst | 16 ++++++++++++++++ source/development/api/plugins/firewall.rst | 16 +++++++++++++--- source/development/api/plugins/firewall.rst.in | 2 +- source/development/api/plugins/haproxy.rst | 5 +++++ source/development/api/plugins/wireguard.rst | 1 + 8 files changed, 57 insertions(+), 5 deletions(-) diff --git a/source/development/api/core/diagnostics.rst b/source/development/api/core/diagnostics.rst index 1305c1d9..ec7b746e 100644 --- a/source/development/api/core/diagnostics.rst +++ b/source/development/api/core/diagnostics.rst @@ -43,6 +43,7 @@ Diagnostics :header: "Method", "Module", "Controller", "Command", "Parameters" :widths: 4, 15, 15, 30, 40 + "``POST``","diagnostics","interface","CarpStatus","$status" "``POST``","diagnostics","interface","delRoute","" "``POST``","diagnostics","interface","flushArp","" "``GET``","diagnostics","interface","getArp","" @@ -53,9 +54,13 @@ Diagnostics "``GET``","diagnostics","interface","getMemoryStatistics","" "``GET``","diagnostics","interface","getNdp","" "``GET``","diagnostics","interface","getNetisrStatistics","" + "``GET``","diagnostics","interface","getPfSyncNodes","" "``GET``","diagnostics","interface","getProtocolStatistics","" "``GET``","diagnostics","interface","getRoutes","" "``GET``","diagnostics","interface","getSocketStatistics","" + "``GET``","diagnostics","interface","getVipStatus","" + "``GET``","diagnostics","interface","searchArp","" + "``GET``","diagnostics","interface","searchNdp","" .. csv-table:: Resources (LvtemplateController.php) :header: "Method", "Module", "Controller", "Command", "Parameters" @@ -108,6 +113,12 @@ Diagnostics "``<>``", "", "", "", "*model* `PacketCapture.xml `__" +.. csv-table:: Resources (SystemController.php) + :header: "Method", "Module", "Controller", "Command", "Parameters" + :widths: 4, 15, 15, 30, 40 + + "``GET``","diagnostics","system","memory","" + .. csv-table:: Resources (SystemhealthController.php) :header: "Method", "Module", "Controller", "Command", "Parameters" :widths: 4, 15, 15, 30, 40 diff --git a/source/development/api/core/firewall.rst b/source/development/api/core/firewall.rst index 157a4d80..60cb75c0 100644 --- a/source/development/api/core/firewall.rst +++ b/source/development/api/core/firewall.rst @@ -1,3 +1,5 @@ +.. _api_core_firewall: + Firewall ~~~~~~~~ @@ -14,6 +16,7 @@ Firewall "``GET``","firewall","alias","getItem","$uuid=null" "``GET``","firewall","alias","getTableSize","" "``POST``","firewall","alias","import","" + "``GET``","firewall","alias","listCategories","" "``GET``","firewall","alias","listCountries","" "``GET``","firewall","alias","listNetworkAliases","" "``POST``","firewall","alias","reconfigure","" @@ -56,3 +59,9 @@ Firewall :widths: 4, 15, 15, 30, 40 "``GET``","firewall","filter_util","ruleStats","" + + +.. Tip:: + + In order to inject rules using an API, you may take a look at the :ref:`Firewall Plugin API `, + currently the core system does not support rule modifications via the API for this topic. \ No newline at end of file diff --git a/source/development/api/core/firewall.rst.in b/source/development/api/core/firewall.rst.in index 012682a5..b688be37 100644 --- a/source/development/api/core/firewall.rst.in +++ b/source/development/api/core/firewall.rst.in @@ -19,4 +19,4 @@ .. Tip:: In order to inject rules using an API, you may take a look at the :ref:`Firewall Plugin API `, - currently the core system does not support rule modifications via the api for this topic. + currently the core system does not support rule modifications via the API for this topic. diff --git a/source/development/api/core/interfaces.rst b/source/development/api/core/interfaces.rst index cd3c55a1..30000461 100644 --- a/source/development/api/core/interfaces.rst +++ b/source/development/api/core/interfaces.rst @@ -16,6 +16,22 @@ Interfaces "``<>``", "", "", "", "*model* `Loopback.xml `__" +.. csv-table:: Resources (VipSettingsController.php) + :header: "Method", "Module", "Controller", "Command", "Parameters" + :widths: 4, 15, 15, 30, 40 + + "``POST``","interfaces","vip_settings","addItem","" + "``POST``","interfaces","vip_settings","delItem","$uuid" + "``GET``","interfaces","vip_settings","get","" + "``GET``","interfaces","vip_settings","getItem","$uuid=null" + "``GET``","interfaces","vip_settings","getUnusedVhid","" + "``POST``","interfaces","vip_settings","reconfigure","" + "``*``","interfaces","vip_settings","searchItem","" + "``POST``","interfaces","vip_settings","set","" + "``POST``","interfaces","vip_settings","setItem","$uuid" + + "``<>``", "", "", "", "*model* `Vip.xml `__" + .. csv-table:: Resources (VlanSettingsController.php) :header: "Method", "Module", "Controller", "Command", "Parameters" :widths: 4, 15, 15, 30, 40 diff --git a/source/development/api/plugins/firewall.rst b/source/development/api/plugins/firewall.rst index 97e73740..6eda38a2 100644 --- a/source/development/api/plugins/firewall.rst +++ b/source/development/api/plugins/firewall.rst @@ -1,9 +1,19 @@ +.. _api_plugins_firewall: + Firewall ~~~~~~~~ -The firewall API plugin is a first step into migrating the legacy firewall components from OPNsense, although it does contain -a user interface, it's main focus is only to provide machine to machine interaction between custom applications and OPNsense -for selected features. +The firewall API plugin (**os-firewall**) offers a way for machine to machine interaction between custom applications and OPNsense, it can +easily be installed like any other plugin via :menuselection:`System --> Firmware --> Plugins`. + +Although the plugin does contains a basic user interface (in :menuselection:`Firewall --> Automation`), it's mirely intended +as a reference and testbed. There's no relation to any of the rules being managed via the core system. + +.. Tip:: + + Use your browsers "inspect" feature to compare requests easily, the user interface in terms of communication is exactly the same + as offered by the API . Rules not visible in the web interface (:menuselection:`Firewall --> Automation`) will not be returned by the API either. + .. csv-table:: Abstract [non-callable] (FilterBaseController.php) diff --git a/source/development/api/plugins/firewall.rst.in b/source/development/api/plugins/firewall.rst.in index a5cb111e..52f89dda 100644 --- a/source/development/api/plugins/firewall.rst.in +++ b/source/development/api/plugins/firewall.rst.in @@ -12,7 +12,7 @@ as a reference and testbed. There's no relation to any of the rules being manage .. Tip:: Use your browsers "inspect" feature to compare requests easily, the user interface in terms of communication is exactly the same - as offered by the API . Rules not visible in the web interface will not be returned by the API either. + as offered by the API . Rules not visible in the web interface (:menuselection:`Firewall --> Automation`) will not be returned by the API either. {% for controller in controllers %} diff --git a/source/development/api/plugins/haproxy.rst b/source/development/api/plugins/haproxy.rst index 94698b40..eb164f8f 100644 --- a/source/development/api/plugins/haproxy.rst +++ b/source/development/api/plugins/haproxy.rst @@ -51,6 +51,7 @@ Haproxy "``POST``","haproxy","settings","addBackend","" "``POST``","haproxy","settings","addCpu","" "``POST``","haproxy","settings","addErrorfile","" + "``POST``","haproxy","settings","addFcgi","" "``POST``","haproxy","settings","addFrontend","" "``POST``","haproxy","settings","addGroup","" "``POST``","haproxy","settings","addHealthcheck","" @@ -65,6 +66,7 @@ Haproxy "``POST``","haproxy","settings","delBackend","$uuid" "``POST``","haproxy","settings","delCpu","$uuid" "``POST``","haproxy","settings","delErrorfile","$uuid" + "``POST``","haproxy","settings","delFcgi","$uuid" "``POST``","haproxy","settings","delFrontend","$uuid" "``POST``","haproxy","settings","delGroup","$uuid" "``POST``","haproxy","settings","delHealthcheck","$uuid" @@ -80,6 +82,7 @@ Haproxy "``GET``","haproxy","settings","getBackend","$uuid=null" "``GET``","haproxy","settings","getCpu","$uuid=null" "``GET``","haproxy","settings","getErrorfile","$uuid=null" + "``GET``","haproxy","settings","getFcgi","$uuid=null" "``GET``","haproxy","settings","getFrontend","$uuid=null" "``GET``","haproxy","settings","getGroup","$uuid=null" "``GET``","haproxy","settings","getHealthcheck","$uuid=null" @@ -94,6 +97,7 @@ Haproxy "``*``","haproxy","settings","searchBackends","" "``*``","haproxy","settings","searchCpus","" "``*``","haproxy","settings","searchErrorfiles","" + "``*``","haproxy","settings","searchFcgis","" "``*``","haproxy","settings","searchFrontends","" "``*``","haproxy","settings","searchGroups","" "``*``","haproxy","settings","searchHealthchecks","" @@ -109,6 +113,7 @@ Haproxy "``POST``","haproxy","settings","setBackend","$uuid" "``POST``","haproxy","settings","setCpu","$uuid" "``POST``","haproxy","settings","setErrorfile","$uuid" + "``POST``","haproxy","settings","setFcgi","$uuid" "``POST``","haproxy","settings","setFrontend","$uuid" "``POST``","haproxy","settings","setGroup","$uuid" "``POST``","haproxy","settings","setHealthcheck","$uuid" diff --git a/source/development/api/plugins/wireguard.rst b/source/development/api/plugins/wireguard.rst index f5d2ffc8..0b52fd35 100644 --- a/source/development/api/plugins/wireguard.rst +++ b/source/development/api/plugins/wireguard.rst @@ -21,6 +21,7 @@ Wireguard :widths: 4, 15, 15, 30, 40 "``GET``","wireguard","general","get","" + "``GET``","wireguard","general","getStatus","" "``POST``","wireguard","general","set","" "``<>``", "", "", "", "*model* `General.xml `__"