Alerting: Break up store.RuleStore interface, delete dead code (#55776)

* Refactor state manager to not depend on rule store interface

* Refactor grafana and proxied ruler APIs to not depend on store.RuleStore

* Refactor folder subscription logic to not use store.RuleStore

* Delete dead code

* Delete store.RuleStore
This commit is contained in:
Alexander Weaver
2022-09-27 08:56:30 -05:00
committed by GitHub
parent cd360f2d2a
commit d17ab82b98
10 changed files with 39 additions and 80 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/grafana/grafana/pkg/services/ngalert/models"
)
// InstanceStore represents the ability to fetch and write alert instances.
type InstanceStore interface {
FetchOrgIds(ctx context.Context) ([]int64, error)
ListAlertInstances(ctx context.Context, cmd *models.ListAlertInstancesQuery) error
@@ -13,3 +14,8 @@ type InstanceStore interface {
DeleteAlertInstance(ctx context.Context, orgID int64, ruleUID, labelsHash string) error
DeleteAlertInstancesByRule(ctx context.Context, key models.AlertRuleKey) error
}
// RuleReader represents the ability to fetch alert rules.
type RuleReader interface {
ListAlertRules(ctx context.Context, query *models.ListAlertRulesQuery) error
}