diff options
author | Daniil Baturin <daniil@vyos.io> | 2024-11-07 17:46:27 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-07 17:46:27 +0000 |
commit | 3eb66e36b81c835f802900c4bc2e973e2657fa31 (patch) | |
tree | 39e8061bcd16155b80b6ab1747b27aa68b43f9ad /python/vyos/configsession.py | |
parent | c97980d18610d8d48a726986139fed29ad03137a (diff) | |
parent | 18a9cec3deb6cc2dc49020a89208dc70defe9822 (diff) | |
download | vyos-1x-3eb66e36b81c835f802900c4bc2e973e2657fa31.tar.gz vyos-1x-3eb66e36b81c835f802900c4bc2e973e2657fa31.zip |
T6695: Machine-readable operational mode support for traceroute
Diffstat (limited to 'python/vyos/configsession.py')
-rw-r--r-- | python/vyos/configsession.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/python/vyos/configsession.py b/python/vyos/configsession.py index 5876dc5b0..90b96b88c 100644 --- a/python/vyos/configsession.py +++ b/python/vyos/configsession.py @@ -66,6 +66,16 @@ REBOOT = ['/opt/vyatta/bin/vyatta-op-cmd-wrapper', 'reboot'] POWEROFF = ['/opt/vyatta/bin/vyatta-op-cmd-wrapper', 'poweroff'] OP_CMD_ADD = ['/opt/vyatta/bin/vyatta-op-cmd-wrapper', 'add'] OP_CMD_DELETE = ['/opt/vyatta/bin/vyatta-op-cmd-wrapper', 'delete'] +TRACEROUTE = [ + '/usr/libexec/vyos/op_mode/mtr_execute.py', + 'mtr', + '--for-api', + '--report-mode', + '--report-cycles', + '1', + '--json', + '--host', +] # Default "commit via" string APP = 'vyos-http-api' @@ -335,3 +345,7 @@ class ConfigSession(object): def show_container_image(self): out = self.__run_command(SHOW + ['container', 'image']) return out + + def traceroute(self, host): + out = self.__run_command(TRACEROUTE + [host]) + return out |