From f8f19b6d2886c2c538cbf11860c6713d2a18bb6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCnch?= Date: Sat, 11 Nov 2023 12:09:04 +0100 Subject: [PATCH 1/4] Fix some bugs and adapt RouterOS v.7.12 changes /ip traffic-flow target: make it a multiple value (single_value=False) field /routing id: add comment attribute /tool e-mail: add versioning to the parameters as "address" was renamed to "server" in 7.12 /routing bgp connection: add missing attributes --- plugins/module_utils/_api_data.py | 87 +++++++++++++++++++++++++------ 1 file changed, 72 insertions(+), 15 deletions(-) diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index e876ac8e..ad5d4df9 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -2390,7 +2390,7 @@ def join_path(path): ), ('ip', 'traffic-flow', 'target'): APIData( unversioned=VersionedAPIData( - single_value=True, + single_value=False, fully_understood=True, fields={ 'address': KeyInfo(), @@ -2892,6 +2892,7 @@ def join_path(path): unversioned=VersionedAPIData( fully_understood=True, fields={ + 'comment': KeyInfo(can_disable=True, remove_value=''), 'disabled': KeyInfo(default=False), 'id': KeyInfo(), 'name': KeyInfo(), @@ -3180,19 +3181,36 @@ def join_path(path): ), ), ('tool', 'e-mail'): APIData( - unversioned=VersionedAPIData( - single_value=True, - fully_understood=True, - fields={ - 'address': KeyInfo(default='0.0.0.0'), - 'from': KeyInfo(default='<>'), - 'password': KeyInfo(default=''), - 'port': KeyInfo(default=25), - 'start-tls': KeyInfo(default=False), - 'tls': KeyInfo(default=False), - 'user': KeyInfo(default=''), - }, - ), + versioned=[ + ('7.12', '>=', VersionedAPIData( + single_value=True, + fully_understood=True, + fields={ + 'from': KeyInfo(default='<>'), + 'password': KeyInfo(default=''), + 'port': KeyInfo(default=25), + 'server': KeyInfo(default='0.0.0.0'), + 'start-tls': KeyInfo(default=False), + 'tls': KeyInfo(default=False), + 'user': KeyInfo(default=''), + 'vfr': KeyInfo(default=''), + }, + )), + ('7.12', '<', VersionedAPIData( + single_value=True, + fully_understood=True, + fields={ + 'address': KeyInfo(default='0.0.0.0'), + 'from': KeyInfo(default='<>'), + 'password': KeyInfo(default=''), + 'port': KeyInfo(default=25), + 'start-tls': KeyInfo(default=False), + 'tls': KeyInfo(default=False), + 'user': KeyInfo(default=''), + 'vfr': KeyInfo(default=''), + }, + )), + ], ), ('tool', 'graphing'): APIData( unversioned=VersionedAPIData( @@ -3552,20 +3570,59 @@ def join_path(path): fully_understood=True, fields={ 'as': KeyInfo(), - 'name': KeyInfo(required=True), + 'add-path-out': KeyInfo(), + 'address-families': KeyInfo(), + 'cisco-vpls-nlri-len-fmt': KeyInfo(), + 'cluster-id': KeyInfo(), + 'comment': KeyInfo(), 'connect': KeyInfo(default=True), + 'disabled': KeyInfo(), + 'hold-time': KeyInfo(), + 'input.accept-communities': KeyInfo(), + 'input.accept-ext-communities': KeyInfo(), + 'input.accept-large-communities': KeyInfo(), + 'input.accpet-nlri': KeyInfo(), + 'input.accept-unknown': KeyInfo(), + 'input.affinity': KeyInfo(), + 'input.allow-as': KeyInfo(), + 'input.filter': KeyInfo(), + 'input.ignore-as-path-len': KeyInfo(), + 'input.limit-process-routes-ipv4': KeyInfo(), + 'input.limit-process-routes-ipv6': KeyInfo(), + 'keepalive-time': KeyInfo(), 'listen': KeyInfo(default=True), 'local.address': KeyInfo(), 'local.port': KeyInfo(), 'local.role': KeyInfo(required=True), 'local.ttl': KeyInfo(), + 'multihop': KeyInfo(), + 'name': KeyInfo(required=True), + 'nexthop-choice': KeyInfo(), + 'output.affinity': KeyInfo(), + 'output.as-override': KeyInfo(), + 'output.default-originate': KeyInfo(), + 'output.default-prepend': KeyInfo(), + 'output.filter-chain': KeyInfo(), + 'output.filter-select': KeyInfo(), + 'output.keep-sent-attributes': KeyInfo(), + 'output.network': KeyInfo(), + 'output.no-client-to-client-reflection': KeyInfo(), + 'output.no-early-cut': KeyInfo(), + 'output.redistribute': KeyInfo(), + 'output.remote-private-as': KeyInfo(), + 'output.network': KeyInfo(), 'remote.address': KeyInfo(required=True), 'remote.port': KeyInfo(), 'remote.as': KeyInfo(), 'remote.allowed-as': KeyInfo(), 'remote.ttl': KeyInfo(), + 'router-id': KeyInfo(), + 'routing-table': KeyInfo(), + 'save-to': KeyInfo(), 'tcp-md5-key': KeyInfo(), 'templates': KeyInfo(), + 'use-bfd': KeyInfo(), + 'vrf': KeyInfo(), }, ), ), From 2b77e120676fd342e21d621f9f238466b8f8d1b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCnch?= Date: Sat, 11 Nov 2023 12:27:00 +0100 Subject: [PATCH 2/4] Add changelog fragment --- changelogs/fragments/234-bugfixes-and-update-adaptations.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/234-bugfixes-and-update-adaptations.yml diff --git a/changelogs/fragments/234-bugfixes-and-update-adaptations.yml b/changelogs/fragments/234-bugfixes-and-update-adaptations.yml new file mode 100644 index 00000000..2ddaa850 --- /dev/null +++ b/changelogs/fragments/234-bugfixes-and-update-adaptations.yml @@ -0,0 +1,2 @@ +minor_changes: + - api_modify - add ``comment`` attribute to ``/routing id``, make ``/ip traffic-flow target`` a multiple value attribute, add versioning to the ``/tool e-mail`` path (RouterOS 7.12 release), and add missing attributes to the ``routing bgp connection`` path (https://github.com/ansible-collections/community.routeros/pull/234). From 38673926431e9693f7efc9b5ba6deceff00a528c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCnch?= Date: Sat, 11 Nov 2023 12:35:26 +0100 Subject: [PATCH 3/4] Fix duplicate key 'output.network' --- plugins/module_utils/_api_data.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index ad5d4df9..ed2b32a7 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -3610,7 +3610,6 @@ def join_path(path): 'output.no-early-cut': KeyInfo(), 'output.redistribute': KeyInfo(), 'output.remote-private-as': KeyInfo(), - 'output.network': KeyInfo(), 'remote.address': KeyInfo(required=True), 'remote.port': KeyInfo(), 'remote.as': KeyInfo(), From 5c2870e05d169ee44f274d44d7f5d649dc53de3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCnch?= Date: Sat, 11 Nov 2023 16:58:36 +0100 Subject: [PATCH 4/4] Split up the changelog fragment --- changelogs/fragments/234-bugfixes-and-update-adaptations.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changelogs/fragments/234-bugfixes-and-update-adaptations.yml b/changelogs/fragments/234-bugfixes-and-update-adaptations.yml index 2ddaa850..8105c1dd 100644 --- a/changelogs/fragments/234-bugfixes-and-update-adaptations.yml +++ b/changelogs/fragments/234-bugfixes-and-update-adaptations.yml @@ -1,2 +1,5 @@ minor_changes: - - api_modify - add ``comment`` attribute to ``/routing id``, make ``/ip traffic-flow target`` a multiple value attribute, add versioning to the ``/tool e-mail`` path (RouterOS 7.12 release), and add missing attributes to the ``routing bgp connection`` path (https://github.com/ansible-collections/community.routeros/pull/234). + - api_modify - add missing ``comment`` attribute to ``/routing id`` (https://github.com/ansible-collections/community.routeros/pull/234). + - api_modify - make ``/ip traffic-flow target`` a multiple value attribute (https://github.com/ansible-collections/community.routeros/pull/234). + - api_modify - add versioning to the ``/tool e-mail`` path (RouterOS 7.12 release) (https://github.com/ansible-collections/community.routeros/pull/234). + - api_modify - add missing attributes to the ``routing bgp connection`` path (https://github.com/ansible-collections/community.routeros/pull/234).