Skip to content

Commit 9fc22be

Browse files
api_modify, api_info: support more fields in existing paths (ansible-collections#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 <[email protected]> Co-authored-by: Tomas Herfert <[email protected]>
1 parent 558eb50 commit 9fc22be

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

changelogs/fragments/121-api.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
minor_changes:
2+
- api_modify, api_info - support fields ``combo-mode``, ``comment``, ``fec-mode``, ``mdix-enable``, ``poe-out``, ``poe-priority``,
3+
``poe-voltage``, ``power-cycle-interval``, ``power-cycle-ping-address``, ``power-cycle-ping-enabled``, ``power-cycle-ping-timeout``
4+
for path ``interface ethernet`` (https://github.com/ansible-collections/community.routeros/pull/121).
5+
- api_modify, api_info - support field ``hw-offload`` for path ``ip firewall filter``
6+
(https://github.com/ansible-collections/community.routeros/pull/121).

plugins/module_utils/_api_data.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,27 @@ def join_path(path):
113113
'arp-timeout': KeyInfo(default='auto'),
114114
'auto-negotiation': KeyInfo(default=True),
115115
'bandwidth': KeyInfo(default='unlimited/unlimited'),
116+
'combo-mode': KeyInfo(can_disable=True),
117+
'comment': KeyInfo(can_disable=True, remove_value=''),
116118
'disabled': KeyInfo(default=False),
119+
'fec-mode': KeyInfo(can_disable=True),
117120
'full-duplex': KeyInfo(default=True),
118121
'l2mtu': KeyInfo(default=1598),
119122
'loop-protect': KeyInfo(default='default'),
120123
'loop-protect-disable-time': KeyInfo(default='5m'),
121124
'loop-protect-send-interval': KeyInfo(default='5s'),
122125
'mac-address': KeyInfo(),
126+
'mdix-enable': KeyInfo(),
123127
'mtu': KeyInfo(default=1500),
124128
'name': KeyInfo(),
125129
'orig-mac-address': KeyInfo(),
130+
'poe-out': KeyInfo(can_disable=True),
131+
'poe-priority': KeyInfo(can_disable=True),
132+
'poe-voltage': KeyInfo(can_disable=True),
133+
'power-cycle-interval': KeyInfo(),
134+
'power-cycle-ping-address': KeyInfo(can_disable=True),
135+
'power-cycle-ping-enabled': KeyInfo(),
136+
'power-cycle-ping-timeout': KeyInfo(can_disable=True),
126137
'rx-flow-control': KeyInfo(default='off'),
127138
'sfp-rate-select': KeyInfo(default='high'),
128139
'sfp-shutdown-temperature': KeyInfo(default='95C'),
@@ -890,6 +901,7 @@ def join_path(path):
890901
'dst-port': KeyInfo(can_disable=True),
891902
'fragment': KeyInfo(can_disable=True),
892903
'hotspot': KeyInfo(can_disable=True),
904+
'hw-offload': KeyInfo(can_disable=True),
893905
'icmp-options': KeyInfo(can_disable=True),
894906
'in-bridge-port': KeyInfo(can_disable=True),
895907
'in-bridge-port-list': KeyInfo(can_disable=True),

tests/unit/plugins/modules/test_api_info.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ def test_disabled_exclamation(self, mock_compose_api_path):
212212
'!dst-port': None,
213213
'!fragment': None,
214214
'!hotspot': None,
215+
'!hw-offload': None,
215216
'!icmp-options': None,
216217
'!in-bridge-port': None,
217218
'!in-bridge-port-list': None,
@@ -295,6 +296,7 @@ def test_disabled_null_value(self, mock_compose_api_path):
295296
'dst-port': None,
296297
'fragment': None,
297298
'hotspot': None,
299+
'hw-offload': None,
298300
'icmp-options': None,
299301
'in-bridge-port': None,
300302
'in-bridge-port-list': None,

0 commit comments

Comments
 (0)