Container status REST api


(Roberto Escandón) #1

Is there any way to be notified of a container status change in the API, like websockets. I saw there is an Events API, but seems that it is limited to pending operations. What I would like to have is a permanent listener of the container status. Is that possible or the only way is doing that by polling?


(Stéphane Graber) #2

Clever parsing of the events API would get you that when looking at the logging messages, but that’s pretty fragile.

We do have a plan to add a new lifecycle class of event to the events API which would let you track this in a much more standardize way than parsing log entries.


(Stéphane Graber) #3

(Roberto Escandón) #4

@stgraber thanks a lot for the reply. I’m looking forward that new class of events.


#5

@stgraber Is it possible that we expose events through the same API as well to let users know when a node in an LXD cluster changed its online status, joined or left?


(Stéphane Graber) #6

That’d likely be a different class of events as that doesn’t really fit under the lifecycle definition which is more centered around user actions on containers rather than network changes.