From 6700e6c2ac4876e818fb7f10666acd02a5d2bef7 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 7 Apr 2020 20:47:37 +0200 Subject: [PATCH] os-firewall: add new endpoints (using extended template) for https://github.com/opnsense/plugins/issues/1749 --- source/development/api/plugins/firewall.rst | 28 +++++++++++++++---- .../development/api/plugins/firewall.rst.in | 11 ++++++-- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/source/development/api/plugins/firewall.rst b/source/development/api/plugins/firewall.rst index 3bac34c2c..5910664da 100644 --- a/source/development/api/plugins/firewall.rst +++ b/source/development/api/plugins/firewall.rst @@ -6,21 +6,39 @@ a user interface, it's main focus is only to provide machine to machine interact for selected features. -.. csv-table:: Resources (FilterController.php) +.. csv-table:: Abstract [non-callable] (FilterBaseController.php) + :header: "Method", "Module", "Controller", "Command", "Parameters" + :widths: 4, 15, 15, 30, 40 + + "``POST``","firewall","filter_base","apply","$rollback_revision=null" + "``POST``","firewall","filter_base","cancelRollback","$rollback_revision" + "``POST``","firewall","filter_base","revert","$revision" + "``POST``","firewall","filter_base","savepoint","" + + "``<>``", "", "", "", "*model* `Filter.xml `__" + +.. csv-table:: Resources (FilterController.php) -- extends : FilterBaseController :header: "Method", "Module", "Controller", "Command", "Parameters" :widths: 4, 15, 15, 30, 40 "``POST``","firewall","filter","addRule","" - "``POST``","firewall","filter","apply","$rollback_revision=null" - "``POST``","firewall","filter","cancelRollback","$rollback_revision" "``POST``","firewall","filter","delRule","$uuid" "``GET``","firewall","filter","getRule","$uuid=null" - "``POST``","firewall","filter","revert","$revision" - "``POST``","firewall","filter","savepoint","" "``*``","firewall","filter","searchRule","" "``POST``","firewall","filter","setRule","$uuid" "``POST``","firewall","filter","toggleRule","$uuid,$enabled=null" +.. csv-table:: Resources (SourceNatController.php) -- extends : FilterBaseController + :header: "Method", "Module", "Controller", "Command", "Parameters" + :widths: 4, 15, 15, 30, 40 + + "``POST``","firewall","source_nat","addRule","" + "``POST``","firewall","source_nat","delRule","$uuid" + "``GET``","firewall","source_nat","getRule","$uuid=null" + "``*``","firewall","source_nat","searchRule","" + "``POST``","firewall","source_nat","setRule","$uuid" + "``POST``","firewall","source_nat","toggleRule","$uuid,$enabled=null" + ----------------------- diff --git a/source/development/api/plugins/firewall.rst.in b/source/development/api/plugins/firewall.rst.in index 4e72fc83c..aef94a7d2 100644 --- a/source/development/api/plugins/firewall.rst.in +++ b/source/development/api/plugins/firewall.rst.in @@ -6,12 +6,17 @@ a user interface, it's main focus is only to provide machine to machine interact for selected features. {% for controller in controllers %} -.. csv-table:: {{controller.type}} ({{controller.filename}}) +.. csv-table:: {{controller.type}} ({{controller.filename}}) {% if not controller.is_abstract %} -- extends : {{controller.base_class}} {% endif %} :header: "Method", "Module", "Controller", "Command", "Parameters" :widths: 4, 15, 15, 30, 40 -{% for endpoint in controller.endpoints %} +{% for endpoint in controller.endpoints %} "``{{endpoint.method}}``","{{endpoint.module}}","{{endpoint.controller}}","{{endpoint.command}}","{{endpoint.parameters}}" -{%- endfor %} +{%- endfor %} +{%- if controller.uses %} +{% for use in controller.uses %} + "``<>``", "", "", "", "*{{use.type}}* `{{use.name}} <{{use.link}}>`__" +{%- endfor %} +{%- endif %} {% endfor %}