func APILabelSetToModelLabelSet(apiLabelSet open_api_models.LabelSet) prometheus_model.LabelSet
APILabelSetToModelLabelSet converts open_api_models.LabelSet to prometheus_model.LabelSet.
func AlertToOpenAPIAlert(alert *types.Alert, status types.AlertStatus, receivers []string) *open_api_models.GettableAlert
AlertToOpenAPIAlert converts internal alerts, alert types, and receivers to *open_api_models.GettableAlert.
func CheckSilenceMatchesFilterLabels(s *silencepb.Silence, matchers []*labels.Matcher) bool
CheckSilenceMatchesFilterLabels returns true if a given silence matches a list of matchers. A silence matches a filter (list of matchers) if for all matchers in the filter, there exists a matcher in the silence such that their names, types, and values are equivalent.
func GettableSilenceFromProto(s *silencepb.Silence) (open_api_models.GettableSilence, error)
GettableSilenceFromProto converts *silencepb.Silence to open_api_models.GettableSilence.
func ModelLabelSetToAPILabelSet(modelLabelSet prometheus_model.LabelSet) open_api_models.LabelSet
ModelLabelSetToAPILabelSet converts prometheus_model.LabelSet to open_api_models.LabelSet.
func OpenAPIAlertsToAlerts(apiAlerts open_api_models.PostableAlerts) []*types.Alert
OpenAPIAlertsToAlerts converts open_api_models.PostableAlerts to []*types.Alert.
func PostableSilenceToProto(s *open_api_models.PostableSilence) (*silencepb.Silence, error)
PostableSilenceToProto converts *open_api_models.PostableSilenc to *silencepb.Silence.
func SortSilences(sils open_api_models.GettableSilences)
SortSilences sorts first according to the state "active, pending, expired" then by end time or start time depending on the state. active silences should show the next to expire first pending silences are ordered based on which one starts next expired are ordered based on which one expired most recently
API represents an Alertmanager API v2
type API struct { Handler http.Handler // contains filtered or unexported fields }
func NewAPI( alerts provider.Alerts, gf groupsFn, sf getAlertStatusFn, silences *silence.Silences, peer cluster.ClusterPeer, l log.Logger, r prometheus.Registerer, ) (*API, error)
NewAPI returns a new Alertmanager API v2
func (api *API) Update(cfg *config.Config, setAlertStatus setAlertStatusFn)
Update sets the API struct members that may change between reloads of alertmanager.
Name | Synopsis |
---|---|
.. | |
client | |
alert | |
alertgroup | |
general | |
receiver | |
silence | |
models | |
restapi | Package restapi Alertmanager API |
operations | |
alert | |
alertgroup | |
general | |
receiver | |
silence |