Hey,
We have been using landscape-client to interact with our devices. Those interactions usually involve remodelling, updating validation sets, snap settings, etc, over landscape scripts.
Now we have designed a new application, which is intended to do those actions over the snapd interface while still getting those commands over landscape.
My question is, Is there a way to communicate control snap with the landscape-client?
I was thinking of having some settings on control snap(defined in configure hook), so the landscape client can set them over snapd to trigger actions, but some of the actions contain payloads/files eg, new model assertion, etc(we get those over landscape script attachments), which we can send it over snap settings. Maybe some content interfaces or a dbus plug to send commands with payloads/notify external applications?
This goes way beyond my knowledge of landscape (I have never seen the code or attempted something like you try over there), since this goes rather into landscape territory it is perhaps better to ask this on discourse.ubuntu.com in the landscape category where some of the developers seem to read along:
I think if I was trying to achieve what you are trying to, I would use the snapd interface to trigger snap set and get commands on the control snap as you suggest.
For sharing files - you have the option to attach files to scripts - you possibly then could set a value in the control snap with the contents of these files? It might work if the file isn’t too big.
The content interface is also another way, but the Landscape client currently only supports the content interface on the annotations directory but that does allow other snaps to read/write to that folder - you could request an additional one on a temporary folder but we’d have to look into whether that would work as intended.
Thanks a lot, I have tried to sent file over snapd as snap setting by encoding it to base64, looks working well at least for small size files(3k bytes).
For now, it should be okey to use it like that for solving our problem, in case we need content interface, i will file a feature request.