Skip to content

RuleBuilder🔗

Constructor🔗

func NewRuleBuilder(title string) *RuleBuilder

Methods🔗

Build🔗

Builds the object.

func (builder *RuleBuilder) Build() (Rule, error)

Annotations🔗

func (builder *RuleBuilder) Annotations(annotations map[string]string) *RuleBuilder

Condition🔗

func (builder *RuleBuilder) Condition(condition string) *RuleBuilder

ExecErrState🔗

func (builder *RuleBuilder) ExecErrState(execErrState alerting.RuleExecErrState) *RuleBuilder

FolderUID🔗

func (builder *RuleBuilder) FolderUID(folderUID string) *RuleBuilder

For🔗

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 (builder *RuleBuilder) For(forArg string) *RuleBuilder

Id🔗

func (builder *RuleBuilder) Id(id int64) *RuleBuilder

IsPaused🔗

func (builder *RuleBuilder) IsPaused(isPaused bool) *RuleBuilder

Labels🔗

func (builder *RuleBuilder) Labels(labels map[string]string) *RuleBuilder

NoDataState🔗

func (builder *RuleBuilder) NoDataState(noDataState alerting.RuleNoDataState) *RuleBuilder

NotificationSettings🔗

func (builder *RuleBuilder) NotificationSettings(notificationSettings cog.Builder[alerting.NotificationSettings]) *RuleBuilder

OrgID🔗

func (builder *RuleBuilder) OrgID(orgID int64) *RuleBuilder

Provenance🔗

func (builder *RuleBuilder) Provenance(provenance alerting.Provenance) *RuleBuilder

Queries🔗

func (builder *RuleBuilder) Queries(data []cog.Builder[alerting.Query]) *RuleBuilder

Record🔗

func (builder *RuleBuilder) Record(record cog.Builder[alerting.RecordRule]) *RuleBuilder

RuleGroup🔗

func (builder *RuleBuilder) RuleGroup(ruleGroup string) *RuleBuilder

Title🔗

func (builder *RuleBuilder) Title(title string) *RuleBuilder

Uid🔗

func (builder *RuleBuilder) Uid(uid string) *RuleBuilder

Updated🔗

func (builder *RuleBuilder) Updated(updated time.Time) *RuleBuilder

WithQuery🔗

func (builder *RuleBuilder) WithQuery(data cog.Builder[alerting.Query]) *RuleBuilder

See also🔗