diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/configsession.py | 14 | ||||
-rw-r--r-- | python/vyos/opmode.py | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/python/vyos/configsession.py b/python/vyos/configsession.py index 3a60f6d92..9864aa5c5 100644 --- a/python/vyos/configsession.py +++ b/python/vyos/configsession.py @@ -34,6 +34,8 @@ 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'] +ADD = ['/opt/vyatta/bin/vyatta-op-cmd-wrapper', 'add'] +DELETE = ['/opt/vyatta/bin/vyatta-op-cmd-wrapper', 'delete'] # Default "commit via" string APP = "vyos-http-api" @@ -204,3 +206,15 @@ class ConfigSession(object): def reset(self, path): out = self.__run_command(RESET + path) return out + + def add_container_image(self, name): + out = self.__run_command(ADD + ['container', 'image'] + [name]) + return out + + def delete_container_image(self, name): + out = self.__run_command(DELETE + ['container', 'image'] + [name]) + return out + + def show_container_image(self): + out = self.__run_command(SHOW + ['container', 'image']) + return out diff --git a/python/vyos/opmode.py b/python/vyos/opmode.py index 5ff768859..17a9ab581 100644 --- a/python/vyos/opmode.py +++ b/python/vyos/opmode.py @@ -66,7 +66,7 @@ class InternalError(Error): def _is_op_mode_function_name(name): - if re.match(r"^(show|clear|reset|restart)", name): + if re.match(r"^(show|clear|reset|restart|add|delete)", name): return True else: return False |