Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.9.19 (2025-09-25)

### Changes

- Add `backupSceneFormat` option to the backup API.

## 0.9.18 (2025-09-11)

- Re-generate graph api.
Expand Down
6 changes: 4 additions & 2 deletions bin/mujin_webstackclientpy_downloaddata.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def _ParseArguments():
parser.add_argument('--url', type=str, default='http://127.0.0.1', help='URL of the controller (default: %(default)s)')
parser.add_argument('--username', type=str, default='mujin', help='Username to login with (default: %(default)s)')
parser.add_argument('--password', type=str, default='mujin', help='Password to login with (default: %(default)s)')
parser.add_argument('--backupSceneFormat', type=str, default=None, help='The scene format to use in backup files, one of "msgpack", "json", or "yaml" (default: %(default)s)')
parser.add_argument('--timeout', type=float, default=600, help='Timeout in seconds (default: %(default)s)')
return parser.parse_args()

Expand Down Expand Up @@ -65,14 +66,15 @@ def _GetScenes(webClient):
return sceneList


def _DownloadBackup(webClient, sceneList, timeout=600.0):
def _DownloadBackup(webClient, sceneList, backupSceneFormat, timeout=600.0):
import re
import tarfile

log.info('downloading scenes %s and all configs', sceneList)
response = webClient.Backup(
saveconfig=True,
backupscenepks=sceneList,
backupSceneFormat=backupSceneFormat,
timeout=timeout,
)

Expand All @@ -92,7 +94,7 @@ def _Main():

webClient = _CreateWebstackClient(options.url, options.username, options.password)
sceneList = _GetScenes(webClient)
downloadDirectory = _DownloadBackup(webClient, sceneList, timeout=options.timeout)
downloadDirectory = _DownloadBackup(webClient, sceneList, options.backupSceneFormat, timeout=options.timeout)
print(downloadDirectory) # other scripts can read stdout and learn the directory path


Expand Down
2 changes: 1 addition & 1 deletion python/mujinwebstackclient/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '0.9.18'
__version__ = '0.9.19'

# Do not forget to update CHANGELOG.md
4 changes: 3 additions & 1 deletion python/mujinwebstackclient/webstackclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ def DeleteAllITLPrograms(self, timeout=5):
# Backup restore
#

def Backup(self, saveconfig=True, savemedia=True, backupscenepks=None, savewebapps=True, saveitl=True, savedetection=False, savestate=True, savecalibration=False, savedebug=False, saveeds=True, saveiodd=True, timeout=600):
def Backup(self, saveconfig=True, savemedia=True, backupscenepks=None, backupSceneFormat=None, savewebapps=True, saveitl=True, savedetection=False, savestate=True, savecalibration=False, savedebug=False, saveeds=True, saveiodd=True, timeout=600):
"""Downloads a backup file

:param saveconfig: Whether we want to include configs in the backup, defaults to True
Expand All @@ -1060,6 +1060,7 @@ def Backup(self, saveconfig=True, savemedia=True, backupscenepks=None, savewebap
:param saveeds: Whether we want to include eds files in the backup, defaults to True
:param saveiodd: Whether we want to include iodd files in the backup, defaults to True
:param backupscenepks: List of scenes to backup, defaults to None
:param backupSceneFormat: The scene format to use in backup files, defaults to None
:param timeout: Amount of time in seconds to wait before failing, defaults to 600
:raises WebstackClientError: If request wasn't successful
:return: A streaming response to the backup file
Expand All @@ -1080,6 +1081,7 @@ def Backup(self, saveconfig=True, savemedia=True, backupscenepks=None, savewebap
'eds': 'true' if saveeds else 'false',
'iodd': 'true' if saveiodd else 'false',
'backupScenePks': ','.join(backupscenepks) if backupscenepks else None,
'backupSceneFormat': backupSceneFormat,
},
timeout=timeout,
)
Expand Down