diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f55dd7..42eb38a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.8.2 (2024-07-05) + +### Changes + +- Added downloadSizeLimit parameter to the DownloadDebugResource function. + ## 0.8.1 (2024-07-04) ### Changes diff --git a/python/mujinwebstackclient/version.py b/python/mujinwebstackclient/version.py index 5a49596..854921f 100644 --- a/python/mujinwebstackclient/version.py +++ b/python/mujinwebstackclient/version.py @@ -1,4 +1,4 @@ -__version__ = '0.8.0' +__version__ = '0.8.2' # Do not forget to update CHANGELOG.md diff --git a/python/mujinwebstackclient/webstackclient.py b/python/mujinwebstackclient/webstackclient.py index f3f2c34..1fbe452 100644 --- a/python/mujinwebstackclient/webstackclient.py +++ b/python/mujinwebstackclient/webstackclient.py @@ -1105,16 +1105,21 @@ def GetDebugResources(self, timeout=5): """ return self.ObjectsWrapper(self._webclient.APICall('GET', u'debug/', timeout=timeout)) - def DownloadDebugResource(self, debugresourcepk, timeout=10): + def DownloadDebugResource(self, debugresourcepk, downloadSizeLimit=100*1024*1024, timeout=10): """downloads contents of the given debug resource :param debugresourcepk: Exact name of the debug resource to download + :param downloadSizeLimit: Limit of the size of the debug resource to download, defaults to 100*1024*1024 bytes :param timeout: Amount of time in seconds to wait before failing, defaults to 10 :raises WebstackClientError: If request wasn't successful :return: Contents of the requested resource """ # custom http call because APICall currently only supports json - response = self._webclient.Request('GET', '/api/v1/debug/%s/download/' % debugresourcepk, stream=True, timeout=timeout) + # params is used to store query parameters and passed to the request + params = { + 'sizeLimit' : downloadSizeLimit + } + response = self._webclient.Request('GET', '/api/v1/debug/%s/download/' % debugresourcepk, stream=True, timeout=timeout, params=params) if response.status_code != 200: raise WebstackClientError(response.content.decode('utf-8'), response=response) return response