-
Notifications
You must be signed in to change notification settings - Fork 12
/
interfaces.go
48 lines (40 loc) · 1.37 KB
/
interfaces.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package rules
import (
"net/url"
"github.com/cloudfoundry/metric-store-release/src/pkg/rulesclient"
prom_config "github.com/prometheus/prometheus/config"
"github.com/prometheus/prometheus/rules"
)
const (
ManagerExistsError = ManagerStoreError("The manager already exists")
ManagerNotExistsError = ManagerStoreError("The manager does not exist")
)
type RuleManager interface {
CreateManager(managerId string, alertmanagerConfigs *prom_config.AlertmanagerConfigs) (*Manager, error)
DeleteManager(managerId string) error
UpsertRuleGroup(managerId string, ruleGroup *rulesclient.RuleGroup) error
RuleGroups() []*rules.Group
AlertingRules() []*rules.AlertingRule
Alertmanagers() []*url.URL
DroppedAlertmanagers() []*url.URL
}
type RuleManagers interface {
Create(managerId string, managerFile string, alertManagers *prom_config.AlertmanagerConfigs) error
Delete(managerId string) error
DeleteAll() error
Reload() error
RuleGroups() []*rules.Group
AlertingRules() []*rules.AlertingRule
Alertmanagers() []*url.URL
DroppedAlertmanagers() []*url.URL
}
type PromManagerWrapper interface {
Start() error
Reload() error
// implements prometheus api v1 rulesRetriever interface
RuleGroups() []*rules.Group
AlertingRules() []*rules.AlertingRule
// implements prometheus api v1 alertmanagerRetriever interface
Alertmanagers() []*url.URL
DroppedAlertmanagers() []*url.URL
}