API provides registration of handlers for API routes.
type API struct {
// contains filtered or unexported fields
}
func New( alerts provider.Alerts, silences *silence.Silences, sf getAlertStatusFn, peer cluster.ClusterPeer, l log.Logger, r prometheus.Registerer, ) *API
New returns a new API.
func (api *API) Register(r *route.Router)
Register registers the API handlers under their correct routes in the given router.
func (api *API) Update(cfg *config.Config)
Update sets the configuration string to a new value.
Alert is the API representation of an alert, which is a regular alert annotated with silencing and inhibition info.
type Alert struct { *model.Alert Status types.AlertStatus `json:"status"` Receivers []string `json:"receivers"` Fingerprint string `json:"fingerprint"` }