Skip to content

Commit

Permalink
Added STP module (#286)
Browse files Browse the repository at this point in the history
* Added STP module

* Fixed sanity error

* Updated bridge priority description for pvst amd rapid pvst

* Updated model

* Addressed review comments

* Fixed sanity check errors

* Remove vlan-id deletion

* Remove vlan-id delete

* Remove vlan-id delete

* Remove vlan-id delete

* Addressed review comments

* Updated test cases and replaced coded

* updated unit test cases

* Updated unit test cases

---------

Co-authored-by: Shade Talabi <shade.talabi@dell.com>
  • Loading branch information
stalabi1 and Shade Talabi authored Sep 18, 2023
1 parent b3f60d2 commit e17d83c
Show file tree
Hide file tree
Showing 20 changed files with 4,309 additions and 5 deletions.
5 changes: 3 additions & 2 deletions plugins/module_utils/network/sonic/argspec/facts/facts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# -*- coding: utf-8 -*-
# Copyright 2021 Dell Inc. or its subsidiaries. All Rights Reserved
# Copyright 2023 Dell Inc. or its subsidiaries. All Rights Reserved
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
Expand Down Expand Up @@ -58,7 +58,8 @@ def __init__(self, **kwargs):
'mac',
'bfd',
'copp',
'route_maps'
'route_maps',
'stp'
]

argument_spec = {
Expand Down
Empty file.
152 changes: 152 additions & 0 deletions plugins/module_utils/network/sonic/argspec/stp/stp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
#
# -*- coding: utf-8 -*-
# Copyright 2023 Dell Inc. or its subsidiaries. All Rights Reserved
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

#############################################
# WARNING #
#############################################
#
# This file is auto generated by the resource
# module builder playbook.
#
# Do not edit this file manually.
#
# Changes to this file will be over written
# by the resource module builder.
#
# Changes should be made in the model used to
# generate this file or in the resource module
# builder template.
#
#############################################

"""
The arg spec for the sonic_stp module
"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type


class StpArgs(object): # pylint: disable=R0903
"""The arg spec for the sonic_stp module
"""

def __init__(self, **kwargs):
pass

argument_spec = {
'config': {
'mutually_exclusive': [['mstp', 'pvst', 'rapid_pvst']],
'options': {
'global': {
'options': {
'bpdu_filter': {'default': False, 'type': 'bool'},
'bridge_priority': {'default': 32768, 'type': 'int'},
'disabled_vlans': {'elements': 'str', 'type': 'list'},
'enabled_protocol': {'choices': ['mst', 'pvst', 'rapid_pvst'], 'type': 'str'},
'fwd_delay': {'default': 15, 'type': 'int'},
'hello_time': {'default': 2, 'type': 'int'},
'loop_guard': {'default': False, 'type': 'bool'},
'max_age': {'default': 20, 'type': 'int'},
'portfast': {'default': False, 'type': 'bool'},
'root_guard_timeout': {'type': 'int'}
},
'type': 'dict'
},
'interfaces': {
'elements': 'dict',
'options': {
'bpdu_filter': {'default': False, 'type': 'bool'},
'bpdu_guard': {'default': False, 'type': 'bool'},
'cost': {'type': 'int'},
'edge_port': {'default': False, 'type': 'bool'},
'guard': {'choices': ['loop', 'root', 'none'], 'type': 'str'},
'intf_name': {'required': True, 'type': 'str'},
'link_type': {'choices': ['point-to-point', 'shared'], 'type': 'str'},
'port_priority': {'type': 'int'},
'portfast': {'default': False, 'type': 'bool'},
'shutdown': {'default': False, 'type': 'bool'},
'stp_enable': {'default': True, 'type': 'bool'},
'uplink_fast': {'default': False, 'type': 'bool'}
},
'type': 'list'
},
'mstp': {
'options': {
'fwd_delay': {'type': 'int'},
'hello_time': {'type': 'int'},
'max_age': {'type': 'int'},
'max_hop': {'type': 'int'},
'mst_instances': {
'elements': 'dict',
'options': {
'bridge_priority': {'type': 'int'},
'mst_id': {'required': True, 'type': 'int'},
'vlans': {'elements': 'str', 'type': 'list'},
'interfaces': {
'elements': 'dict',
'options': {
'cost': {'type': 'int'},
'intf_name': {'required': True, 'type': 'str'},
'port_priority': {'type': 'int'}
},
'type': 'list'
}
},
'type': 'list'
},
'mst_name': {'type': 'str'},
'revision': {'type': 'int'}
},
'type': 'dict'
},
'pvst': {
'elements': 'dict',
'options': {
'bridge_priority': {'type': 'int'},
'fwd_delay': {'type': 'int'},
'hello_time': {'type': 'int'},
'vlan_id': {'required': True, 'type': 'int'},
'max_age': {'type': 'int'},
'interfaces': {
'elements': 'dict',
'options': {
'cost': {'type': 'int'},
'intf_name': {'required': True, 'type': 'str'},
'port_priority': {'type': 'int'}
},
'type': 'list'
}
},
'type': 'list'
},
'rapid_pvst': {
'elements': 'dict',
'options': {
'bridge_priority': {'type': 'int'},
'fwd_delay': {'type': 'int'},
'hello_time': {'type': 'int'},
'vlan_id': {'required': True, 'type': 'int'},
'max_age': {'type': 'int'},
'interfaces': {
'elements': 'dict',
'options': {
'cost': {'type': 'int'},
'intf_name': {'required': True, 'type': 'str'},
'port_priority': {'type': 'int'}
},
'type': 'list'
}
},
'type': 'list'
}
},
'type': 'dict'
},
'state': {
'choices': ['merged', 'deleted', 'replaced', 'overridden'],
'default': 'merged', 'type': 'str'
}
} # pylint: disable=C0301
Empty file.
Loading

0 comments on commit e17d83c

Please sign in to comment.