Need a mechanism through which to receive snap changes events

Bug #1637404 reported by Marcus Tomlinson
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Confirmed
High
Alejandro J. Cura
snapd (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Clients such as the snappy store scope / app, and libsnapd-glib/qt need a mechanism through which to receive snap state change signals from snapd (such as install progress, snap installed / uninstalled, etc.).

During the Devices Sprint it was decided that it would be sufficient enough for ALL events to be broadcasted to ALL subscribers. It'd then be left up to the receiving end to ignore those events it wasn't concerned with.

E.g. An event would simply say something along the lines of: “snap X changed from state A to state B”

description: updated
summary: - Dig up events logic from commit history
+ Need a mechanism through which to receive snap changes events
Changed in snapd (Ubuntu):
importance: Undecided → High
Changed in canonical-devices-system-image:
assignee: nobody → Pat McGowan (pat-mcgowan)
importance: Undecided → High
milestone: none → p2
status: New → Confirmed
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in snapd (Ubuntu):
status: New → Confirmed
Changed in canonical-devices-system-image:
assignee: Pat McGowan (pat-mcgowan) → Alejandro J. Cura (alecu)
Changed in snapd (Ubuntu):
importance: High → Medium
Revision history for this message
Robert Ancell (robert-ancell) wrote :

A proposed solution would be to use [newline delimited JSON](http://ndjson.org/). This would be simpler for clients to manage rather than something heavier like websockets. An example showing how an install event might be sent:

GET /2.0/events HTTP/1.1

HTTP/1.1 200 OK
Content-Type: application/x-ndjson
(snapd blocks)
(a client installs hello-world)
(snapd returns)
{"snaps":{"hello-world":{"status":"installed"}}

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.