-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: path monitoring route #296
Changes from 15 commits
e203dcb
46077d6
ec55b45
1784891
2e44a17
f3e66a1
770a460
e44fc58
57b99ca
c86b8d7
45cfcfd
6965e3e
8c04e29
d1eab26
54c3187
34e32bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1742,10 +1742,14 @@ class StaticRoute(VersionedPanObject): | |
interface (str): Next hop interface | ||
admin_dist (str): Administrative distance | ||
metric (int): Metric (Default: 10) | ||
|
||
enable_path_monitor (bool): Enable Path Monitor | ||
failure_condition: Path Monitor failure condition set 'any' or 'all' | ||
preemptive_holdtime (int): Path Monitor Preemptive Hold Time in minutes | ||
|
||
""" | ||
|
||
SUFFIX = ENTRY | ||
CHILDTYPES = ("network.PathMonitorDestination",) | ||
|
||
def _setup(self): | ||
# xpaths | ||
|
@@ -1772,6 +1776,26 @@ def _setup(self): | |
VersionedParamPath("metric", default=10, vartype="int", path="metric") | ||
) | ||
|
||
params.append( | ||
VersionedParamPath( | ||
"enable_path_monitor", path="/path-monitor/enable", vartype="yesno" | ||
) | ||
) | ||
|
||
params.append( | ||
VersionedParamPath( | ||
"failure_condition", | ||
values=("all", "any"), | ||
path="/path-monitor/failure-condition", | ||
) | ||
) | ||
|
||
params.append( | ||
VersionedParamPath( | ||
"preemptive_holdtime", vartype="int", path="/path-monitor/hold-time" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please change |
||
) | ||
) | ||
|
||
self._params = tuple(params) | ||
|
||
|
||
|
@@ -1821,6 +1845,45 @@ def _setup(self): | |
self._params = tuple(params) | ||
|
||
|
||
class PathMonitorDestination(VersionedPanObject): | ||
"""PathMonitorDestination Static Route | ||
|
||
Args: | ||
name (str): Name of Path Monitor Destination | ||
enabled (bool): Enable Path Monitor Destination | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems to be |
||
source (str): Source ip of interface | ||
destination (str): Destination ip | ||
interval (int): Ping Interval (sec) (Default: 3) | ||
count (int): Ping count (Default: 5) | ||
|
||
""" | ||
|
||
SUFFIX = ENTRY | ||
|
||
def _setup(self): | ||
# xpaths | ||
self._xpaths.add_profile(value="/path-monitor/monitor-destinations") | ||
|
||
# params | ||
params = [] | ||
|
||
params.append(VersionedParamPath("enable", vartype="yesno", path="/enable")) | ||
|
||
params.append(VersionedParamPath("source", path="/source")) | ||
|
||
params.append(VersionedParamPath("destination", path="/destination")) | ||
|
||
params.append( | ||
VersionedParamPath("interval", default=3, vartype="int", path="/interval") | ||
) | ||
|
||
params.append( | ||
VersionedParamPath("count", default=5, vartype="int", path="/count") | ||
) | ||
|
||
self._params = tuple(params) | ||
|
||
|
||
class VirtualRouter(VsysOperations): | ||
"""Virtual router | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just missing the
(str)
type in this docstring.