forked from mirrors/thatmattlove-hyperglass
76 lines
1.9 KiB
Python
76 lines
1.9 KiB
Python
"""Default 6WIND Directives."""
|
|
|
|
# Project
|
|
from hyperglass.models.directive import (
|
|
Text,
|
|
RuleWithIPv4,
|
|
RuleWithIPv6,
|
|
RuleWithPattern,
|
|
BuiltinDirective,
|
|
)
|
|
|
|
__all__ = (
|
|
"SixWind_BGPRoute",
|
|
"SixWind_Ping",
|
|
"SixWind_Traceroute",
|
|
)
|
|
|
|
NAME = "6WIND"
|
|
PLATFORMS = ["sixwind_os"]
|
|
|
|
SixWind_BGPRoute = BuiltinDirective(
|
|
id="__hyperglass_sixwind_os_bgp_route__",
|
|
name="BGP Route",
|
|
rules=[
|
|
RuleWithIPv4(
|
|
condition="0.0.0.0/0",
|
|
action="permit",
|
|
command="show bgp ipv4 unicast prefix {target}",
|
|
),
|
|
RuleWithIPv6(
|
|
condition="::/0",
|
|
action="permit",
|
|
command="show bgp ipv6 unicast prefix {target}",
|
|
),
|
|
],
|
|
field=Text(description="IP Address, Prefix, or Hostname"),
|
|
platforms=PLATFORMS,
|
|
)
|
|
|
|
SixWind_Ping = BuiltinDirective(
|
|
id="__hyperglass_sixwind_os_ping__",
|
|
name="Ping",
|
|
rules=[
|
|
RuleWithIPv4(
|
|
condition="0.0.0.0/0",
|
|
action="permit",
|
|
command="cmd ping packetsize 256 source {source4} {target}",
|
|
),
|
|
RuleWithIPv6(
|
|
condition="::/0",
|
|
action="permit",
|
|
command="cmd ping packetsize 256 ipv6 source {source6} {target}",
|
|
),
|
|
],
|
|
field=Text(description="IP Address, Prefix, or Hostname"),
|
|
platforms=PLATFORMS,
|
|
)
|
|
|
|
SixWind_Traceroute = BuiltinDirective(
|
|
id="__hyperglass_sixwind_os_traceroute__",
|
|
name="Traceroute",
|
|
rules=[
|
|
RuleWithIPv4(
|
|
condition="0.0.0.0/0",
|
|
action="permit",
|
|
command="cmd traceroute source {source4} {target}",
|
|
),
|
|
RuleWithIPv6(
|
|
condition="::/0",
|
|
action="permit",
|
|
command="cmd traceroute ipv6 source {source6} {target}",
|
|
),
|
|
],
|
|
field=Text(description="IP Address, Prefix, or Hostname"),
|
|
platforms=PLATFORMS,
|
|
)
|