From c7b2275f2c5b1ef85faa679127b6d62f162044ec Mon Sep 17 00:00:00 2001 From: Michael Jenny Date: Fri, 13 Jun 2025 08:10:37 +0200 Subject: [PATCH] Support RouterOS path /interface ethernet switch port-isolation and /routing bfd configuration (#375) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update _api_data.py Add /interface/bridge property "port-cost-mode" which is supported since RouterOS 7.13. See changelog for details: https://mikrotik.com/download/changelogs * Create 371-add-bridge-port-cost-mode.yml * Update changelogs/fragments/371-add-bridge-port-cost-mode.yml Co-authored-by: Felix Fontein * Support for /interface ethernet switch port-isolation RouterOS has supported the /interface ethernet switch port-isolation path since version 6.43. This feature enables hardware offloaded Layer‑2 port isolation on supported switch chips Support for /routing bfd configuration Since RouterOS 7.11 it supports stable bfd support. See: https://iparchitechs.com/mikrotik-routeros-v7-11-stable-released/ * . * Add change file * attr order * Add name to fields * PEP8 * Update changelogs/fragments/375-port_isolation-and-routing_bfd_configuration.yml Co-authored-by: Felix Fontein * Update changelogs/fragments/375-port_isolation-and-routing_bfd_configuration.yml Co-authored-by: Felix Fontein --------- Co-authored-by: Felix Fontein Co-authored-by: Michael Jenny --- ...solation-and-routing_bfd_configuration.yml | 6 ++++ plugins/module_utils/_api_data.py | 34 +++++++++++++++++++ plugins/modules/api_info.py | 2 ++ plugins/modules/api_modify.py | 2 ++ 4 files changed, 44 insertions(+) create mode 100644 changelogs/fragments/375-port_isolation-and-routing_bfd_configuration.yml diff --git a/changelogs/fragments/375-port_isolation-and-routing_bfd_configuration.yml b/changelogs/fragments/375-port_isolation-and-routing_bfd_configuration.yml new file mode 100644 index 0000000..81d2976 --- /dev/null +++ b/changelogs/fragments/375-port_isolation-and-routing_bfd_configuration.yml @@ -0,0 +1,6 @@ +--- +minor_changes: + - api_info, api_modify - add ``interface ethernet switch port-isolation`` which is supported since RouterOS 6.43 (https://github.com/ansible-collections/community.routeros/pull/375). + - | + api_info, api_modify - add ``routing bfd configuration``. Officially stabilized BFD support for BGP and OSPF is available since RouterOS 7.11 + (https://github.com/ansible-collections/community.routeros/pull/375). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 92816f9..0fdb0ca 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -4187,6 +4187,28 @@ PATHS = { }, ), ), + ('routing', 'bfd', 'configuration'): APIData( + versioned=[ + ('7.11', '>=', VersionedAPIData( + fully_understood=True, + fields={ + 'address-list': KeyInfo(), + 'addresses': KeyInfo(), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'copy-from': KeyInfo(), + 'disabled': KeyInfo(default=False), + 'forbid-bfd': KeyInfo(), + 'interfaces': KeyInfo(), + 'min-echo-rx': KeyInfo(), + 'min-rx': KeyInfo(), + 'min-tx': KeyInfo(), + 'multiplier': KeyInfo(), + 'place-before': KeyInfo(), + 'vrf': KeyInfo(), + }, + )) + ], + ), ('routing', 'bfd', 'interface'): APIData( unversioned=VersionedAPIData( unknown_mechanism=True, @@ -4903,6 +4925,18 @@ PATHS = { }, ), ), + ('interface', 'ethernet', 'switch', 'port-isolation'): APIData( + versioned=[ + ('6.43', '>=', VersionedAPIData( + primary_keys=('name', ), + fully_understood=True, + fields={ + 'forwarding-override': KeyInfo(), + 'name': KeyInfo(), + }, + )), + ], + ), ('ip', 'dhcp-client', 'option'): APIData( unversioned=VersionedAPIData( fixed_entries=True, diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index d3f1b9e..1eb8a94 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -68,6 +68,7 @@ options: - interface ethernet poe - interface ethernet switch - interface ethernet switch port + - interface ethernet switch port-isolation - interface gre - interface gre6 - interface l2tp-client @@ -203,6 +204,7 @@ options: - queue type - radius - radius incoming + - routing bfd configuration - routing bgp aggregate - routing bgp connection - routing bgp instance diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index e89b051..dfa6fd5 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -79,6 +79,7 @@ options: - interface ethernet poe - interface ethernet switch - interface ethernet switch port + - interface ethernet switch port-isolation - interface gre - interface gre6 - interface l2tp-client @@ -214,6 +215,7 @@ options: - queue type - radius - radius incoming + - routing bfd configuration - routing bgp aggregate - routing bgp connection - routing bgp instance