summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2022-05-25 20:41:20 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2022-05-26 00:02:33 +0000
commit45f460a20c0bdcd05d72eda3286b2b6980998fe4 (patch)
tree538f05d6745aaf18448510ada88836551fe3b5ab /python/vyos
parentec3a05d3dfda497910d42ad99d28d977312ea7a4 (diff)
downloadvyos-1x-45f460a20c0bdcd05d72eda3286b2b6980998fe4.tar.gz
vyos-1x-45f460a20c0bdcd05d72eda3286b2b6980998fe4.zip
http-api: T4442: Add action reset
Add action 'reset' (op-mode) for HTTP-API http://localhost/reset curl --unix-socket /run/api.sock -X POST -Fkey=mykey \ -Fdata='{"op": "reset", "path": ["ip", "bgp", "192.0.2.14"]}' \ http://localhost/reset
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/configsession.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/vyos/configsession.py b/python/vyos/configsession.py
index f28ad09c5..3a60f6d92 100644
--- a/python/vyos/configsession.py
+++ b/python/vyos/configsession.py
@@ -33,6 +33,7 @@ INSTALL_IMAGE = ['/opt/vyatta/sbin/install-image', '--url']
REMOVE_IMAGE = ['/opt/vyatta/bin/vyatta-boot-image.pl', '--del']
GENERATE = ['/opt/vyatta/bin/vyatta-op-cmd-wrapper', 'generate']
SHOW = ['/opt/vyatta/bin/vyatta-op-cmd-wrapper', 'show']
+RESET = ['/opt/vyatta/bin/vyatta-op-cmd-wrapper', 'reset']
# Default "commit via" string
APP = "vyos-http-api"
@@ -200,3 +201,6 @@ class ConfigSession(object):
out = self.__run_command(SHOW + path)
return out
+ def reset(self, path):
+ out = self.__run_command(RESET + path)
+ return out