diff --git a/README.md b/README.md index 56d7ab8f..3cb9ca48 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ hyperglass is intended to make implementing a looking glass too easy not to do, - Huawei - Juniper JunOS - Mikrotik + - Nokia SR OS - TNSR - VyOS - Configurable support for any other [supported platform](https://hyperglass.io/docs/platforms) diff --git a/docs/docs/introduction.mdx b/docs/docs/introduction.mdx index ce4bf1ab..ab253ecc 100644 --- a/docs/docs/introduction.mdx +++ b/docs/docs/introduction.mdx @@ -31,6 +31,7 @@ hyperglass was created with the lofty goal of benefiting the internet community - Huawei - Juniper JunOS - Mikrotik + - Nokia SR OS - TNSR - VyOS - Configurable support for any other [supported platform](platforms.mdx) diff --git a/hyperglass/models/commands/__init__.py b/hyperglass/models/commands/__init__.py index 7bf48757..9ca62df3 100644 --- a/hyperglass/models/commands/__init__.py +++ b/hyperglass/models/commands/__init__.py @@ -11,6 +11,7 @@ from .cisco_xr import CiscoXRCommands from .cisco_ios import CiscoIOSCommands from .cisco_nxos import CiscoNXOSCommands +from .nokia_sros import NokiaSROSCommands from .mikrotik_routeros import MikrotikRouterOS from .mikrotik_switchos import MikrotikSwitchOS @@ -23,6 +24,7 @@ "juniper": JuniperCommands, "mikrotik_routeros": MikrotikRouterOS, "mikrotik_switchos": MikrotikSwitchOS, + "nokia_sros": NokiaSROSCommands, "tnsr": TNSRCommands, "vyos": VyosCommands, } @@ -39,6 +41,7 @@ class Commands(HyperglassModelExtra): huawei: CommandGroup = HuaweiCommands() mikrotik_routeros: CommandGroup = MikrotikRouterOS() mikrotik_switchos: CommandGroup = MikrotikSwitchOS() + nokia_sros: CommandGroup = NokiaSROSCommands() tnsr: CommandGroup = TNSRCommands() vyos: CommandGroup = VyosCommands() diff --git a/hyperglass/models/commands/nokia_sros.py b/hyperglass/models/commands/nokia_sros.py new file mode 100644 index 00000000..bc8d5b67 --- /dev/null +++ b/hyperglass/models/commands/nokia_sros.py @@ -0,0 +1,56 @@ +"""Nokia SR-OS Command Model.""" + +# Third Party +from pydantic import StrictStr + +# Local +from .common import CommandSet, CommandGroup + + +class _IPv4(CommandSet): + """Default commands for ipv4 commands.""" + + bgp_community: StrictStr = "/show router bgp routes community {target}" + bgp_aspath: StrictStr = "/show router bgp routes aspath-regex {target}" + bgp_route: StrictStr = "/show router bgp routes {target} ipv4 hunt" + ping: StrictStr = "/ping {target} source-address {source}" + traceroute: StrictStr = "/traceroute {target} source-address {source} wait 2 seconds" + + +class _IPv6(CommandSet): + """Default commands for ipv6 commands.""" + + bgp_community: StrictStr = "/show router bgp routes community {target}" + bgp_aspath: StrictStr = "/show router bgp routes aspath-regex {target}" + bgp_route: StrictStr = "/show router bgp routes {target} ipv6 hunt" + ping: StrictStr = "/ping {target} source-address {source}" + traceroute: StrictStr = "/traceroute {target} source-address {source} wait 2 seconds" + + +class _VPNIPv4(CommandSet): + """Default commands for dual afi commands.""" + + bgp_community: StrictStr = "/show router bgp routes community {target}" + bgp_aspath: StrictStr = "/show router bgp routes aspath-regex {target}" + bgp_route: StrictStr = "/show router bgp routes {target} vpn-ipv4 hunt" + ping: StrictStr = "/ping {target} source-address {source}" + traceroute: StrictStr = "/traceroute {target} source-address {source} wait 2 seconds" + + +class _VPNIPv6(CommandSet): + """Default commands for dual afi commands.""" + + bgp_community: StrictStr = "/show router bgp routes community {target}" + bgp_aspath: StrictStr = "/show router bgp routes aspath-regex {target}" + bgp_route: StrictStr = "/show router bgp routes {target} vpn-ipv6 hunt" + ping: StrictStr = "/ping {target} source-address {source}" + traceroute: StrictStr = "/traceroute {target} source-address {source} wait 2 seconds" + + +class NokiaSROSCommands(CommandGroup): + """Validation model for default nokia_sros commands.""" + + ipv4_default: _IPv4 = _IPv4() + ipv6_default: _IPv6 = _IPv6() + ipv4_vpn: _VPNIPv4 = _VPNIPv4() + ipv6_vpn: _VPNIPv6 = _VPNIPv6()