Feature request: ability to download/cache snaps via snapd api

Hi, We have experienced multiple instances of failing an update due to slow downloads (some stemming from the Canonical infrastructure, some stemming from our end-user network bandwidth throughput). In order to prevent this cases, we would like to be able to trigger the download via a new snapd API request. Envisioning an update to the /v2/snaps endpoint with this type of request:

{
    "action": "cache",
    "transaction": "all-package"
}

and then on refresh an additional parameter to use store or cache as the source:

{
    "action": "refresh",
    "source": "cache",
    "transaction": "all-package"
}

I can provide additional information about our use case upon request.

Regards, Vlad

1 Like

I second this feature request. Having the ability to stage updates prior to apply them helps to decrease the overall downtime of the device. This can ensure a common downtime event, regardless of the network performance especially for interactive devices. For example the download can take longer for wireless vs wired but could be done in up-time.