From 984e96ad342e1dba73521c5687d60c7376a5a427 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Wed, 1 Nov 2023 20:04:46 +0000 Subject: [PATCH] interface: add configure_spanning_tree function for confiure STP Only support set admin_edge_port(_enable) for the moment --- pyaoscx/interface.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pyaoscx/interface.py b/pyaoscx/interface.py index 54273e2..ae6edd6 100644 --- a/pyaoscx/interface.py +++ b/pyaoscx/interface.py @@ -2389,3 +2389,23 @@ def configure_speed_duplex( ) self.user_config.update(_user_config) return self.apply() + + @PyaoscxModule.materialized + def configure_spanning_tree( + self, + admin_edge_port_enable=None, + ): + """ + Configure the Interface Spanning Tree Settings. + + :param admin_edge_port_enable: Boolean to set admin type: admin-edge or admin-network (default) + :return: True if object changed. + """ + + _stp_config = {} + + if admin_edge_port_enable is not None: + _stp_config["admin_edge_port_enable"] = admin_edge_port_enable + + self.stp_config.update(_stp_config) + return self.apply()