Skip to content

Commit

Permalink
Fixes ansible-collections#236: Add missing parameters
Browse files Browse the repository at this point in the history
The parameters "address-list", "address-list-timeout", and "realm" were
missing for some subpaths of "ip firewall" and are now added.
Additionally the default value of "False" for the "disabled" parameter
has been set so that an e.g. firewall rule, which was disabled
(disabled=True) is enabled (disabled=False) after removing the
"disabled" argument in the data.

Some more parameters can now be removed, e.g. "jump-target", "log", and "log-prefix",
which are not mandatory.
  • Loading branch information
derdeagle committed Dec 2, 2023
1 parent dac3b79 commit cd4d161
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
minor_changes:
- api_info, api_modify - add missing parameters ``address-list``, ``address-list-timeout``, ``randomise-ports``, and ``realm`` to subpaths of the ``ip firewall`` path (https://github.com/ansible-collections/community.routeros/issues/236, https://github.com/ansible-collections/community.routeros/pull/236)
- api_info, api_modify - set the default value to ``False`` for the ``disabled`` parameter in some more paths where it can be seen in the documentation (https://github.com/ansible-collections/community.routeros/pull/236)
69 changes: 38 additions & 31 deletions plugins/module_utils/_api_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ def join_path(path):
fields={
'name': KeyInfo(required=True),
'comment': KeyInfo(can_disable=True, remove_value=''),
'disabled': KeyInfo(can_disable=True),
'disabled': KeyInfo(default=False),
'fib': KeyInfo(),
},
)),
Expand Down Expand Up @@ -1007,7 +1007,7 @@ def join_path(path):
'client-to-client-forwarding': KeyInfo(can_disable=True),
'client-tx-limit': KeyInfo(can_disable=True),
'comment': KeyInfo(can_disable=True, remove_value=''),
'disabled': KeyInfo(),
'disabled': KeyInfo(default=False),
'interface': KeyInfo(can_disable=True),
'mac-address': KeyInfo(can_disable=True),
'mac-address-mask': KeyInfo(can_disable=True),
Expand Down Expand Up @@ -1941,6 +1941,8 @@ def join_path(path):
stratify_keys=('chain', ),
fields={
'action': KeyInfo(),
'address-list': KeyInfo(can_disable=True),
'address-list-timeout': KeyInfo(can_disable=True),
'chain': KeyInfo(),
'comment': KeyInfo(can_disable=True, remove_value=''),
'connection-bytes': KeyInfo(can_disable=True),
Expand All @@ -1951,7 +1953,7 @@ def join_path(path):
'connection-state': KeyInfo(can_disable=True),
'connection-type': KeyInfo(can_disable=True),
'content': KeyInfo(can_disable=True),
'disabled': KeyInfo(),
'disabled': KeyInfo(default=False),
'dscp': KeyInfo(can_disable=True),
'dst-address': KeyInfo(can_disable=True),
'dst-address-list': KeyInfo(can_disable=True),
Expand All @@ -1969,11 +1971,11 @@ def join_path(path):
'ingress-priority': KeyInfo(can_disable=True),
'ipsec-policy': KeyInfo(can_disable=True),
'ipv4-options': KeyInfo(can_disable=True),
'jump-target': KeyInfo(),
'jump-target': KeyInfo(can_disable=True),
'layer7-protocol': KeyInfo(can_disable=True),
'limit': KeyInfo(can_disable=True),
'log': KeyInfo(),
'log-prefix': KeyInfo(),
'log': KeyInfo(can_disable=True),
'log-prefix': KeyInfo(can_disable=True),
'nth': KeyInfo(can_disable=True),
'out-bridge-port': KeyInfo(can_disable=True),
'out-bridge-port-list': KeyInfo(can_disable=True),
Expand All @@ -1988,7 +1990,8 @@ def join_path(path):
'protocol': KeyInfo(can_disable=True),
'psd': KeyInfo(can_disable=True),
'random': KeyInfo(can_disable=True),
'reject-with': KeyInfo(),
'realm': KeyInfo(can_disable=True),
'reject-with': KeyInfo(can_disable=True),
'routing-mark': KeyInfo(can_disable=True),
'routing-table': KeyInfo(can_disable=True),
'src-address': KeyInfo(can_disable=True),
Expand All @@ -2010,6 +2013,8 @@ def join_path(path):
stratify_keys=('chain', ),
fields={
'action': KeyInfo(),
'address-list': KeyInfo(can_disable=True),
'address-list-timeout': KeyInfo(can_disable=True),
'chain': KeyInfo(),
'comment': KeyInfo(can_disable=True, remove_value=''),
'connection-bytes': KeyInfo(can_disable=True),
Expand All @@ -2020,7 +2025,7 @@ def join_path(path):
'connection-state': KeyInfo(can_disable=True),
'connection-type': KeyInfo(can_disable=True),
'content': KeyInfo(can_disable=True),
'disabled': KeyInfo(),
'disabled': KeyInfo(default=False),
'dscp': KeyInfo(can_disable=True),
'dst-address': KeyInfo(can_disable=True),
'dst-address-list': KeyInfo(can_disable=True),
Expand All @@ -2037,11 +2042,11 @@ def join_path(path):
'ingress-priority': KeyInfo(can_disable=True),
'ipsec-policy': KeyInfo(can_disable=True),
'ipv4-options': KeyInfo(can_disable=True),
'jump-target': KeyInfo(),
'jump-target': KeyInfo(can_disable=True),
'layer7-protocol': KeyInfo(can_disable=True),
'limit': KeyInfo(can_disable=True),
'log': KeyInfo(),
'log-prefix': KeyInfo(),
'log': KeyInfo(can_disable=True),
'log-prefix': KeyInfo(can_disable=True),
'new-connection-mark': KeyInfo(can_disable=True),
'new-dscp': KeyInfo(can_disable=True),
'new-mss': KeyInfo(can_disable=True),
Expand All @@ -2064,6 +2069,7 @@ def join_path(path):
'protocol': KeyInfo(can_disable=True),
'psd': KeyInfo(can_disable=True),
'random': KeyInfo(can_disable=True),
'realm': KeyInfo(can_disable=True),
'route-dst': KeyInfo(can_disable=True),
'routing-mark': KeyInfo(can_disable=True),
'routing-table': KeyInfo(can_disable=True),
Expand All @@ -2089,8 +2095,8 @@ def join_path(path):
stratify_keys=('chain', ),
fields={
'action': KeyInfo(),
'address-list': KeyInfo(),
'address-list-timeout': KeyInfo(),
'address-list': KeyInfo(can_disable=True),
'address-list-timeout': KeyInfo(can_disable=True),
'chain': KeyInfo(),
'comment': KeyInfo(can_disable=True, remove_value=''),
'connection-bytes': KeyInfo(can_disable=True),
Expand All @@ -2099,7 +2105,7 @@ def join_path(path):
'connection-rate': KeyInfo(can_disable=True),
'connection-type': KeyInfo(can_disable=True),
'content': KeyInfo(can_disable=True),
'disabled': KeyInfo(),
'disabled': KeyInfo(default=False),
'dscp': KeyInfo(can_disable=True),
'dst-address': KeyInfo(can_disable=True),
'dst-address-list': KeyInfo(can_disable=True),
Expand All @@ -2116,11 +2122,11 @@ def join_path(path):
'ingress-priority': KeyInfo(can_disable=True),
'ipsec-policy': KeyInfo(can_disable=True),
'ipv4-options': KeyInfo(can_disable=True),
'jump-target': KeyInfo(),
'jump-target': KeyInfo(can_disable=True),
'layer7-protocol': KeyInfo(can_disable=True),
'limit': KeyInfo(can_disable=True),
'log': KeyInfo(),
'log-prefix': KeyInfo(),
'log': KeyInfo(can_disable=True),
'log-prefix': KeyInfo(can_disable=True),
'nth': KeyInfo(can_disable=True),
'out-bridge-port': KeyInfo(can_disable=True),
'out-bridge-port-list': KeyInfo(can_disable=True),
Expand All @@ -2134,9 +2140,10 @@ def join_path(path):
'protocol': KeyInfo(can_disable=True),
'psd': KeyInfo(can_disable=True),
'random': KeyInfo(can_disable=True),
'randomise-ports': KeyInfo(can_disable=True),
'realm': KeyInfo(can_disable=True),
'routing-mark': KeyInfo(can_disable=True),
'same-not-by-dst': KeyInfo(),
'same-not-by-dst': KeyInfo(can_disable=True),
'src-address': KeyInfo(can_disable=True),
'src-address-list': KeyInfo(can_disable=True),
'src-address-type': KeyInfo(can_disable=True),
Expand All @@ -2157,12 +2164,12 @@ def join_path(path):
stratify_keys=('chain',),
fields={
'action': KeyInfo(),
'address-list': KeyInfo(),
'address-list-timeout': KeyInfo(),
'address-list': KeyInfo(can_disable=True),
'address-list-timeout': KeyInfo(can_disable=True),
'chain': KeyInfo(),
'comment': KeyInfo(can_disable=True, remove_value=''),
'content': KeyInfo(can_disable=True),
'disabled': KeyInfo(),
'disabled': KeyInfo(default=False),
'dscp': KeyInfo(can_disable=True),
'dst-address': KeyInfo(can_disable=True),
'dst-address-list': KeyInfo(can_disable=True),
Expand All @@ -2179,10 +2186,10 @@ def join_path(path):
'ingress-priority': KeyInfo(can_disable=True),
'ipsec-policy': KeyInfo(can_disable=True),
'ipv4-options': KeyInfo(can_disable=True),
'jump-target': KeyInfo(),
'jump-target': KeyInfo(can_disable=True),
'limit': KeyInfo(can_disable=True),
'log': KeyInfo(),
'log-prefix': KeyInfo(),
'log': KeyInfo(can_disable=True),
'log-prefix': KeyInfo(can_disable=True),
'nth': KeyInfo(can_disable=True),
'out-bridge-port': KeyInfo(can_disable=True),
'out-bridge-port-list': KeyInfo(can_disable=True),
Expand Down Expand Up @@ -2512,7 +2519,7 @@ def join_path(path):
'connection-state': KeyInfo(can_disable=True),
'connection-type': KeyInfo(can_disable=True),
'content': KeyInfo(can_disable=True),
'disabled': KeyInfo(),
'disabled': KeyInfo(default=False),
'dscp': KeyInfo(can_disable=True),
'dst-address': KeyInfo(can_disable=True),
'dst-address-list': KeyInfo(can_disable=True),
Expand Down Expand Up @@ -2573,7 +2580,7 @@ def join_path(path):
'connection-state': KeyInfo(can_disable=True),
'connection-type': KeyInfo(can_disable=True),
'content': KeyInfo(can_disable=True),
'disabled': KeyInfo(),
'disabled': KeyInfo(default=False),
'dscp': KeyInfo(can_disable=True),
'dst-address': KeyInfo(can_disable=True),
'dst-address-list': KeyInfo(can_disable=True),
Expand Down Expand Up @@ -2647,7 +2654,7 @@ def join_path(path):
'connection-state': KeyInfo(can_disable=True),
'connection-type': KeyInfo(can_disable=True),
'content': KeyInfo(can_disable=True),
'disabled': KeyInfo(),
'disabled': KeyInfo(default=False),
'dscp': KeyInfo(can_disable=True),
'dst-address': KeyInfo(can_disable=True),
'dst-address-list': KeyInfo(can_disable=True),
Expand Down Expand Up @@ -2703,7 +2710,7 @@ def join_path(path):
'chain': KeyInfo(),
'comment': KeyInfo(can_disable=True, remove_value=''),
'content': KeyInfo(can_disable=True),
'disabled': KeyInfo(),
'disabled': KeyInfo(default=False),
'dscp': KeyInfo(can_disable=True),
'dst-address': KeyInfo(can_disable=True),
'dst-address-list': KeyInfo(can_disable=True),
Expand Down Expand Up @@ -2796,7 +2803,7 @@ def join_path(path):
'blackhole': KeyInfo(can_disable=True),
'check-gateway': KeyInfo(can_disable=True),
'comment': KeyInfo(can_disable=True, remove_value=''),
'disabled': KeyInfo(),
'disabled': KeyInfo(default=False),
'distance': KeyInfo(default=1),
'dst-address': KeyInfo(),
'gateway': KeyInfo(),
Expand Down Expand Up @@ -3581,7 +3588,7 @@ def join_path(path):
'cluster-id': KeyInfo(),
'comment': KeyInfo(),
'connect': KeyInfo(default=True),
'disabled': KeyInfo(),
'disabled': KeyInfo(default=False),
'hold-time': KeyInfo(),
'input.accept-communities': KeyInfo(),
'input.accept-ext-communities': KeyInfo(),
Expand Down Expand Up @@ -3640,7 +3647,7 @@ def join_path(path):
'client-to-client-reflection': KeyInfo(),
'cluster-id': KeyInfo(can_disable=True),
'confederation': KeyInfo(can_disable=True),
'disabled': KeyInfo(),
'disabled': KeyInfo(default=False),
'ignore-as-path-len': KeyInfo(),
'name': KeyInfo(),
'out-filter': KeyInfo(),
Expand Down

0 comments on commit cd4d161

Please sign in to comment.