From 193218446a3b0ff38f1403f3343f73f77b75af0c Mon Sep 17 00:00:00 2001 From: hansmi Date: Sat, 26 Aug 2023 11:23:14 +0200 Subject: [PATCH] Add support for "iot modbus" (#205) The default values match those of RouterOS 7.11 on a Mikrotik RB924i-2nD-BT5&BG77 ("Knot"). Upstream documentation: https://help.mikrotik.com/docs/pages/viewpage.action?pageId=61046813 Signed-off-by: Michael Hanselmann --- changelogs/fragments/205-add-iot-modbus.yml | 2 ++ plugins/module_utils/_api_data.py | 10 ++++++++++ plugins/modules/api_info.py | 1 + plugins/modules/api_modify.py | 1 + 4 files changed, 14 insertions(+) create mode 100644 changelogs/fragments/205-add-iot-modbus.yml diff --git a/changelogs/fragments/205-add-iot-modbus.yml b/changelogs/fragments/205-add-iot-modbus.yml new file mode 100644 index 00000000..90a5875d --- /dev/null +++ b/changelogs/fragments/205-add-iot-modbus.yml @@ -0,0 +1,2 @@ +minor_changes: + - api_info, api_modify - add support for the ``iot modbus`` path (https://github.com/ansible-collections/community.routeros/pull/205). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 2a6f3f22..28ff4e53 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -1423,6 +1423,16 @@ def join_path(path): 'receive-errors': KeyInfo(default=False), }, ), + ('iot', 'modbus'): APIData( + single_value=True, + fully_understood=True, + fields={ + 'disabled': KeyInfo(default=True), + 'hardware-port': KeyInfo(default='modbus'), + 'tcp-port': KeyInfo(default=502), + 'timeout': KeyInfo(default=1000), + }, + ), ('ip', 'accounting'): APIData( single_value=True, fully_understood=True, diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index 11e3fb68..165c0dbc 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -86,6 +86,7 @@ - interface wireless security-profiles - interface wireless sniffer - interface wireless snooper + - iot modbus - ip accounting - ip accounting web-access - ip address diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index 0b504373..8e6123a5 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -91,6 +91,7 @@ - interface wireless security-profiles - interface wireless sniffer - interface wireless snooper + - iot modbus - ip accounting - ip accounting web-access - ip address