Rancher Event notifications

I’m looking to implement some utilities that will need to react to “events” occurring in a Rancher cluster. Specifically, I want to be informed about new containers being created/terminated.
What’s the best way to do this via the API? Is there a way to register a Web callback to be called with events or something in the API that opens a websocket to stream event data? Or is the only way to poll for new events?
Can you point me to the specific API calls?

There’s a websocket that the UI uses to keep everything up to date… /v1/projects//subscribe?eventNames=resource.change

Here’s a nodejs example:

1 Like