diff --git a/CHANGELOG/CHANGELOG.md b/CHANGELOG/CHANGELOG.md index 5b15abaa..41e60db1 100644 --- a/CHANGELOG/CHANGELOG.md +++ b/CHANGELOG/CHANGELOG.md @@ -1,3 +1,45 @@ +# [1.17.0](https://github.com/rapyuta-robotics/rapyuta-io-sdk/compare/v1.16.0...v1.17.0) (2024-08-01) + + +### Features + +* **devices:** filter device list by name ([#87](https://github.com/rapyuta-robotics/rapyuta-io-sdk/issues/87)) ([8be2eaf](https://github.com/rapyuta-robotics/rapyuta-io-sdk/commit/8be2eaf4a24c9c1e3508967a2561af1763e63f58)) + +# [1.16.0](https://github.com/rapyuta-robotics/rapyuta-io-sdk/compare/v1.15.1...v1.16.0) (2024-06-27) + + +### Features + +* **device:** allow custom config variables and labels during creation ([#80](https://github.com/rapyuta-robotics/rapyuta-io-sdk/issues/80)) ([5834b1e](https://github.com/rapyuta-robotics/rapyuta-io-sdk/commit/5834b1ec4dd969142021c7b6d8e44f0b63e2757a)) + +## [1.15.1](https://github.com/rapyuta-robotics/rapyuta-io-sdk/compare/v1.15.0...v1.15.1) (2024-06-04) + + +### Bug Fixes + +* **package:** removes parameter value validation ([df2f0dc](https://github.com/rapyuta-robotics/rapyuta-io-sdk/commit/df2f0dcf2874759775929557285053b0191f6d0a)) +* **paramserver:** validates yaml or json data ([#77](https://github.com/rapyuta-robotics/rapyuta-io-sdk/issues/77)) ([a543f71](https://github.com/rapyuta-robotics/rapyuta-io-sdk/commit/a543f71a1fefde347f8721187b7094a161b2dc50)) +* **utils:** corrects exception handling in parse_json ([c16d229](https://github.com/rapyuta-robotics/rapyuta-io-sdk/commit/c16d22972d544e35464f64073cb6cab9fb69fb87)) + +# [1.15.0](https://github.com/rapyuta-robotics/rapyuta-io-sdk/compare/v1.14.0...v1.15.0) (2024-02-27) + + +### Features + +* **deployment:** adds support for host subpath uid/gid/perm ([d2ee458](https://github.com/rapyuta-robotics/rapyuta-io-sdk/commit/d2ee458f2ff1e51b9718059e07a57b4f18614d8c)) + +# [1.14.0](https://github.com/rapyuta-robotics/rapyuta-io-sdk/compare/v1.13.0...v1.14.0) (2024-01-22) + + +### Bug Fixes + +* **paramserver:** raise exception during download when trees not found ([#73](https://github.com/rapyuta-robotics/rapyuta-io-sdk/issues/73)) ([42f2c41](https://github.com/rapyuta-robotics/rapyuta-io-sdk/commit/42f2c4100e1383fea7bae1ff63b7aaf9f64c17a1)) + + +### Features + +* **params:** use binary file-upload if file is large ([f276b33](https://github.com/rapyuta-robotics/rapyuta-io-sdk/commit/f276b33cf4dedc7a5d7271fe1daada9ef8f4849e)) + # [1.13.0](https://github.com/rapyuta-robotics/rapyuta-io-sdk/compare/v1.12.0...v1.13.0) (2023-12-13) diff --git a/rapyuta_io/__init__.py b/rapyuta_io/__init__.py index 80e82d06..b4fb4322 100644 --- a/rapyuta_io/__init__.py +++ b/rapyuta_io/__init__.py @@ -15,4 +15,4 @@ from .clients.rosbag import UploadOptions from .clients.user_group import UserGroup -__version__ = "1.13.0" +__version__ = "1.17.0" diff --git a/rapyuta_io/clients/device_manager.py b/rapyuta_io/clients/device_manager.py index 22e52761..59a69bf7 100644 --- a/rapyuta_io/clients/device_manager.py +++ b/rapyuta_io/clients/device_manager.py @@ -38,12 +38,17 @@ def _add_auth_token_to_devices(self, devices): setattr(device, '_auth_token', self._auth_token) setattr(device, '_project', self._project) - def _get_device(self, device_id=None, retry_limit=0): + def _get_device(self, device_id=None, retry_limit=0, device_name=None): url = self._device_api_host + DEVICE_API_PATH if device_id: url = url + device_id + + query = {} + if device_name is not None: + query = {"name": device_name} + headers = create_auth_header(self._auth_token, self._project) - response = RestClient(url).retry(retry_limit).headers(headers).execute() + response = RestClient(url).retry(retry_limit).headers(headers).query_param(query_param=query).execute() return get_api_response_data(response) @staticmethod @@ -69,14 +74,14 @@ def _device_selection_by_arch(self, arch_list, retry_limit): def set_project(self, project): self._project = project - def device_list(self, online_device=False, arch_list=None, retry_limit=0): + def device_list(self, online_device=False, arch_list=None, retry_limit=0, device_name=None): arch_filtered_uuids = set() if arch_list: for device in self._device_selection_by_arch(arch_list, retry_limit): arch_filtered_uuids.add(device['uuid']) # TODO(shivam): if arch_list is set there's no need for _get_device all - device_list = self._get_device(retry_limit=retry_limit) + device_list = self._get_device(retry_limit=retry_limit, device_name=device_name) devices = [] # todo: add a generic filter like status, name etc for device in device_list: diff --git a/rapyuta_io/rio_client.py b/rapyuta_io/rio_client.py index 7c70d0ff..311fe563 100644 --- a/rapyuta_io/rio_client.py +++ b/rapyuta_io/rio_client.py @@ -389,7 +389,7 @@ def get_user_organizations(self): """ return self._core_api_client.get_user_organizations() - def get_all_devices(self, online_device=False, arch_list=None, retry_limit=0): + def get_all_devices(self, online_device=False, arch_list=None, retry_limit=0, device_name=None): """ Get all the devices @@ -404,6 +404,8 @@ def get_all_devices(self, online_device=False, arch_list=None, retry_limit=0): :param retry_limit: No of retry attempts to be carried out if any failures occurs\ during the API call. :type retry_limit: int + :param device_name: Optional parameter to filter the devices based on the device name. + :type device_name: str :return: List of instances of :py:class:`~Device` class :raises: :py:class:`APIError`: If the API returns an error, a status code of anything other than 200/201 is returned @@ -418,7 +420,7 @@ def get_all_devices(self, online_device=False, arch_list=None, retry_limit=0): >>> DeviceArch.ARM32V7, DeviceArch.ARM64V8, DeviceArch.AMD64]) """ - return self._dmClient.device_list(online_device, arch_list, retry_limit) + return self._dmClient.device_list(online_device, arch_list, retry_limit, device_name=device_name) def get_device(self, device_id, retry_limit=0): """