ia

package
v2.17.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2021 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Overview

Package ia contains Integrated Alerting APIs implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertsService

type AlertsService struct {
	// contains filtered or unexported fields
}

AlertsService represents integrated alerting alerts API.

func NewAlertsService

func NewAlertsService(db *reform.DB, alertManager alertManager, templatesService *TemplatesService) *AlertsService

NewAlertsService creates new alerts API service.

func (*AlertsService) Enabled

func (s *AlertsService) Enabled() bool

Enabled returns if service is enabled and can be used.

func (*AlertsService) ListAlerts

ListAlerts returns list of existing alerts.

func (*AlertsService) ToggleAlert

ToggleAlert allows to silence/unsilence specified alerts.

type ChannelsService

type ChannelsService struct {
	// contains filtered or unexported fields
}

ChannelsService represents integrated alerting channels API.

func NewChannelsService

func NewChannelsService(db *reform.DB, alertManager alertManager) *ChannelsService

NewChannelsService creates new channels API service.

func (*ChannelsService) AddChannel

AddChannel adds new notification channel.

func (*ChannelsService) ChangeChannel

ChangeChannel changes existing notification channel.

func (*ChannelsService) Enabled

func (s *ChannelsService) Enabled() bool

Enabled returns if service is enabled and can be used.

func (*ChannelsService) ListChannels

ListChannels returns list of available channels.

func (*ChannelsService) RemoveChannel

RemoveChannel removes notification channel.

type RulesService

type RulesService struct {
	// contains filtered or unexported fields
}

RulesService represents API for Integrated Alerting Rules.

func NewRulesService

func NewRulesService(db *reform.DB, templates *TemplatesService, vmalert vmAlert, alertManager alertManager) *RulesService

NewRulesService creates an API for Integrated Alerting Rules.

func (*RulesService) CreateAlertRule

CreateAlertRule creates Integrated Alerting rule.

func (*RulesService) DeleteAlertRule

DeleteAlertRule deletes Integrated Alerting rule.

func (*RulesService) Enabled

func (s *RulesService) Enabled() bool

Enabled returns if service is enabled and can be used.

func (*RulesService) ListAlertRules

ListAlertRules returns a list of all Integrated Alerting rules.

func (*RulesService) RemoveVMAlertRulesFiles

func (s *RulesService) RemoveVMAlertRulesFiles() error

RemoveVMAlertRulesFiles removes all generated rules files (*.yml) on the ia path.

func (*RulesService) ToggleAlertRule

ToggleAlertRule allows to switch between disabled and enabled states of an Alert Rule.

func (*RulesService) UpdateAlertRule

UpdateAlertRule updates Integrated Alerting rule.

func (*RulesService) WriteVMAlertRulesFiles

func (s *RulesService) WriteVMAlertRulesFiles()

writeVMAlertRulesFiles converts all available rules to VMAlert rule files.

type TemplatesService

type TemplatesService struct {
	// contains filtered or unexported fields
}

TemplatesService is responsible for interactions with IA rule templates.

func NewTemplatesService

func NewTemplatesService(db *reform.DB) *TemplatesService

NewTemplatesService creates a new TemplatesService.

func (*TemplatesService) Collect

func (s *TemplatesService) Collect(ctx context.Context)

Collect collects IA rule templates from various sources like: builtin templates: read from the generated code in bindata.go. user file templates: read from yaml files created by the user in `/srv/ia/templates` user API templates: in the DB created using the API.

func (*TemplatesService) CreateTemplate

CreateTemplate creates a new template.

func (*TemplatesService) DeleteTemplate

DeleteTemplate deletes existing, previously created via API.

func (*TemplatesService) Enabled

func (s *TemplatesService) Enabled() bool

Enabled returns if service is enabled and can be used.

func (*TemplatesService) ListTemplates

ListTemplates returns a list of all collected Alert Rule Templates.

func (*TemplatesService) UpdateTemplate

UpdateTemplate updates existing template, previously created via API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL