instance.status/v1
What a multisite host knows about the instances it runs, as it changes. The host supervises every start: it launches
the instance through its runtime, asks the instance's health endpoint until it answers, and listens for the
runtime's exit signal (runtime/v1's ExitNotifier).
A host-scope service contract (status.go).
Use
Take it from the host's scope once the host is set up, and subscribe:
st := statusv1.Contract.MustIn(h.Scope)
cancel := st.Subscribe(func(s statusv1.Status) { report(s.InstanceID, s.State) })
Current() lists every instance that isn't idle, for sending the full picture again (after a control plane comes
back, say).
Provide
ext/multisite provides it by default on every host. Its runtime implements
runtime/v1's ExitNotifier (and RunningLister, HealthChecker when it has them) so the states are right.
Extensions
No extension declares this contract yet.
License
MIT
Questions and comments
Comments are a GitHub Discussions thread; sign in with GitHub to post.