2021-01-18 20:38:51 +01:00
|
|
|
"""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."""
|
2021-01-18 21:26:19 +01:00
|
|
|
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"
|
2021-01-18 21:30:57 +01:00
|
|
|
ping: StrictStr = "/ping {target} source-address {source}"
|
2021-01-18 21:42:09 +01:00
|
|
|
traceroute: StrictStr = (
|
|
|
|
"/traceroute {target} source-address {source} wait 2 seconds"
|
|
|
|
)
|
2021-01-18 20:38:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
class _IPv6(CommandSet):
|
|
|
|
"""Default commands for ipv6 commands."""
|
2021-01-18 21:26:19 +01:00
|
|
|
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"
|
2021-01-18 21:30:57 +01:00
|
|
|
ping: StrictStr = "/ping {target} source-address {source}"
|
2021-01-18 21:42:09 +01:00
|
|
|
traceroute: StrictStr = (
|
|
|
|
"/traceroute {target} source-address {source} wait 2 seconds"
|
|
|
|
)
|
|
|
|
|
2021-01-18 20:38:51 +01:00
|
|
|
|
|
|
|
class _VPNIPv4(CommandSet):
|
|
|
|
"""Default commands for dual afi commands."""
|
2021-01-18 21:26:19 +01:00
|
|
|
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"
|
2021-01-18 21:30:57 +01:00
|
|
|
ping: StrictStr = "/ping {target} source-address {source}"
|
2021-01-18 21:42:09 +01:00
|
|
|
traceroute: StrictStr = (
|
|
|
|
"/traceroute {target} source-address {source} wait 2 seconds"
|
|
|
|
)
|
|
|
|
|
2021-01-18 20:38:51 +01:00
|
|
|
|
|
|
|
class _VPNIPv6(CommandSet):
|
|
|
|
"""Default commands for dual afi commands."""
|
2021-01-18 21:26:19 +01:00
|
|
|
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"
|
2021-01-18 21:30:57 +01:00
|
|
|
ping: StrictStr = "/ping {target} source-address {source}"
|
2021-01-18 21:42:09 +01:00
|
|
|
traceroute: StrictStr = (
|
|
|
|
"/traceroute {target} source-address {source} wait 2 seconds"
|
|
|
|
)
|
|
|
|
|
2021-01-18 20:38:51 +01:00
|
|
|
|
|
|
|
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()
|