From 9fc22be18656961c7f985c48d7909077f294dba9 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Thu, 10 Nov 2022 21:10:24 +0100 Subject: [PATCH] api_modify, api_info: support more fields in existing paths (#121) * Support more paths. * Forgot comma. * Adjust tests. * power-cycle-ping-address and power-cycle-ping-timeout can be unset Co-authored-by: Tomas Herfert <68421396+therfert@users.noreply.github.com> Co-authored-by: Tomas Herfert <68421396+therfert@users.noreply.github.com> --- changelogs/fragments/121-api.yml | 6 ++++++ plugins/module_utils/_api_data.py | 12 ++++++++++++ tests/unit/plugins/modules/test_api_info.py | 2 ++ 3 files changed, 20 insertions(+) create mode 100644 changelogs/fragments/121-api.yml diff --git a/changelogs/fragments/121-api.yml b/changelogs/fragments/121-api.yml new file mode 100644 index 00000000..0452551e --- /dev/null +++ b/changelogs/fragments/121-api.yml @@ -0,0 +1,6 @@ +minor_changes: + - api_modify, api_info - support fields ``combo-mode``, ``comment``, ``fec-mode``, ``mdix-enable``, ``poe-out``, ``poe-priority``, + ``poe-voltage``, ``power-cycle-interval``, ``power-cycle-ping-address``, ``power-cycle-ping-enabled``, ``power-cycle-ping-timeout`` + for path ``interface ethernet`` (https://github.com/ansible-collections/community.routeros/pull/121). + - api_modify, api_info - support field ``hw-offload`` for path ``ip firewall filter`` + (https://github.com/ansible-collections/community.routeros/pull/121). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 88429bf9..aa63a642 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -113,16 +113,27 @@ def join_path(path): 'arp-timeout': KeyInfo(default='auto'), 'auto-negotiation': KeyInfo(default=True), 'bandwidth': KeyInfo(default='unlimited/unlimited'), + 'combo-mode': KeyInfo(can_disable=True), + 'comment': KeyInfo(can_disable=True, remove_value=''), 'disabled': KeyInfo(default=False), + 'fec-mode': KeyInfo(can_disable=True), 'full-duplex': KeyInfo(default=True), 'l2mtu': KeyInfo(default=1598), 'loop-protect': KeyInfo(default='default'), 'loop-protect-disable-time': KeyInfo(default='5m'), 'loop-protect-send-interval': KeyInfo(default='5s'), 'mac-address': KeyInfo(), + 'mdix-enable': KeyInfo(), 'mtu': KeyInfo(default=1500), 'name': KeyInfo(), 'orig-mac-address': KeyInfo(), + 'poe-out': KeyInfo(can_disable=True), + 'poe-priority': KeyInfo(can_disable=True), + 'poe-voltage': KeyInfo(can_disable=True), + 'power-cycle-interval': KeyInfo(), + 'power-cycle-ping-address': KeyInfo(can_disable=True), + 'power-cycle-ping-enabled': KeyInfo(), + 'power-cycle-ping-timeout': KeyInfo(can_disable=True), 'rx-flow-control': KeyInfo(default='off'), 'sfp-rate-select': KeyInfo(default='high'), 'sfp-shutdown-temperature': KeyInfo(default='95C'), @@ -890,6 +901,7 @@ def join_path(path): 'dst-port': KeyInfo(can_disable=True), 'fragment': KeyInfo(can_disable=True), 'hotspot': KeyInfo(can_disable=True), + 'hw-offload': KeyInfo(can_disable=True), 'icmp-options': KeyInfo(can_disable=True), 'in-bridge-port': KeyInfo(can_disable=True), 'in-bridge-port-list': KeyInfo(can_disable=True), diff --git a/tests/unit/plugins/modules/test_api_info.py b/tests/unit/plugins/modules/test_api_info.py index e9e06963..70a5ab6d 100644 --- a/tests/unit/plugins/modules/test_api_info.py +++ b/tests/unit/plugins/modules/test_api_info.py @@ -212,6 +212,7 @@ def test_disabled_exclamation(self, mock_compose_api_path): '!dst-port': None, '!fragment': None, '!hotspot': None, + '!hw-offload': None, '!icmp-options': None, '!in-bridge-port': None, '!in-bridge-port-list': None, @@ -295,6 +296,7 @@ def test_disabled_null_value(self, mock_compose_api_path): 'dst-port': None, 'fragment': None, 'hotspot': None, + 'hw-offload': None, 'icmp-options': None, 'in-bridge-port': None, 'in-bridge-port-list': None,