Is there any way to find a device (or list of devices) matching a partial UUID using the Python SDK, similar to how Balena CLI does it? All of the device queries seem to require a full 128-bit UUID. The best I could find was calling
get_all() to get the entire list of all devices, then looping over the list to look for matches, but that’s really inefficient.
We’re trying to write a wrapper script for Balena CLI so we can interact with devices by name instead of UUID. When working on multiple customer devices, it’s really hard to keep things straight and not accidentally operate on the wrong device when just looking at UUIDs. It’s much easier for developers to look at device names and know if it’s the right device. I’ve brought up allowing the use of device names in the CLI before (https://forums.balena.io/t/balena-tunnel-device-not-found-device-is-active-other-cli-commands-work) and I still think that’s the best solution by far, but since the CLI team doesn’t seem keen on it we’re trying to find an acceptable work-around.