2019-12-29 23:57:39 -07:00
|
|
|
"""Validate command configuration variables."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
# Third Party Imports
|
|
|
|
from pydantic import StrictStr
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-10-04 16:54:32 -07:00
|
|
|
# Project Imports
|
|
|
|
from hyperglass.configuration.models._utils import HyperglassModel
|
2019-09-11 01:35:31 -07:00
|
|
|
|
|
|
|
|
2019-10-04 16:54:32 -07:00
|
|
|
class Command(HyperglassModel):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for non-default commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-10-04 16:54:32 -07:00
|
|
|
class IPv4(HyperglassModel):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for non-default dual afi commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_route: StrictStr = ""
|
|
|
|
bgp_aspath: StrictStr = ""
|
|
|
|
bgp_community: StrictStr = ""
|
|
|
|
ping: StrictStr = ""
|
|
|
|
traceroute: StrictStr = ""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-10-04 16:54:32 -07:00
|
|
|
class IPv6(HyperglassModel):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for non-default ipv4 commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_route: StrictStr = ""
|
|
|
|
bgp_aspath: StrictStr = ""
|
|
|
|
bgp_community: StrictStr = ""
|
|
|
|
ping: StrictStr = ""
|
|
|
|
traceroute: StrictStr = ""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-10-04 16:54:32 -07:00
|
|
|
class VPNIPv4(HyperglassModel):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for non-default ipv6 commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_route: StrictStr = ""
|
|
|
|
bgp_aspath: StrictStr = ""
|
|
|
|
bgp_community: StrictStr = ""
|
|
|
|
ping: StrictStr = ""
|
|
|
|
traceroute: StrictStr = ""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-10-04 16:54:32 -07:00
|
|
|
class VPNIPv6(HyperglassModel):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for non-default ipv6 commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_route: StrictStr = ""
|
|
|
|
bgp_aspath: StrictStr = ""
|
|
|
|
bgp_community: StrictStr = ""
|
|
|
|
ping: StrictStr = ""
|
|
|
|
traceroute: StrictStr = ""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-10-09 03:10:52 -07:00
|
|
|
ipv4_default: IPv4 = IPv4()
|
|
|
|
ipv6_default: IPv6 = IPv6()
|
|
|
|
ipv4_vpn: VPNIPv4 = VPNIPv4()
|
|
|
|
ipv6_vpn: VPNIPv6 = VPNIPv6()
|
2019-09-11 01:35:31 -07:00
|
|
|
|
|
|
|
|
2019-10-04 16:54:32 -07:00
|
|
|
class Commands(HyperglassModel):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Base class for command definitions."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def import_params(cls, input_params):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Import loaded YAML, initialize per-command definitions.
|
|
|
|
|
|
|
|
Dynamically set attributes for the command class.
|
|
|
|
|
|
|
|
Arguments:
|
|
|
|
input_params {dict} -- Unvalidated command definitions
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
{object} -- Validated commands object
|
2019-09-11 01:35:31 -07:00
|
|
|
"""
|
|
|
|
obj = Commands()
|
|
|
|
for (nos, cmds) in input_params.items():
|
|
|
|
setattr(Commands, nos, Command(**cmds))
|
|
|
|
return obj
|
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class CiscoIOS(Command):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for default cisco_ios commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class VPNIPv4(Command.VPNIPv4):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Default commands for dual afi commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_community: StrictStr = "show bgp vpnv4 unicast vrf {vrf} community {target}"
|
|
|
|
bgp_aspath: StrictStr = 'show bgp vpnv4 unicast vrf {vrf} quote-regexp "{target}"'
|
|
|
|
bgp_route: StrictStr = "show bgp vpnv4 unicast vrf {vrf} {target}"
|
|
|
|
ping: StrictStr = "ping vrf {vrf} {target} repeat 5 source {source}"
|
|
|
|
traceroute: StrictStr = (
|
2019-09-30 07:51:17 -07:00
|
|
|
"traceroute vrf {vrf} {target} timeout 1 probe 2 source {source}"
|
2019-09-11 01:35:31 -07:00
|
|
|
)
|
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class VPNIPv6(Command.VPNIPv6):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Default commands for dual afi commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_community: StrictStr = "show bgp vpnv6 unicast vrf {vrf} community {target}"
|
|
|
|
bgp_aspath: StrictStr = 'show bgp vpnv6 unicast vrf {vrf} quote-regexp "{target}"'
|
|
|
|
bgp_route: StrictStr = "show bgp vpnv6 unicast vrf {vrf} {target}"
|
|
|
|
ping: StrictStr = "ping vrf {vrf} {target} repeat 5 source {source}"
|
|
|
|
traceroute: StrictStr = (
|
2019-09-30 07:51:17 -07:00
|
|
|
"traceroute vrf {vrf} {target} timeout 1 probe 2 source {source}"
|
2019-09-11 01:35:31 -07:00
|
|
|
)
|
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class IPv4(Command.IPv4):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Default commands for ipv4 commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_community: StrictStr = "show bgp ipv4 unicast community {target}"
|
|
|
|
bgp_aspath: StrictStr = 'show bgp ipv4 unicast quote-regexp "{target}"'
|
|
|
|
bgp_route: StrictStr = "show bgp ipv4 unicast {target} | exclude pathid:|Epoch"
|
|
|
|
ping: StrictStr = "ping {target} repeat 5 source {source}"
|
|
|
|
traceroute: StrictStr = "traceroute {target} timeout 1 probe 2 source {source}"
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class IPv6(Command.IPv6):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Default commands for ipv6 commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_community: StrictStr = "show bgp ipv6 unicast community {target}"
|
|
|
|
bgp_aspath: StrictStr = 'show bgp ipv6 unicast quote-regexp "{target}"'
|
|
|
|
bgp_route: StrictStr = "show bgp ipv6 unicast {target} | exclude pathid:|Epoch"
|
|
|
|
ping: StrictStr = ("ping ipv6 {target} repeat 5 source {source}")
|
|
|
|
traceroute: StrictStr = (
|
2019-09-30 07:51:17 -07:00
|
|
|
"traceroute ipv6 {target} timeout 1 probe 2 source {source}"
|
2019-09-11 01:35:31 -07:00
|
|
|
)
|
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
ipv4_default: IPv4 = IPv4()
|
|
|
|
ipv6_default: IPv6 = IPv6()
|
2019-10-12 16:44:47 -07:00
|
|
|
ipv4_vpn: VPNIPv4 = VPNIPv4()
|
|
|
|
ipv6_vpn: VPNIPv6 = VPNIPv6()
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class CiscoXR(Command):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for default cisco_xr commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class IPv4(Command.IPv4):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for non-default dual afi commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_route: StrictStr = r"show bgp ipv4 unicast {target} | util egrep \\(BGP routing table entry|Path \\#|aggregated by|Origin |Community:|validity| from \\)"
|
|
|
|
bgp_aspath: StrictStr = r"show bgp ipv4 unicast regexp {target} | utility egrep -v \\(BGP |Table |Non-stop\\)"
|
|
|
|
bgp_community: StrictStr = r"show bgp ipv4 unicast community {target} | utility egrep -v \\(BGP |Table |Non-stop\\)"
|
|
|
|
ping: StrictStr = r"ping ipv4 {target} count 5 source {source}"
|
|
|
|
traceroute: StrictStr = r"traceroute ipv4 {target} timeout 1 probe 2 source {source}"
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class IPv6(Command.IPv6):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for non-default ipv4 commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_route: StrictStr = r"show bgp ipv6 unicast {target} | util egrep \\(BGP routing table entry|Path \\#|aggregated by|Origin |Community:|validity| from \\)"
|
|
|
|
bgp_aspath: StrictStr = r"show bgp ipv6 unicast regexp {target} | utility egrep -v \\(BGP |Table |Non-stop\\)"
|
|
|
|
bgp_community: StrictStr = r"show bgp ipv6 unicast community {target} | utility egrep -v \\(BGP |Table |Non-stop\\)"
|
|
|
|
ping: StrictStr = r"ping ipv6 {target} count 5 source {source}"
|
|
|
|
traceroute: StrictStr = r"traceroute ipv6 {target} timeout 1 probe 2 source {source}"
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class VPNIPv4(Command.VPNIPv4):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for non-default ipv6 commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_route: StrictStr = r"show bgp vpnv4 unicast vrf {vrf} {target} | util egrep \\(BGP routing table entry|Path \\#|aggregated by|Origin |Community:|validity| from \\)"
|
|
|
|
bgp_aspath: StrictStr = r"show bgp vpnv4 unicast vrf {vrf} regexp {target} | utility egrep -v \\(BGP |Table |Non-stop\\)"
|
|
|
|
bgp_community: StrictStr = r"show bgp vpnv4 unicast vrf {vrf} community {target} | utility egrep -v \\(BGP |Table |Non-stop\\)"
|
|
|
|
ping: StrictStr = r"ping vrf {vrf} {target} count 5 source {source}"
|
|
|
|
traceroute: StrictStr = r"traceroute vrf {vrf} {target} timeout 1 probe 2 source {source}"
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class VPNIPv6(Command.VPNIPv6):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for non-default ipv6 commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_route: StrictStr = r"show bgp vpnv6 unicast vrf {vrf} {target} | util egrep \\(BGP routing table entry|Path \\#|aggregated by|Origin |Community:|validity| from \\)"
|
|
|
|
bgp_aspath: StrictStr = r"show bgp vpnv6 unicast vrf {vrf} regexp {target} | utility egrep -v \\(BGP |Table |Non-stop\\)"
|
|
|
|
bgp_community: StrictStr = r"show bgp vpnv6 unicast vrf {vrf} community {target} | utility egrep -v \\(BGP |Table |Non-stop\\)"
|
|
|
|
ping: StrictStr = r"ping vrf {vrf} {target} count 5 source {source}"
|
|
|
|
traceroute: StrictStr = r"traceroute vrf {vrf} {target} timeout 1 probe 2 source {source}"
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
ipv4_default: IPv4 = IPv4()
|
|
|
|
ipv6_default: IPv6 = IPv6()
|
|
|
|
ipv4_vpn: VPNIPv4 = VPNIPv4()
|
|
|
|
ipv6_vpn: VPNIPv6 = VPNIPv6()
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class Juniper(Command):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for default juniper commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class IPv4(Command.IPv4):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for non-default dual afi commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_route: StrictStr = "show route protocol bgp table inet.0 {target} detail"
|
|
|
|
bgp_aspath: StrictStr = "show route protocol bgp table inet.0 aspath-regex {target}"
|
|
|
|
bgp_community: StrictStr = "show route protocol bgp table inet.0 community {target}"
|
|
|
|
ping: StrictStr = "ping inet {target} count 5 source {source}"
|
|
|
|
traceroute: StrictStr = "traceroute inet {target} wait 1 source {source}"
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class IPv6(Command.IPv6):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for non-default ipv4 commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_route: StrictStr = "show route protocol bgp table inet6.0 {target} detail"
|
|
|
|
bgp_aspath: StrictStr = "show route protocol bgp community {target}"
|
|
|
|
bgp_community: StrictStr = "show route protocol bgp aspath-regex {target}"
|
|
|
|
ping: StrictStr = "ping inet6 {target} count 5 source {source}"
|
|
|
|
traceroute: StrictStr = "traceroute inet6 {target} wait 1 source {source}"
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class VPNIPv4(Command.VPNIPv4):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for non-default ipv6 commands."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_route: StrictStr = "show route protocol bgp table {vrf} {target} detail"
|
|
|
|
bgp_aspath: StrictStr = "show route protocol bgp table {vrf} aspath-regex {target}"
|
|
|
|
bgp_community: StrictStr = "show route protocol bgp table {vrf} community {target}"
|
|
|
|
ping: StrictStr = "ping inet routing-instance {vrf} {target} count 5 source {source}"
|
|
|
|
traceroute: StrictStr = "traceroute inet routing-instance {vrf} {target} wait 1 source {source}"
|
2019-10-01 01:04:23 -07:00
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class VPNIPv6(Command.VPNIPv6):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for non-default ipv6 commands."""
|
2019-10-01 01:04:23 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_route: StrictStr = "show route protocol bgp table {vrf} {target} detail"
|
|
|
|
bgp_aspath: StrictStr = "show route protocol bgp table {vrf} aspath-regex {target}"
|
|
|
|
bgp_community: StrictStr = "show route protocol bgp table {vrf} community {target}"
|
|
|
|
ping: StrictStr = "ping inet6 routing-instance {vrf} {target} count 5 source {source}"
|
|
|
|
traceroute: StrictStr = "traceroute inet6 routing-instance {vrf} {target} wait 1 source {source}"
|
2019-10-01 01:04:23 -07:00
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
ipv4_default: IPv4 = IPv4()
|
|
|
|
ipv6_default: IPv6 = IPv6()
|
|
|
|
ipv4_vpn: VPNIPv4 = VPNIPv4()
|
|
|
|
ipv6_vpn: VPNIPv6 = VPNIPv6()
|
2019-10-01 01:04:23 -07:00
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class Huawei(Command):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for default huawei commands."""
|
2019-10-01 01:04:23 -07:00
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class IPv4(Command.IPv4):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Default commands for ipv4 commands."""
|
2019-10-01 01:04:23 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_community: StrictStr = "display bgp routing-table regular-expression {target}"
|
|
|
|
bgp_aspath: StrictStr = "display bgp routing-table regular-expression {target}"
|
|
|
|
bgp_route: StrictStr = "display bgp routing-table {target}"
|
|
|
|
ping: StrictStr = "ping -c 5 -a {source} {target}"
|
|
|
|
traceroute: StrictStr = "tracert -q 2 -f 1 -a {source} {target}"
|
2019-10-01 01:04:23 -07:00
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class IPv6(Command.IPv6):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Default commands for ipv6 commands."""
|
2019-10-01 01:04:23 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_community: StrictStr = "display bgp ipv6 routing-table community {target}"
|
|
|
|
bgp_aspath: StrictStr = "display bgp ipv6 routing-table regular-expression {target}"
|
|
|
|
bgp_route: StrictStr = "display bgp ipv6 routing-table {target}"
|
|
|
|
ping: StrictStr = "ping ipv6 -c 5 -a {source} {target}"
|
|
|
|
traceroute: StrictStr = "tracert ipv6 -q 2 -f 1 -a {source} {target}"
|
2019-10-01 01:04:23 -07:00
|
|
|
|
2019-10-10 01:57:30 -07:00
|
|
|
class VPNIPv4(Command.VPNIPv4):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Default commands for dual afi commands."""
|
2019-10-10 01:57:30 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_community: StrictStr = "display bgp vpnv4 vpn-instance {vrf} routing-table regular-expression {target}"
|
|
|
|
bgp_aspath: StrictStr = "display bgp vpnv4 vpn-instance {vrf} routing-table regular-expression {target}"
|
|
|
|
bgp_route: StrictStr = "display bgp vpnv4 vpn-instance {vrf} routing-table {target}"
|
|
|
|
ping: StrictStr = "ping -vpn-instance {vrf} -c 5 -a {source} {target}"
|
|
|
|
traceroute: StrictStr = "tracert -q 2 -f 1 -vpn-instance {vrf} -a {source} {target}"
|
2019-10-10 01:57:30 -07:00
|
|
|
|
|
|
|
class VPNIPv6(Command.VPNIPv6):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Default commands for dual afi commands."""
|
2019-10-10 01:57:30 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_community: StrictStr = "display bgp vpnv6 vpn-instance {vrf} routing-table regular-expression {target}"
|
|
|
|
bgp_aspath: StrictStr = "display bgp vpnv6 vpn-instance {vrf} routing-table regular-expression {target}"
|
|
|
|
bgp_route: StrictStr = "display bgp vpnv6 vpn-instance {vrf} routing-table {target}"
|
|
|
|
ping: StrictStr = "ping vpnv6 vpn-instance {vrf} -c 5 -a {source} {target}"
|
|
|
|
traceroute: StrictStr = "tracert -q 2 -f 1 vpn-instance {vrf} -a {source} {target}"
|
2019-10-10 01:57:30 -07:00
|
|
|
|
|
|
|
ipv4_default: IPv4 = IPv4()
|
|
|
|
ipv6_default: IPv6 = IPv6()
|
2019-10-12 16:44:47 -07:00
|
|
|
ipv4_vpn: VPNIPv4 = VPNIPv4()
|
|
|
|
ipv6_vpn: VPNIPv6 = VPNIPv6()
|
|
|
|
|
|
|
|
class Arista(Command):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for non-default commands."""
|
2019-10-12 16:44:47 -07:00
|
|
|
|
|
|
|
class IPv4(Command.IPv4):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for non-default dual afi commands."""
|
2019-10-12 16:44:47 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
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 ip {target} source {source}"
|
|
|
|
traceroute: StrictStr = "traceroute ip {target} source {source}"
|
2019-10-12 16:44:47 -07:00
|
|
|
|
|
|
|
class IPv6(Command.IPv6):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for non-default ipv4 commands."""
|
2019-10-12 16:44:47 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
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 ipv6 {target} source {source}"
|
|
|
|
traceroute: StrictStr = "traceroute ipv6 {target} source {source}"
|
2019-10-12 16:44:47 -07:00
|
|
|
|
|
|
|
class VPNIPv4(Command.VPNIPv4):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for non-default ipv6 commands."""
|
2019-10-12 16:44:47 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_route: StrictStr = "show ip bgp {target} vrf {vrf}"
|
|
|
|
bgp_aspath: StrictStr = "show ip bgp regexp {target} vrf {vrf}"
|
|
|
|
bgp_community: StrictStr = "show ip bgp community {target} vrf {vrf}"
|
|
|
|
ping: StrictStr = "ping vrf {vrf} ip {target} source {source}"
|
|
|
|
traceroute: StrictStr = "traceroute vrf {vrf} ip {target} source {source}"
|
2019-10-12 16:44:47 -07:00
|
|
|
|
|
|
|
class VPNIPv6(Command.VPNIPv6):
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Validation model for non-default ipv6 commands."""
|
2019-10-12 16:44:47 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
bgp_route: StrictStr = "show ipv6 bgp {target} vrf {vrf}"
|
|
|
|
bgp_aspath: StrictStr = "show ipv6 bgp regexp {target} vrf {vrf}"
|
|
|
|
bgp_community: StrictStr = "show ipv6 bgp community {target} vrf {vrf}"
|
|
|
|
ping: StrictStr = "ping vrf {vrf} ipv6 {target} source {source}"
|
|
|
|
traceroute: StrictStr = "traceroute vrf {vrf} ipv6 {target} source {source}"
|
2019-10-12 16:44:47 -07:00
|
|
|
|
|
|
|
ipv4_default: IPv4 = IPv4()
|
|
|
|
ipv6_default: IPv6 = IPv6()
|
|
|
|
ipv4_vpn: VPNIPv4 = VPNIPv4()
|
|
|
|
ipv6_vpn: VPNIPv6 = VPNIPv6()
|
2019-10-01 01:04:23 -07:00
|
|
|
|
2019-09-11 01:35:31 -07:00
|
|
|
cisco_ios: Command = CiscoIOS()
|
|
|
|
cisco_xr: Command = CiscoXR()
|
|
|
|
juniper: Command = Juniper()
|
2019-10-01 01:04:23 -07:00
|
|
|
huawei: Command = Huawei()
|
2019-10-12 16:44:47 -07:00
|
|
|
arista: Command = Arista()
|
2019-09-11 01:35:31 -07:00
|
|
|
|
|
|
|
class Config:
|
2019-12-31 18:29:43 -07:00
|
|
|
"""Override pydantic config."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
|
|
|
validate_all = False
|