diff options
author | John Estabrook <jestabro@vyos.io> | 2023-01-09 14:48:04 -0600 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2023-01-09 15:39:47 -0600 |
commit | ba4aebaaa816d810727ded073d3b09c1723cded7 (patch) | |
tree | 3368415980dba67ac3ae25dc442329c6882fdb7f /python/vyos/configsession.py | |
parent | f440fbc9ba9019b25fb9f059357052701d990ef3 (diff) | |
download | vyos-1x-ba4aebaaa816d810727ded073d3b09c1723cded7.tar.gz vyos-1x-ba4aebaaa816d810727ded073d3b09c1723cded7.zip |
container: T4880: add REST API endpoint for add/delelete/show images
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 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 |