forked from mirrors/thatmattlove-hyperglass
Add 6WIND directives
This commit is contained in:
parent
0b2fbb1b4d
commit
72403eb4ab
1 changed files with 76 additions and 0 deletions
76
hyperglass/defaults/directives/sixwind_os.py
Normal file
76
hyperglass/defaults/directives/sixwind_os.py
Normal file
|
|
@ -0,0 +1,76 @@
|
||||||
|
"""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,
|
||||||
|
)
|
||||||
Loading…
Add table
Reference in a new issue