Skip to content

Commit

Permalink
Fix some bugs and adapt RouterOS v.7.12 changes (#234)
Browse files Browse the repository at this point in the history
* 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

* Add changelog fragment

* Fix duplicate key 'output.network'

* Split up the changelog fragment

---------

Co-authored-by: Johannes Münch <[email protected]>
  • Loading branch information
derdeagle and derdeagle authored Nov 19, 2023
1 parent 479f310 commit 92c6226
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 15 deletions.
5 changes: 5 additions & 0 deletions changelogs/fragments/234-bugfixes-and-update-adaptations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
minor_changes:
- 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).
86 changes: 71 additions & 15 deletions plugins/module_utils/_api_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -3552,20 +3570,58 @@ 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(),
'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(),
},
),
),
Expand Down

0 comments on commit 92c6226

Please sign in to comment.