mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: remove unused function in alert rule store (#50696)
This commit is contained in:
committed by
GitHub
parent
d872aa993d
commit
ed6a887737
@@ -34,7 +34,6 @@ type RuleStore interface {
|
|||||||
ListAlertRules(ctx context.Context, query *models.ListAlertRulesQuery) error
|
ListAlertRules(ctx context.Context, query *models.ListAlertRulesQuery) error
|
||||||
GetRuleGroupInterval(ctx context.Context, orgID int64, namespaceUID string, ruleGroup string) (int64, error)
|
GetRuleGroupInterval(ctx context.Context, orgID int64, namespaceUID string, ruleGroup string) (int64, error)
|
||||||
InsertAlertRules(ctx context.Context, rule []models.AlertRule) (map[string]int64, error)
|
InsertAlertRules(ctx context.Context, rule []models.AlertRule) (map[string]int64, error)
|
||||||
UpdateRuleGroup(ctx context.Context, orgID int64, namespaceUID string, ruleGroup string, interval int64) error
|
|
||||||
UpdateAlertRules(ctx context.Context, rule []store.UpdateRule) error
|
UpdateAlertRules(ctx context.Context, rule []store.UpdateRule) error
|
||||||
DeleteAlertRulesByUID(ctx context.Context, orgID int64, ruleUID ...string) error
|
DeleteAlertRulesByUID(ctx context.Context, orgID int64, ruleUID ...string) error
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,8 +47,6 @@ type RuleStore interface {
|
|||||||
// GetRuleGroups returns the unique rule groups across all organizations.
|
// GetRuleGroups returns the unique rule groups across all organizations.
|
||||||
GetRuleGroups(ctx context.Context, query *ngmodels.ListRuleGroupsQuery) error
|
GetRuleGroups(ctx context.Context, query *ngmodels.ListRuleGroupsQuery) error
|
||||||
GetRuleGroupInterval(ctx context.Context, orgID int64, namespaceUID string, ruleGroup string) (int64, error)
|
GetRuleGroupInterval(ctx context.Context, orgID int64, namespaceUID string, ruleGroup string) (int64, error)
|
||||||
// UpdateRuleGroup will update the interval for all rules in the group.
|
|
||||||
UpdateRuleGroup(ctx context.Context, orgID int64, namespaceUID string, ruleGroup string, interval int64) error
|
|
||||||
GetUserVisibleNamespaces(context.Context, int64, *models.SignedInUser) (map[string]*models.Folder, error)
|
GetUserVisibleNamespaces(context.Context, int64, *models.SignedInUser) (map[string]*models.Folder, error)
|
||||||
GetNamespaceByTitle(context.Context, string, int64, *models.SignedInUser, bool) (*models.Folder, error)
|
GetNamespaceByTitle(context.Context, string, int64, *models.SignedInUser, bool) (*models.Folder, error)
|
||||||
// InsertAlertRules will insert all alert rules passed into the function
|
// InsertAlertRules will insert all alert rules passed into the function
|
||||||
@@ -319,16 +317,6 @@ func (st DBstore) GetRuleGroupInterval(ctx context.Context, orgID int64, namespa
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (st DBstore) UpdateRuleGroup(ctx context.Context, orgID int64, namespaceUID string, ruleGroup string, interval int64) error {
|
|
||||||
return st.SQLStore.WithDbSession(ctx, func(sess *sqlstore.DBSession) error {
|
|
||||||
_, err := sess.Update(
|
|
||||||
ngmodels.AlertRule{IntervalSeconds: interval},
|
|
||||||
ngmodels.AlertRule{OrgID: orgID, RuleGroup: ruleGroup, NamespaceUID: namespaceUID},
|
|
||||||
)
|
|
||||||
return err
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetNamespaces returns the folders that are visible to the user and have at least one alert in it
|
// GetNamespaces returns the folders that are visible to the user and have at least one alert in it
|
||||||
func (st DBstore) GetUserVisibleNamespaces(ctx context.Context, orgID int64, user *models.SignedInUser) (map[string]*models.Folder, error) {
|
func (st DBstore) GetUserVisibleNamespaces(ctx context.Context, orgID int64, user *models.SignedInUser) (map[string]*models.Folder, error) {
|
||||||
namespaceMap := make(map[string]*models.Folder)
|
namespaceMap := make(map[string]*models.Folder)
|
||||||
|
|||||||
Reference in New Issue
Block a user