From 00ef1af0419da0828d791a80816b51d566f5bf18 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann Date: Sun, 10 Sep 2023 19:56:45 +0200 Subject: [PATCH] Add support for "tool netwatch" 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 6a154f57..f62ba710 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -3155,6 +3155,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 c616ff45..d73862e3 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -189,6 +189,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 447be9ac..415d0ab2 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -194,6 +194,7 @@ - tool mac-server - tool mac-server mac-winbox - tool mac-server ping + - tool netwatch - tool romon - tool sms - tool sniffer