Skip to content

NotificationPolicy🔗

A Route is a node that contains definitions of how to handle alerts. This is modified

from the upstream alertmanager in that it adds the ObjectMatchers property.

Definition🔗

type NotificationPolicy struct {
    ActiveTimeIntervals []string `json:"active_time_intervals,omitempty"`
    Continue *bool `json:"continue,omitempty"`
    GroupBy []string `json:"group_by,omitempty"`
    GroupInterval *string `json:"group_interval,omitempty"`
    GroupWait *string `json:"group_wait,omitempty"`
    // Deprecated. Remove before v1.0 release.
    Match map[string]string `json:"match,omitempty"`
    MatchRe *alerting.MatchRegexps `json:"match_re,omitempty"`
    // Matchers is a slice of Matchers that is sortable, implements Stringer, and
    // provides a Matches method to match a LabelSet against all Matchers in the
    // slice. Note that some users of Matchers might require it to be sorted.
    Matchers *alerting.Matchers `json:"matchers,omitempty"`
    MuteTimeIntervals []string `json:"mute_time_intervals,omitempty"`
    ObjectMatchers *alerting.ObjectMatchers `json:"object_matchers,omitempty"`
    Provenance *alerting.Provenance `json:"provenance,omitempty"`
    Receiver *string `json:"receiver,omitempty"`
    RepeatInterval *string `json:"repeat_interval,omitempty"`
    Routes []alerting.NotificationPolicy `json:"routes,omitempty"`
}

Methods🔗

UnmarshalJSONStrict🔗

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode NotificationPolicy from JSON.

Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (notificationPolicy *NotificationPolicy) UnmarshalJSONStrict(raw []byte) error

Equals🔗

Equals tests the equality of two NotificationPolicy objects.

func (notificationPolicy *NotificationPolicy) Equals(other NotificationPolicy) bool

Validate🔗

Validate checks all the validation constraints that may be defined on NotificationPolicy fields for violations and returns them.

func (notificationPolicy *NotificationPolicy) Validate() error

See also🔗