Documentation ¶
Index ¶
- func ContactPointConverter(input ContactPoint) string
- func MatcherConverter(input Matcher) string
- func MuteTimingConverter(input MuteTiming) string
- func NotificationPolicyConverter(input NotificationPolicy) string
- func NotificationSettingsConverter(input NotificationSettings) string
- func NotificationTemplateConverter(input NotificationTemplate) string
- func QueryConverter(input Query) string
- func RuleConverter(input Rule) string
- func RuleGroupConverter(input RuleGroup) string
- func TimeIntervalConverter(input TimeInterval) string
- func TimeIntervalItemConverter(input TimeIntervalItem) string
- func TimeIntervalTimeRangeConverter(input TimeIntervalTimeRange) string
- type ContactPoint
- type ContactPointBuilder
- func (builder *ContactPointBuilder) Build() (ContactPoint, error)
- func (builder *ContactPointBuilder) DisableResolveMessage(disableResolveMessage bool) *ContactPointBuilder
- func (builder *ContactPointBuilder) Name(name string) *ContactPointBuilder
- func (builder *ContactPointBuilder) Provenance(provenance string) *ContactPointBuilder
- func (builder *ContactPointBuilder) Settings(settings Json) *ContactPointBuilder
- func (builder *ContactPointBuilder) Type(typeArg ContactPointType) *ContactPointBuilder
- func (builder *ContactPointBuilder) Uid(uid string) *ContactPointBuilder
- type ContactPointType
- type Duration
- type Json
- type MatchRegexps
- type MatchType
- type Matcher
- type MatcherBuilder
- type Matchers
- type MuteTiming
- type MuteTimingBuilder
- type NotificationPolicy
- type NotificationPolicyBuilder
- func (builder *NotificationPolicyBuilder) Build() (NotificationPolicy, error)
- func (builder *NotificationPolicyBuilder) Continue(continueArg bool) *NotificationPolicyBuilder
- func (builder *NotificationPolicyBuilder) GroupBy(groupBy []string) *NotificationPolicyBuilder
- func (builder *NotificationPolicyBuilder) GroupInterval(groupInterval string) *NotificationPolicyBuilder
- func (builder *NotificationPolicyBuilder) GroupWait(groupWait string) *NotificationPolicyBuilder
- func (builder *NotificationPolicyBuilder) Match(match map[string]string) *NotificationPolicyBuilder
- func (builder *NotificationPolicyBuilder) MatchRe(matchRe MatchRegexps) *NotificationPolicyBuilder
- func (builder *NotificationPolicyBuilder) Matchers(matchers Matchers) *NotificationPolicyBuilder
- func (builder *NotificationPolicyBuilder) MuteTimeIntervals(muteTimeIntervals []string) *NotificationPolicyBuilder
- func (builder *NotificationPolicyBuilder) ObjectMatchers(objectMatchers ObjectMatchers) *NotificationPolicyBuilder
- func (builder *NotificationPolicyBuilder) Provenance(provenance Provenance) *NotificationPolicyBuilder
- func (builder *NotificationPolicyBuilder) Receiver(receiver string) *NotificationPolicyBuilder
- func (builder *NotificationPolicyBuilder) RepeatInterval(repeatInterval string) *NotificationPolicyBuilder
- func (builder *NotificationPolicyBuilder) Routes(routes []cog.Builder[NotificationPolicy]) *NotificationPolicyBuilder
- type NotificationSettings
- type NotificationSettingsBuilder
- func (builder *NotificationSettingsBuilder) Build() (NotificationSettings, error)
- func (builder *NotificationSettingsBuilder) GroupBy(groupBy []string) *NotificationSettingsBuilder
- func (builder *NotificationSettingsBuilder) GroupInterval(groupInterval string) *NotificationSettingsBuilder
- func (builder *NotificationSettingsBuilder) GroupWait(groupWait string) *NotificationSettingsBuilder
- func (builder *NotificationSettingsBuilder) MuteTimeIntervals(muteTimeIntervals []string) *NotificationSettingsBuilder
- func (builder *NotificationSettingsBuilder) Receiver(receiver string) *NotificationSettingsBuilder
- func (builder *NotificationSettingsBuilder) RepeatInterval(repeatInterval string) *NotificationSettingsBuilder
- type NotificationTemplate
- type NotificationTemplateBuilder
- func (builder *NotificationTemplateBuilder) Build() (NotificationTemplate, error)
- func (builder *NotificationTemplateBuilder) Name(name string) *NotificationTemplateBuilder
- func (builder *NotificationTemplateBuilder) Provenance(provenance Provenance) *NotificationTemplateBuilder
- func (builder *NotificationTemplateBuilder) Template(template string) *NotificationTemplateBuilder
- type ObjectMatcher
- type ObjectMatchers
- type Provenance
- type Query
- type QueryBuilder
- func (builder *QueryBuilder) Build() (Query, error)
- func (builder *QueryBuilder) DatasourceUid(datasourceUid string) *QueryBuilder
- func (builder *QueryBuilder) Model(model cog.Builder[variants.Dataquery]) *QueryBuilder
- func (builder *QueryBuilder) QueryType(queryType string) *QueryBuilder
- func (builder *QueryBuilder) RefId(refId string) *QueryBuilder
- func (builder *QueryBuilder) RelativeTimeRange(from Duration, to Duration) *QueryBuilder
- type RelativeTimeRange
- type Rule
- type RuleBuilder
- func (builder *RuleBuilder) Annotations(annotations map[string]string) *RuleBuilder
- func (builder *RuleBuilder) Build() (Rule, error)
- func (builder *RuleBuilder) Condition(condition string) *RuleBuilder
- func (builder *RuleBuilder) ExecErrState(execErrState RuleExecErrState) *RuleBuilder
- func (builder *RuleBuilder) FolderUID(folderUID string) *RuleBuilder
- func (builder *RuleBuilder) For(forArg string) *RuleBuilder
- func (builder *RuleBuilder) Id(id int64) *RuleBuilder
- func (builder *RuleBuilder) IsPaused(isPaused bool) *RuleBuilder
- func (builder *RuleBuilder) Labels(labels map[string]string) *RuleBuilder
- func (builder *RuleBuilder) NoDataState(noDataState RuleNoDataState) *RuleBuilder
- func (builder *RuleBuilder) NotificationSettings(notificationSettings cog.Builder[NotificationSettings]) *RuleBuilder
- func (builder *RuleBuilder) OrgID(orgID int64) *RuleBuilder
- func (builder *RuleBuilder) Provenance(provenance Provenance) *RuleBuilder
- func (builder *RuleBuilder) Queries(data []cog.Builder[Query]) *RuleBuilder
- func (builder *RuleBuilder) RuleGroup(ruleGroup string) *RuleBuilder
- func (builder *RuleBuilder) Title(title string) *RuleBuilder
- func (builder *RuleBuilder) Uid(uid string) *RuleBuilder
- func (builder *RuleBuilder) Updated(updated time.Time) *RuleBuilder
- func (builder *RuleBuilder) WithQuery(data cog.Builder[Query]) *RuleBuilder
- type RuleExecErrState
- type RuleGroup
- type RuleGroupBuilder
- func (builder *RuleGroupBuilder) Build() (RuleGroup, error)
- func (builder *RuleGroupBuilder) FolderUid(folderUid string) *RuleGroupBuilder
- func (builder *RuleGroupBuilder) Interval(interval Duration) *RuleGroupBuilder
- func (builder *RuleGroupBuilder) Rules(rules []cog.Builder[Rule]) *RuleGroupBuilder
- func (builder *RuleGroupBuilder) Title(title string) *RuleGroupBuilder
- func (builder *RuleGroupBuilder) WithRule(rule cog.Builder[Rule]) *RuleGroupBuilder
- type RuleNoDataState
- type TimeInterval
- type TimeIntervalBuilder
- type TimeIntervalItem
- type TimeIntervalItemBuilder
- func (builder *TimeIntervalItemBuilder) Build() (TimeIntervalItem, error)
- func (builder *TimeIntervalItemBuilder) DaysOfMonth(daysOfMonth []string) *TimeIntervalItemBuilder
- func (builder *TimeIntervalItemBuilder) Location(location string) *TimeIntervalItemBuilder
- func (builder *TimeIntervalItemBuilder) Months(months []string) *TimeIntervalItemBuilder
- func (builder *TimeIntervalItemBuilder) Times(times []cog.Builder[TimeIntervalTimeRange]) *TimeIntervalItemBuilder
- func (builder *TimeIntervalItemBuilder) Weekdays(weekdays []string) *TimeIntervalItemBuilder
- func (builder *TimeIntervalItemBuilder) Years(years []string) *TimeIntervalItemBuilder
- type TimeIntervalTimeRange
- type TimeIntervalTimeRangeBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContactPointConverter ¶
func ContactPointConverter(input ContactPoint) string
ContactPointConverter accepts a `ContactPoint` object and generates the Go code to build this object using builders.
func MatcherConverter ¶
MatcherConverter accepts a `Matcher` object and generates the Go code to build this object using builders.
func MuteTimingConverter ¶
func MuteTimingConverter(input MuteTiming) string
MuteTimingConverter accepts a `MuteTiming` object and generates the Go code to build this object using builders.
func NotificationPolicyConverter ¶
func NotificationPolicyConverter(input NotificationPolicy) string
NotificationPolicyConverter accepts a `NotificationPolicy` object and generates the Go code to build this object using builders.
func NotificationSettingsConverter ¶
func NotificationSettingsConverter(input NotificationSettings) string
NotificationSettingsConverter accepts a `NotificationSettings` object and generates the Go code to build this object using builders.
func NotificationTemplateConverter ¶
func NotificationTemplateConverter(input NotificationTemplate) string
NotificationTemplateConverter accepts a `NotificationTemplate` object and generates the Go code to build this object using builders.
func QueryConverter ¶
QueryConverter accepts a `Query` object and generates the Go code to build this object using builders.
func RuleConverter ¶
RuleConverter accepts a `Rule` object and generates the Go code to build this object using builders.
func RuleGroupConverter ¶
RuleGroupConverter accepts a `RuleGroup` object and generates the Go code to build this object using builders.
func TimeIntervalConverter ¶
func TimeIntervalConverter(input TimeInterval) string
TimeIntervalConverter accepts a `TimeInterval` object and generates the Go code to build this object using builders.
func TimeIntervalItemConverter ¶
func TimeIntervalItemConverter(input TimeIntervalItem) string
TimeIntervalItemConverter accepts a `TimeIntervalItem` object and generates the Go code to build this object using builders.
func TimeIntervalTimeRangeConverter ¶
func TimeIntervalTimeRangeConverter(input TimeIntervalTimeRange) string
TimeIntervalTimeRangeConverter accepts a `TimeIntervalTimeRange` object and generates the Go code to build this object using builders.
Types ¶
type ContactPoint ¶
type ContactPoint struct { DisableResolveMessage *bool `json:"disableResolveMessage,omitempty"` // Name is used as grouping key in the UI. Contact points with the // same name will be grouped in the UI. Name *string `json:"name,omitempty"` Provenance *string `json:"provenance,omitempty"` Settings Json `json:"settings"` Type ContactPointType `json:"type"` // UID is the unique identifier of the contact point. The UID can be // set by the user. Uid *string `json:"uid,omitempty"` }
EmbeddedContactPoint is the contact point type that is used by grafanas embedded alertmanager implementation.
func NewContactPoint ¶
func NewContactPoint() *ContactPoint
NewContactPoint creates a new ContactPoint object.
func (ContactPoint) Equals ¶
func (resource ContactPoint) Equals(other ContactPoint) bool
Equals tests the equality of two `ContactPoint` objects.
func (*ContactPoint) UnmarshalJSONStrict ¶
func (resource *ContactPoint) UnmarshalJSONStrict(raw []byte) error
UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `ContactPoint` 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 (ContactPoint) Validate ¶
func (resource ContactPoint) Validate() error
Validate checks all the validation constraints that may be defined on `ContactPoint` fields for violations and returns them.
type ContactPointBuilder ¶
type ContactPointBuilder struct {
// contains filtered or unexported fields
}
EmbeddedContactPoint is the contact point type that is used by grafanas embedded alertmanager implementation.
func NewContactPointBuilder ¶
func NewContactPointBuilder() *ContactPointBuilder
func (*ContactPointBuilder) Build ¶
func (builder *ContactPointBuilder) Build() (ContactPoint, error)
func (*ContactPointBuilder) DisableResolveMessage ¶
func (builder *ContactPointBuilder) DisableResolveMessage(disableResolveMessage bool) *ContactPointBuilder
func (*ContactPointBuilder) Name ¶
func (builder *ContactPointBuilder) Name(name string) *ContactPointBuilder
Name is used as grouping key in the UI. Contact points with the same name will be grouped in the UI.
func (*ContactPointBuilder) Provenance ¶
func (builder *ContactPointBuilder) Provenance(provenance string) *ContactPointBuilder
func (*ContactPointBuilder) Settings ¶
func (builder *ContactPointBuilder) Settings(settings Json) *ContactPointBuilder
func (*ContactPointBuilder) Type ¶
func (builder *ContactPointBuilder) Type(typeArg ContactPointType) *ContactPointBuilder
func (*ContactPointBuilder) Uid ¶
func (builder *ContactPointBuilder) Uid(uid string) *ContactPointBuilder
UID is the unique identifier of the contact point. The UID can be set by the user.
type ContactPointType ¶
type ContactPointType string
const ( ContactPointTypeAlertmanager ContactPointType = "alertmanager" ContactPointTypeDingding ContactPointType = " dingding" ContactPointTypeDiscord ContactPointType = " discord" ContactPointTypeEmail ContactPointType = " email" ContactPointTypeGooglechat ContactPointType = " googlechat" ContactPointTypeKafka ContactPointType = " kafka" ContactPointTypeLine ContactPointType = " line" ContactPointTypeOpsgenie ContactPointType = " opsgenie" ContactPointTypePagerduty ContactPointType = " pagerduty" ContactPointTypePushover ContactPointType = " pushover" ContactPointTypeSensugo ContactPointType = " sensugo" ContactPointTypeSlack ContactPointType = " slack" ContactPointTypeTeams ContactPointType = " teams" ContactPointTypeTelegram ContactPointType = " telegram" ContactPointTypeThreema ContactPointType = " threema" ContactPointTypeVictorops ContactPointType = " victorops" ContactPointTypeWebhook ContactPointType = " webhook" ContactPointTypeWecom ContactPointType = " wecom" )
type MatchRegexps ¶
type Matcher ¶
type Matcher struct { Name *string `json:"Name,omitempty"` Type *MatchType `json:"Type,omitempty"` Value *string `json:"Value,omitempty"` }
func (*Matcher) UnmarshalJSONStrict ¶
UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `Matcher` 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, …
type MatcherBuilder ¶
type MatcherBuilder struct {
// contains filtered or unexported fields
}
func NewMatcherBuilder ¶
func NewMatcherBuilder() *MatcherBuilder
func (*MatcherBuilder) Build ¶
func (builder *MatcherBuilder) Build() (Matcher, error)
func (*MatcherBuilder) Name ¶
func (builder *MatcherBuilder) Name(name string) *MatcherBuilder
func (*MatcherBuilder) Type ¶
func (builder *MatcherBuilder) Type(typeArg MatchType) *MatcherBuilder
func (*MatcherBuilder) Value ¶
func (builder *MatcherBuilder) Value(value string) *MatcherBuilder
type Matchers ¶
type Matchers []Matcher
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.
type MuteTiming ¶
type MuteTiming struct { Name *string `json:"name,omitempty"` TimeIntervals []TimeInterval `json:"time_intervals,omitempty"` }
func NewMuteTiming ¶
func NewMuteTiming() *MuteTiming
NewMuteTiming creates a new MuteTiming object.
func (MuteTiming) Equals ¶
func (resource MuteTiming) Equals(other MuteTiming) bool
Equals tests the equality of two `MuteTiming` objects.
func (*MuteTiming) UnmarshalJSONStrict ¶
func (resource *MuteTiming) UnmarshalJSONStrict(raw []byte) error
UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `MuteTiming` 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 (MuteTiming) Validate ¶
func (resource MuteTiming) Validate() error
Validate checks all the validation constraints that may be defined on `MuteTiming` fields for violations and returns them.
type MuteTimingBuilder ¶
type MuteTimingBuilder struct {
// contains filtered or unexported fields
}
func NewMuteTimingBuilder ¶
func NewMuteTimingBuilder() *MuteTimingBuilder
func (*MuteTimingBuilder) Build ¶
func (builder *MuteTimingBuilder) Build() (MuteTiming, error)
func (*MuteTimingBuilder) Name ¶
func (builder *MuteTimingBuilder) Name(name string) *MuteTimingBuilder
func (*MuteTimingBuilder) TimeIntervals ¶
func (builder *MuteTimingBuilder) TimeIntervals(timeIntervals []cog.Builder[TimeInterval]) *MuteTimingBuilder
type NotificationPolicy ¶
type NotificationPolicy struct { 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 *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 *Matchers `json:"matchers,omitempty"` MuteTimeIntervals []string `json:"mute_time_intervals,omitempty"` ObjectMatchers *ObjectMatchers `json:"object_matchers,omitempty"` Provenance *Provenance `json:"provenance,omitempty"` Receiver *string `json:"receiver,omitempty"` RepeatInterval *string `json:"repeat_interval,omitempty"` Routes []NotificationPolicy `json:"routes,omitempty"` }
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.
func NewNotificationPolicy ¶
func NewNotificationPolicy() *NotificationPolicy
NewNotificationPolicy creates a new NotificationPolicy object.
func (NotificationPolicy) Equals ¶
func (resource NotificationPolicy) Equals(other NotificationPolicy) bool
Equals tests the equality of two `NotificationPolicy` objects.
func (*NotificationPolicy) UnmarshalJSONStrict ¶
func (resource *NotificationPolicy) UnmarshalJSONStrict(raw []byte) error
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) Validate ¶
func (resource NotificationPolicy) Validate() error
Validate checks all the validation constraints that may be defined on `NotificationPolicy` fields for violations and returns them.
type NotificationPolicyBuilder ¶
type NotificationPolicyBuilder struct {
// contains filtered or unexported fields
}
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.
func NewNotificationPolicyBuilder ¶
func NewNotificationPolicyBuilder() *NotificationPolicyBuilder
func (*NotificationPolicyBuilder) Build ¶
func (builder *NotificationPolicyBuilder) Build() (NotificationPolicy, error)
func (*NotificationPolicyBuilder) Continue ¶
func (builder *NotificationPolicyBuilder) Continue(continueArg bool) *NotificationPolicyBuilder
func (*NotificationPolicyBuilder) GroupBy ¶
func (builder *NotificationPolicyBuilder) GroupBy(groupBy []string) *NotificationPolicyBuilder
func (*NotificationPolicyBuilder) GroupInterval ¶
func (builder *NotificationPolicyBuilder) GroupInterval(groupInterval string) *NotificationPolicyBuilder
func (*NotificationPolicyBuilder) GroupWait ¶
func (builder *NotificationPolicyBuilder) GroupWait(groupWait string) *NotificationPolicyBuilder
func (*NotificationPolicyBuilder) Match ¶
func (builder *NotificationPolicyBuilder) Match(match map[string]string) *NotificationPolicyBuilder
Deprecated. Remove before v1.0 release.
func (*NotificationPolicyBuilder) MatchRe ¶
func (builder *NotificationPolicyBuilder) MatchRe(matchRe MatchRegexps) *NotificationPolicyBuilder
func (*NotificationPolicyBuilder) Matchers ¶
func (builder *NotificationPolicyBuilder) Matchers(matchers Matchers) *NotificationPolicyBuilder
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.
func (*NotificationPolicyBuilder) MuteTimeIntervals ¶
func (builder *NotificationPolicyBuilder) MuteTimeIntervals(muteTimeIntervals []string) *NotificationPolicyBuilder
func (*NotificationPolicyBuilder) ObjectMatchers ¶
func (builder *NotificationPolicyBuilder) ObjectMatchers(objectMatchers ObjectMatchers) *NotificationPolicyBuilder
func (*NotificationPolicyBuilder) Provenance ¶
func (builder *NotificationPolicyBuilder) Provenance(provenance Provenance) *NotificationPolicyBuilder
func (*NotificationPolicyBuilder) Receiver ¶
func (builder *NotificationPolicyBuilder) Receiver(receiver string) *NotificationPolicyBuilder
func (*NotificationPolicyBuilder) RepeatInterval ¶
func (builder *NotificationPolicyBuilder) RepeatInterval(repeatInterval string) *NotificationPolicyBuilder
func (*NotificationPolicyBuilder) Routes ¶
func (builder *NotificationPolicyBuilder) Routes(routes []cog.Builder[NotificationPolicy]) *NotificationPolicyBuilder
type NotificationSettings ¶
type NotificationSettings struct { // Override the labels by which incoming alerts are grouped together. For example, multiple alerts coming in for // cluster=A and alertname=LatencyHigh would be batched into a single group. To aggregate by all possible labels // use the special value '...' as the sole label name. // This effectively disables aggregation entirely, passing through all alerts as-is. This is unlikely to be what // you want, unless you have a very low alert volume or your upstream notification system performs its own grouping. // Must include 'alertname' and 'grafana_folder' if not using '...'. GroupBy []string `json:"group_by,omitempty"` // Override how long to wait before sending a notification about new alerts that are added to a group of alerts for // which an initial notification has already been sent. (Usually ~5m or more.) GroupInterval *string `json:"group_interval,omitempty"` // Override how long to initially wait to send a notification for a group of alerts. Allows to wait for an // inhibiting alert to arrive or collect more initial alerts for the same group. (Usually ~0s to few minutes.) GroupWait *string `json:"group_wait,omitempty"` // Override the times when notifications should be muted. These must match the name of a mute time interval defined // in the alertmanager configuration mute_time_intervals section. When muted it will not send any notifications, but // otherwise acts normally. MuteTimeIntervals []string `json:"mute_time_intervals,omitempty"` // Name of the receiver to send notifications to. Receiver string `json:"receiver"` // Override how long to wait before sending a notification again if it has already been sent successfully for an // alert. (Usually ~3h or more). // Note that this parameter is implicitly bound by Alertmanager's `--data.retention` configuration flag. // Notifications will be resent after either repeat_interval or the data retention period have passed, whichever // occurs first. `repeat_interval` should not be less than `group_interval`. RepeatInterval *string `json:"repeat_interval,omitempty"` }
func NewNotificationSettings ¶
func NewNotificationSettings() *NotificationSettings
NewNotificationSettings creates a new NotificationSettings object.
func (NotificationSettings) Equals ¶
func (resource NotificationSettings) Equals(other NotificationSettings) bool
Equals tests the equality of two `NotificationSettings` objects.
func (*NotificationSettings) UnmarshalJSONStrict ¶
func (resource *NotificationSettings) UnmarshalJSONStrict(raw []byte) error
UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `NotificationSettings` 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 (NotificationSettings) Validate ¶
func (resource NotificationSettings) Validate() error
Validate checks all the validation constraints that may be defined on `NotificationSettings` fields for violations and returns them.
type NotificationSettingsBuilder ¶
type NotificationSettingsBuilder struct {
// contains filtered or unexported fields
}
func NewNotificationSettingsBuilder ¶
func NewNotificationSettingsBuilder() *NotificationSettingsBuilder
func (*NotificationSettingsBuilder) Build ¶
func (builder *NotificationSettingsBuilder) Build() (NotificationSettings, error)
func (*NotificationSettingsBuilder) GroupBy ¶
func (builder *NotificationSettingsBuilder) GroupBy(groupBy []string) *NotificationSettingsBuilder
Override the labels by which incoming alerts are grouped together. For example, multiple alerts coming in for cluster=A and alertname=LatencyHigh would be batched into a single group. To aggregate by all possible labels use the special value '...' as the sole label name. This effectively disables aggregation entirely, passing through all alerts as-is. This is unlikely to be what you want, unless you have a very low alert volume or your upstream notification system performs its own grouping. Must include 'alertname' and 'grafana_folder' if not using '...'.
func (*NotificationSettingsBuilder) GroupInterval ¶
func (builder *NotificationSettingsBuilder) GroupInterval(groupInterval string) *NotificationSettingsBuilder
Override how long to wait before sending a notification about new alerts that are added to a group of alerts for which an initial notification has already been sent. (Usually ~5m or more.)
func (*NotificationSettingsBuilder) GroupWait ¶
func (builder *NotificationSettingsBuilder) GroupWait(groupWait string) *NotificationSettingsBuilder
Override how long to initially wait to send a notification for a group of alerts. Allows to wait for an inhibiting alert to arrive or collect more initial alerts for the same group. (Usually ~0s to few minutes.)
func (*NotificationSettingsBuilder) MuteTimeIntervals ¶
func (builder *NotificationSettingsBuilder) MuteTimeIntervals(muteTimeIntervals []string) *NotificationSettingsBuilder
Override the times when notifications should be muted. These must match the name of a mute time interval defined in the alertmanager configuration mute_time_intervals section. When muted it will not send any notifications, but otherwise acts normally.
func (*NotificationSettingsBuilder) Receiver ¶
func (builder *NotificationSettingsBuilder) Receiver(receiver string) *NotificationSettingsBuilder
Name of the receiver to send notifications to.
func (*NotificationSettingsBuilder) RepeatInterval ¶
func (builder *NotificationSettingsBuilder) RepeatInterval(repeatInterval string) *NotificationSettingsBuilder
Override how long to wait before sending a notification again if it has already been sent successfully for an alert. (Usually ~3h or more). Note that this parameter is implicitly bound by Alertmanager's `--data.retention` configuration flag. Notifications will be resent after either repeat_interval or the data retention period have passed, whichever occurs first. `repeat_interval` should not be less than `group_interval`.
type NotificationTemplate ¶
type NotificationTemplate struct { Name *string `json:"name,omitempty"` Provenance *Provenance `json:"provenance,omitempty"` Template *string `json:"template,omitempty"` }
func NewNotificationTemplate ¶
func NewNotificationTemplate() *NotificationTemplate
NewNotificationTemplate creates a new NotificationTemplate object.
func (NotificationTemplate) Equals ¶
func (resource NotificationTemplate) Equals(other NotificationTemplate) bool
Equals tests the equality of two `NotificationTemplate` objects.
func (*NotificationTemplate) UnmarshalJSONStrict ¶
func (resource *NotificationTemplate) UnmarshalJSONStrict(raw []byte) error
UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `NotificationTemplate` 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 (NotificationTemplate) Validate ¶
func (resource NotificationTemplate) Validate() error
Validate checks all the validation constraints that may be defined on `NotificationTemplate` fields for violations and returns them.
type NotificationTemplateBuilder ¶
type NotificationTemplateBuilder struct {
// contains filtered or unexported fields
}
func NewNotificationTemplateBuilder ¶
func NewNotificationTemplateBuilder() *NotificationTemplateBuilder
func (*NotificationTemplateBuilder) Build ¶
func (builder *NotificationTemplateBuilder) Build() (NotificationTemplate, error)
func (*NotificationTemplateBuilder) Name ¶
func (builder *NotificationTemplateBuilder) Name(name string) *NotificationTemplateBuilder
func (*NotificationTemplateBuilder) Provenance ¶
func (builder *NotificationTemplateBuilder) Provenance(provenance Provenance) *NotificationTemplateBuilder
func (*NotificationTemplateBuilder) Template ¶
func (builder *NotificationTemplateBuilder) Template(template string) *NotificationTemplateBuilder
type ObjectMatcher ¶
type ObjectMatcher []string
type ObjectMatchers ¶
type ObjectMatchers []ObjectMatcher
type Provenance ¶
type Provenance string
type Query ¶
type Query struct { // Grafana data source unique identifier; it should be '__expr__' for a Server Side Expression operation. DatasourceUid *string `json:"datasourceUid,omitempty"` // JSON is the raw JSON query and includes the above properties as well as custom properties. Model variants.Dataquery `json:"model,omitempty"` // QueryType is an optional identifier for the type of query. // It can be used to distinguish different types of queries. QueryType *string `json:"queryType,omitempty"` // RefID is the unique identifier of the query, set by the frontend call. RefId *string `json:"refId,omitempty"` // RelativeTimeRange is the per query start and end time // for requests. RelativeTimeRange *RelativeTimeRange `json:"relativeTimeRange,omitempty"` }
func (*Query) UnmarshalJSON ¶
UnmarshalJSON implements a custom JSON unmarshalling logic to decode Query from JSON.
func (*Query) UnmarshalJSONStrict ¶
UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `Query` 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, …
type QueryBuilder ¶
type QueryBuilder struct {
// contains filtered or unexported fields
}
func NewQueryBuilder ¶
func NewQueryBuilder(refId string) *QueryBuilder
func (*QueryBuilder) Build ¶
func (builder *QueryBuilder) Build() (Query, error)
func (*QueryBuilder) DatasourceUid ¶
func (builder *QueryBuilder) DatasourceUid(datasourceUid string) *QueryBuilder
Grafana data source unique identifier; it should be '__expr__' for a Server Side Expression operation.
func (*QueryBuilder) Model ¶
func (builder *QueryBuilder) Model(model cog.Builder[variants.Dataquery]) *QueryBuilder
JSON is the raw JSON query and includes the above properties as well as custom properties.
func (*QueryBuilder) QueryType ¶
func (builder *QueryBuilder) QueryType(queryType string) *QueryBuilder
QueryType is an optional identifier for the type of query. It can be used to distinguish different types of queries.
func (*QueryBuilder) RefId ¶
func (builder *QueryBuilder) RefId(refId string) *QueryBuilder
RefID is the unique identifier of the query, set by the frontend call.
func (*QueryBuilder) RelativeTimeRange ¶
func (builder *QueryBuilder) RelativeTimeRange(from Duration, to Duration) *QueryBuilder
RelativeTimeRange is the per query start and end time for requests.
type RelativeTimeRange ¶
type RelativeTimeRange struct { // A Duration represents the elapsed time between two instants // as an int64 nanosecond count. The representation limits the // largest representable duration to approximately 290 years. From *Duration `json:"from,omitempty"` // A Duration represents the elapsed time between two instants // as an int64 nanosecond count. The representation limits the // largest representable duration to approximately 290 years. To *Duration `json:"to,omitempty"` }
RelativeTimeRange is the per query start and end time for requests.
func NewRelativeTimeRange ¶
func NewRelativeTimeRange() *RelativeTimeRange
NewRelativeTimeRange creates a new RelativeTimeRange object.
func (RelativeTimeRange) Equals ¶
func (resource RelativeTimeRange) Equals(other RelativeTimeRange) bool
Equals tests the equality of two `RelativeTimeRange` objects.
func (*RelativeTimeRange) UnmarshalJSONStrict ¶
func (resource *RelativeTimeRange) UnmarshalJSONStrict(raw []byte) error
UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `RelativeTimeRange` 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 (RelativeTimeRange) Validate ¶
func (resource RelativeTimeRange) Validate() error
Validate checks all the validation constraints that may be defined on `RelativeTimeRange` fields for violations and returns them.
type Rule ¶
type Rule struct { Annotations map[string]string `json:"annotations,omitempty"` Condition string `json:"condition"` Data []Query `json:"data"` ExecErrState RuleExecErrState `json:"execErrState"` FolderUID string `json:"folderUID"` // The amount of time, in seconds, for which the rule must be breached for the rule to be considered to be Firing. // Before this time has elapsed, the rule is only considered to be Pending. For string `json:"for"` Id *int64 `json:"id,omitempty"` IsPaused *bool `json:"isPaused,omitempty"` Labels map[string]string `json:"labels,omitempty"` NoDataState RuleNoDataState `json:"noDataState"` NotificationSettings *NotificationSettings `json:"notification_settings,omitempty"` OrgID int64 `json:"orgID"` Provenance *Provenance `json:"provenance,omitempty"` RuleGroup string `json:"ruleGroup"` Title string `json:"title"` Uid *string `json:"uid,omitempty"` Updated *time.Time `json:"updated,omitempty"` }
func (*Rule) UnmarshalJSONStrict ¶
UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `Rule` 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, …
type RuleBuilder ¶
type RuleBuilder struct {
// contains filtered or unexported fields
}
func NewRuleBuilder ¶
func NewRuleBuilder(title string) *RuleBuilder
func (*RuleBuilder) Annotations ¶
func (builder *RuleBuilder) Annotations(annotations map[string]string) *RuleBuilder
func (*RuleBuilder) Build ¶
func (builder *RuleBuilder) Build() (Rule, error)
func (*RuleBuilder) Condition ¶
func (builder *RuleBuilder) Condition(condition string) *RuleBuilder
func (*RuleBuilder) ExecErrState ¶
func (builder *RuleBuilder) ExecErrState(execErrState RuleExecErrState) *RuleBuilder
func (*RuleBuilder) FolderUID ¶
func (builder *RuleBuilder) FolderUID(folderUID string) *RuleBuilder
func (*RuleBuilder) For ¶
func (builder *RuleBuilder) For(forArg string) *RuleBuilder
The amount of time, in seconds, for which the rule must be breached for the rule to be considered to be Firing. Before this time has elapsed, the rule is only considered to be Pending.
func (*RuleBuilder) Id ¶
func (builder *RuleBuilder) Id(id int64) *RuleBuilder
func (*RuleBuilder) IsPaused ¶
func (builder *RuleBuilder) IsPaused(isPaused bool) *RuleBuilder
func (*RuleBuilder) Labels ¶
func (builder *RuleBuilder) Labels(labels map[string]string) *RuleBuilder
func (*RuleBuilder) NoDataState ¶
func (builder *RuleBuilder) NoDataState(noDataState RuleNoDataState) *RuleBuilder
func (*RuleBuilder) NotificationSettings ¶
func (builder *RuleBuilder) NotificationSettings(notificationSettings cog.Builder[NotificationSettings]) *RuleBuilder
func (*RuleBuilder) OrgID ¶
func (builder *RuleBuilder) OrgID(orgID int64) *RuleBuilder
func (*RuleBuilder) Provenance ¶
func (builder *RuleBuilder) Provenance(provenance Provenance) *RuleBuilder
func (*RuleBuilder) Queries ¶
func (builder *RuleBuilder) Queries(data []cog.Builder[Query]) *RuleBuilder
func (*RuleBuilder) RuleGroup ¶
func (builder *RuleBuilder) RuleGroup(ruleGroup string) *RuleBuilder
func (*RuleBuilder) Title ¶
func (builder *RuleBuilder) Title(title string) *RuleBuilder
func (*RuleBuilder) Uid ¶
func (builder *RuleBuilder) Uid(uid string) *RuleBuilder
func (*RuleBuilder) Updated ¶
func (builder *RuleBuilder) Updated(updated time.Time) *RuleBuilder
func (*RuleBuilder) WithQuery ¶
func (builder *RuleBuilder) WithQuery(data cog.Builder[Query]) *RuleBuilder
type RuleExecErrState ¶
type RuleExecErrState string
const ( RuleExecErrStateOK RuleExecErrState = "OK" RuleExecErrStateAlerting RuleExecErrState = "Alerting" RuleExecErrStateError RuleExecErrState = "Error" )
type RuleGroup ¶
type RuleGroup struct { FolderUid *string `json:"folderUid,omitempty"` // The interval, in seconds, at which all rules in the group are evaluated. // If a group contains many rules, the rules are evaluated sequentially. Interval *Duration `json:"interval,omitempty"` Rules []Rule `json:"rules,omitempty"` Title *string `json:"title,omitempty"` }
func (*RuleGroup) UnmarshalJSONStrict ¶
UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `RuleGroup` 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, …
type RuleGroupBuilder ¶
type RuleGroupBuilder struct {
// contains filtered or unexported fields
}
func NewRuleGroupBuilder ¶
func NewRuleGroupBuilder(title string) *RuleGroupBuilder
func (*RuleGroupBuilder) Build ¶
func (builder *RuleGroupBuilder) Build() (RuleGroup, error)
func (*RuleGroupBuilder) FolderUid ¶
func (builder *RuleGroupBuilder) FolderUid(folderUid string) *RuleGroupBuilder
func (*RuleGroupBuilder) Interval ¶
func (builder *RuleGroupBuilder) Interval(interval Duration) *RuleGroupBuilder
The interval, in seconds, at which all rules in the group are evaluated. If a group contains many rules, the rules are evaluated sequentially.
func (*RuleGroupBuilder) Rules ¶
func (builder *RuleGroupBuilder) Rules(rules []cog.Builder[Rule]) *RuleGroupBuilder
func (*RuleGroupBuilder) Title ¶
func (builder *RuleGroupBuilder) Title(title string) *RuleGroupBuilder
func (*RuleGroupBuilder) WithRule ¶
func (builder *RuleGroupBuilder) WithRule(rule cog.Builder[Rule]) *RuleGroupBuilder
type RuleNoDataState ¶
type RuleNoDataState string
const ( RuleNoDataStateAlerting RuleNoDataState = "Alerting" RuleNoDataStateNoData RuleNoDataState = "NoData" RuleNoDataStateOK RuleNoDataState = "OK" )
type TimeInterval ¶
type TimeInterval struct { Name *string `json:"name,omitempty"` TimeIntervals []TimeIntervalItem `json:"time_intervals,omitempty"` }
func NewTimeInterval ¶
func NewTimeInterval() *TimeInterval
NewTimeInterval creates a new TimeInterval object.
func (TimeInterval) Equals ¶
func (resource TimeInterval) Equals(other TimeInterval) bool
Equals tests the equality of two `TimeInterval` objects.
func (*TimeInterval) UnmarshalJSONStrict ¶
func (resource *TimeInterval) UnmarshalJSONStrict(raw []byte) error
UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `TimeInterval` 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 (TimeInterval) Validate ¶
func (resource TimeInterval) Validate() error
Validate checks all the validation constraints that may be defined on `TimeInterval` fields for violations and returns them.
type TimeIntervalBuilder ¶
type TimeIntervalBuilder struct {
// contains filtered or unexported fields
}
func NewTimeIntervalBuilder ¶
func NewTimeIntervalBuilder() *TimeIntervalBuilder
func (*TimeIntervalBuilder) Build ¶
func (builder *TimeIntervalBuilder) Build() (TimeInterval, error)
func (*TimeIntervalBuilder) Name ¶
func (builder *TimeIntervalBuilder) Name(name string) *TimeIntervalBuilder
func (*TimeIntervalBuilder) TimeIntervals ¶
func (builder *TimeIntervalBuilder) TimeIntervals(timeIntervals []cog.Builder[TimeIntervalItem]) *TimeIntervalBuilder
type TimeIntervalItem ¶
type TimeIntervalItem struct { DaysOfMonth []string `json:"days_of_month,omitempty"` Location *string `json:"location,omitempty"` Months []string `json:"months,omitempty"` Times []TimeIntervalTimeRange `json:"times,omitempty"` Weekdays []string `json:"weekdays,omitempty"` Years []string `json:"years,omitempty"` }
func NewTimeIntervalItem ¶
func NewTimeIntervalItem() *TimeIntervalItem
NewTimeIntervalItem creates a new TimeIntervalItem object.
func (TimeIntervalItem) Equals ¶
func (resource TimeIntervalItem) Equals(other TimeIntervalItem) bool
Equals tests the equality of two `TimeIntervalItem` objects.
func (*TimeIntervalItem) UnmarshalJSONStrict ¶
func (resource *TimeIntervalItem) UnmarshalJSONStrict(raw []byte) error
UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `TimeIntervalItem` 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 (TimeIntervalItem) Validate ¶
func (resource TimeIntervalItem) Validate() error
Validate checks all the validation constraints that may be defined on `TimeIntervalItem` fields for violations and returns them.
type TimeIntervalItemBuilder ¶
type TimeIntervalItemBuilder struct {
// contains filtered or unexported fields
}
func NewTimeIntervalItemBuilder ¶
func NewTimeIntervalItemBuilder() *TimeIntervalItemBuilder
func (*TimeIntervalItemBuilder) Build ¶
func (builder *TimeIntervalItemBuilder) Build() (TimeIntervalItem, error)
func (*TimeIntervalItemBuilder) DaysOfMonth ¶
func (builder *TimeIntervalItemBuilder) DaysOfMonth(daysOfMonth []string) *TimeIntervalItemBuilder
func (*TimeIntervalItemBuilder) Location ¶
func (builder *TimeIntervalItemBuilder) Location(location string) *TimeIntervalItemBuilder
func (*TimeIntervalItemBuilder) Months ¶
func (builder *TimeIntervalItemBuilder) Months(months []string) *TimeIntervalItemBuilder
func (*TimeIntervalItemBuilder) Times ¶
func (builder *TimeIntervalItemBuilder) Times(times []cog.Builder[TimeIntervalTimeRange]) *TimeIntervalItemBuilder
func (*TimeIntervalItemBuilder) Weekdays ¶
func (builder *TimeIntervalItemBuilder) Weekdays(weekdays []string) *TimeIntervalItemBuilder
func (*TimeIntervalItemBuilder) Years ¶
func (builder *TimeIntervalItemBuilder) Years(years []string) *TimeIntervalItemBuilder
type TimeIntervalTimeRange ¶
type TimeIntervalTimeRange struct { EndTime *string `json:"end_time,omitempty"` StartTime *string `json:"start_time,omitempty"` }
func NewTimeIntervalTimeRange ¶
func NewTimeIntervalTimeRange() *TimeIntervalTimeRange
NewTimeIntervalTimeRange creates a new TimeIntervalTimeRange object.
func (TimeIntervalTimeRange) Equals ¶
func (resource TimeIntervalTimeRange) Equals(other TimeIntervalTimeRange) bool
Equals tests the equality of two `TimeIntervalTimeRange` objects.
func (*TimeIntervalTimeRange) UnmarshalJSONStrict ¶
func (resource *TimeIntervalTimeRange) UnmarshalJSONStrict(raw []byte) error
UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `TimeIntervalTimeRange` 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 (TimeIntervalTimeRange) Validate ¶
func (resource TimeIntervalTimeRange) Validate() error
Validate checks all the validation constraints that may be defined on `TimeIntervalTimeRange` fields for violations and returns them.
type TimeIntervalTimeRangeBuilder ¶
type TimeIntervalTimeRangeBuilder struct {
// contains filtered or unexported fields
}
func NewTimeIntervalTimeRangeBuilder ¶
func NewTimeIntervalTimeRangeBuilder() *TimeIntervalTimeRangeBuilder
func (*TimeIntervalTimeRangeBuilder) Build ¶
func (builder *TimeIntervalTimeRangeBuilder) Build() (TimeIntervalTimeRange, error)
func (*TimeIntervalTimeRangeBuilder) EndTime ¶
func (builder *TimeIntervalTimeRangeBuilder) EndTime(endTime string) *TimeIntervalTimeRangeBuilder
func (*TimeIntervalTimeRangeBuilder) StartTime ¶
func (builder *TimeIntervalTimeRangeBuilder) StartTime(startTime string) *TimeIntervalTimeRangeBuilder
Source Files ¶
- contactpoint_builder_gen.go
- contactpoint_converter_gen.go
- matcher_builder_gen.go
- matcher_converter_gen.go
- mutetiming_builder_gen.go
- mutetiming_converter_gen.go
- notificationpolicy_builder_gen.go
- notificationpolicy_converter_gen.go
- notificationsettings_builder_gen.go
- notificationsettings_converter_gen.go
- notificationtemplate_builder_gen.go
- notificationtemplate_converter_gen.go
- query_builder_gen.go
- query_converter_gen.go
- rule_builder_gen.go
- rule_converter_gen.go
- rulegroup_builder_gen.go
- rulegroup_converter_gen.go
- timeinterval_builder_gen.go
- timeinterval_converter_gen.go
- timeintervalitem_builder_gen.go
- timeintervalitem_converter_gen.go
- timeintervaltimerange_builder_gen.go
- timeintervaltimerange_converter_gen.go
- types_gen.go