Check update progress of a certain device

I am curious, since i often run large updates it would be cool, if i could check the update progress of certain device e.g.: how many layers did it download so far and how many layers remain to be downloaded. Furthermore getting the size of each layer might be of further interest :slight_smile:

Is there a way to do this manually?
Are there some logs that might indicate the progress?

Hi there,

Thank you for the interesting questions, there are overall_status and overall_progress fields that help you track the progress of an update however they have to be explicitly requested in a $select for a request, this is possible via the API directly and in the JS SDK.

This is the API call for this:

curl 'https://api.balena-cloud.com/v5/device?$filter=startswith(uuid,%27<DEVICE_UUID>%27)&$select=overall_status,overall_progress' -H 'authorization: Bearer <TOKEN>'
and for the JS SDK:

await sdk.models.device.get('<deviceUuid>', { $select: ['overall_status', 'overall_progress'] });
in both cases you just need to replace the with the uuid of the device you want to monitor.

We don’t provide the information like how many layers downloaded or remain to be downloaded and their size but I will raise this with the team to see if we can support it soon.

Hi, I got a response from one of our API maintainers. You can can get the image download percentage from the image_install entries. However as for the more detailed information we doubt we will add such soon as this will increase the data/payload from the device and that would affect users with limited mobile data plans.

Thanks,
Zahari

You are probably referring to

balena.models.device.get_with_service_details('UUID')['current_services']['my_app'][1]['download_progress']

when using the python SDK. This seems to be what you described, since it shows the progress in percent and it works for me :slight_smile:


Sadly your suggestion did not seem to work, since i always get an internal server error as a result. But i might be running an older version of OpenBalena and therefore am not supporting it correctly.

What did not seem to work for you exactly? Perhaps we can help craft a query which does what you want :slight_smile:

Sorry, my post might be confusing, i updated to make it easier to understand :slight_smile:

Hi @Langhalsdino, indeed, updating your openBalena version would probably resolve that error. I see that we implemented overall_progress late February, although we have overall_status field since almost 1 year ago.

Anyway, it seems like you found a workaround by using that Python SDK method, right?
Let us know if we could help out further.

Yes this worked for me :slight_smile: