Snapd-control interface and controlling refreshes

I have read the description of the snapd-control interface here https://snapcraft.io/docs/snapd-control-interface

So to confirm the snap-control interface can only be used to set the refresh schedule to managed as opposed to automatic.

Is there any way to have control over all the refresh attributes (timer, retain, hold, metered) from within a snap?

Hi Jenny.

The control-interface enables using snap set (or equivalent REST API calls) which means in theory you can patch settings this way, but this seems very unlikely to be approved as an appropriate use-case.

Would you please share a little more detail about what and the why of your use case, perhaps there are other ways.

Thanks for the reply. We would like to be able to control the refresh settings on our devices remotely. So for example the default settings could be to have refresh.metered=hold to avoid incurring data changes. However during a time window which suits the customer we could allow refresh to happen. Due to the volume of devices it would not be practical to do this on a one by one basis, so we would hope to achieve using a API call to our own published snaps. So basically we would want one of our own snaps to change the refresh settings for the whole system/device - not just for that snap itself. I appreciate there are many reasons why this might not be acceptable so also very interested in other ways to achieve the same.

What solution did you come up with?

Actually we did not solve this problem from within our snaps. We put the refresh hold in place using a remote ssh session…if we revisit this topic in the future I will update here.