mirror of
https://github.com/checktheroads/hyperglass
synced 2024-05-11 05:55:08 +00:00
add VyOS support
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
# Project
|
||||
from hyperglass.models import HyperglassModelExtra
|
||||
from hyperglass.configuration.models.commands.vyos import VyosCommands
|
||||
from hyperglass.configuration.models.commands.arista import AristaCommands
|
||||
from hyperglass.configuration.models.commands.common import CommandGroup
|
||||
from hyperglass.configuration.models.commands.huawei import HuaweiCommands
|
||||
@@ -17,6 +18,7 @@ _NOS_MAP = {
|
||||
"cisco_nxos": CiscoNXOSCommands,
|
||||
"arista": AristaCommands,
|
||||
"huawei": HuaweiCommands,
|
||||
"vyos": VyosCommands,
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +31,7 @@ class Commands(HyperglassModelExtra):
|
||||
cisco_xr: CommandGroup = CiscoXRCommands()
|
||||
cisco_nxos: CommandGroup = CiscoNXOSCommands()
|
||||
huawei: CommandGroup = HuaweiCommands()
|
||||
vyos: CommandGroup = VyosCommands()
|
||||
|
||||
@classmethod
|
||||
def import_params(cls, input_params):
|
||||
|
||||
56
hyperglass/configuration/models/commands/vyos.py
Normal file
56
hyperglass/configuration/models/commands/vyos.py
Normal file
@@ -0,0 +1,56 @@
|
||||
"""VyOS Command Model."""
|
||||
|
||||
# Third Party
|
||||
from pydantic import StrictStr
|
||||
|
||||
# Project
|
||||
from hyperglass.configuration.models.commands.common import CommandSet, CommandGroup
|
||||
|
||||
|
||||
class _IPv4(CommandSet):
|
||||
"""Validation model for non-default dual afi commands."""
|
||||
|
||||
bgp_route: StrictStr = "show ip bgp {target}"
|
||||
bgp_aspath: StrictStr = 'show ip bgp regexp "{target}"'
|
||||
bgp_community: StrictStr = "show ip bgp community {target}"
|
||||
ping: StrictStr = "ping {target} count 5 interface {source}"
|
||||
traceroute: StrictStr = "mtr -4 -G 1 -c 1 -w -o SAL -a {source} {target}"
|
||||
|
||||
|
||||
class _IPv6(CommandSet):
|
||||
"""Validation model for non-default ipv4 commands."""
|
||||
|
||||
bgp_route: StrictStr = "show ipv6 bgp {target}"
|
||||
bgp_aspath: StrictStr = 'show ipv6 bgp regexp "{target}"'
|
||||
bgp_community: StrictStr = "show ipv6 bgp community {target}"
|
||||
ping: StrictStr = "ping {target} count 5 interface {source}"
|
||||
traceroute: StrictStr = "mtr -6 -G 1 -c 1 -w -o SAL -a {source} {target}"
|
||||
|
||||
|
||||
class _VPNIPv4(CommandSet):
|
||||
"""Validation model for non-default ipv6 commands."""
|
||||
|
||||
bgp_route: StrictStr = "show ip bgp {target}"
|
||||
bgp_aspath: StrictStr = 'show ip bgp regexp "{target}"'
|
||||
bgp_community: StrictStr = "show ip bgp community {target}"
|
||||
ping: StrictStr = "ping {target} count 5 vrf {vrf} interface {source}"
|
||||
traceroute: StrictStr = "ip vrf exec {vrf} mtr -4 -G 1 -c 1 -w -o SAL -a {source} {target}"
|
||||
|
||||
|
||||
class _VPNIPv6(CommandSet):
|
||||
"""Validation model for non-default ipv6 commands."""
|
||||
|
||||
bgp_route: StrictStr = "show ipv6 bgp {target}"
|
||||
bgp_aspath: StrictStr = 'show ipv6 bgp regexp "{target}"'
|
||||
bgp_community: StrictStr = "show ipv6 bgp community {target}"
|
||||
ping: StrictStr = "ping {target} count 5 interface {source}"
|
||||
traceroute: StrictStr = "ip vrf exec {vrf} mtr -6 -G 1 -c 1 -w -o SAL -a {source} {target}"
|
||||
|
||||
|
||||
class VyosCommands(CommandGroup):
|
||||
"""Validation model for default juniper commands."""
|
||||
|
||||
ipv4_default: _IPv4 = _IPv4()
|
||||
ipv6_default: _IPv6 = _IPv6()
|
||||
ipv4_vpn: _VPNIPv4 = _VPNIPv4()
|
||||
ipv6_vpn: _VPNIPv6 = _VPNIPv6()
|
||||
Reference in New Issue
Block a user