From d601e10e221020255df83b45435bc72616ba6986 Mon Sep 17 00:00:00 2001 From: hansmi Date: Sun, 17 Sep 2023 14:37:54 +0200 Subject: [PATCH] Add support for "tool netwatch" (#216) Upstream documentation: https://help.mikrotik.com/docs/display/ROS/Netwatch Signed-off-by: Michael Hanselmann --- .../fragments/216-add-tool-netwatch.yml | 2 + plugins/module_utils/_api_data.py | 38 +++++++++++++++++++ plugins/modules/api_info.py | 1 + plugins/modules/api_modify.py | 1 + 4 files changed, 42 insertions(+) create mode 100644 changelogs/fragments/216-add-tool-netwatch.yml diff --git a/changelogs/fragments/216-add-tool-netwatch.yml b/changelogs/fragments/216-add-tool-netwatch.yml new file mode 100644 index 00000000..6e4d45f0 --- /dev/null +++ b/changelogs/fragments/216-add-tool-netwatch.yml @@ -0,0 +1,2 @@ +minor_changes: + - api_info, api_modify - add support for the ``tool netwatch`` path in RouterOS 7 (https://github.com/ansible-collections/community.routeros/pull/216). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 09396754..e581bc40 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -3168,6 +3168,44 @@ def join_path(path): }, ), ), + ('tool', 'netwatch'): APIData( + versioned=[ + ('7', '>=', VersionedAPIData( + fully_understood=True, + primary_keys=('name', ), + fields={ + 'certificate': KeyInfo(), + 'check-certificate': KeyInfo(), + 'comment': KeyInfo(), + 'disabled': KeyInfo(default=False), + 'down-script': KeyInfo(), + 'host': KeyInfo(required=True), + 'http-codes': KeyInfo(), + 'interval': KeyInfo(), + 'name': KeyInfo(), + 'packet-count': KeyInfo(), + 'packet-interval': KeyInfo(), + 'packet-size': KeyInfo(), + 'port': KeyInfo(), + 'src-address': KeyInfo(), + 'start-delay': KeyInfo(), + 'startup-delay': KeyInfo(), + 'test-script': KeyInfo(), + 'thr-avg': KeyInfo(), + 'thr-http-time': KeyInfo(), + 'thr-jitter': KeyInfo(), + 'thr-loss-count': KeyInfo(), + 'thr-loss-percent': KeyInfo(), + 'thr-max': KeyInfo(), + 'thr-stdev': KeyInfo(), + 'thr-tcp-conn-time': KeyInfo(), + 'timeout': KeyInfo(), + 'type': KeyInfo(default='simple'), + 'up-script': KeyInfo(), + }, + )), + ], + ), ('tool', 'romon'): APIData( unversioned=VersionedAPIData( single_value=True, diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index ca8347f6..eca87d2a 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -190,6 +190,7 @@ - tool mac-server - tool mac-server mac-winbox - tool mac-server ping + - tool netwatch - tool romon - tool sms - tool sniffer diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index 6d65c80d..39105166 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -199,6 +199,7 @@ - tool mac-server - tool mac-server mac-winbox - tool mac-server ping + - tool netwatch - tool romon - tool sms - tool sniffer