Skip to content

Commit

Permalink
Merge pull request #44 from mujin/restoreitl
Browse files Browse the repository at this point in the history
Make Restore be able to restore ITL programs
  • Loading branch information
ziyan authored Oct 16, 2024
2 parents aa9cf48 + 48c153a commit 92c3d00
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/mujinwebstackclient/webstackclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -1072,19 +1072,23 @@ def Backup(self, saveconfig=True, savemedia=True, backupscenepks=None, saveapps=
raise WebstackClientError(response.content.decode('utf-8'), response=response)
return response

def Restore(self, file, restoreconfig=True, restoremedia=True, timeout=600):
def Restore(self, file, restoreconfig=True, restoremedia=True, restoreapps=True, restoreitl=True, timeout=600):
"""Uploads a previously downloaded backup file to restore
:param file: Backup filer in tarball format
:param restoreconfig: Whether we want to restore the configs, defaults to True
:param restoremedia: Whether we want to restore the media data, defaults to True
:param restoreapps: Whether we want to restore the web apps, defaults to True
:param restoreitl: Whether we want to restore the itl programs, defaults to True
:param timeout: Amount of time in seconds to wait before failing, defaults to 600
:raises WebstackClientError: If request wasn't successful
:return: JSON response
"""
response = self._webclient.Request('POST', '/backup/', files={'file': file}, params={
'media': 'true' if restoremedia else 'false',
'config': 'true' if restoreconfig else 'false',
'apps': 'true' if restoreapps else 'false',
'itl': 'true' if restoreitl else 'false',
}, timeout=timeout)
if response.status_code in (200,):
try:
Expand Down

0 comments on commit 92c3d00

Please # to comment.