Chore: Remove result fields from ngalert (#65410)

* remove result fields from ngalert

* remove duplicate imports
This commit is contained in:
Serge Zaitsev
2023-03-28 10:34:35 +02:00
committed by GitHub
parent 42b58fbca6
commit 0beb768427
34 changed files with 307 additions and 317 deletions
-10
View File
@@ -362,16 +362,12 @@ type AlertRuleVersion struct {
type GetAlertRuleByUIDQuery struct {
UID string
OrgID int64
Result *AlertRule
}
// GetAlertRulesGroupByRuleUIDQuery is the query for retrieving a group of alerts by UID of a rule that belongs to that group
type GetAlertRulesGroupByRuleUIDQuery struct {
UID string
OrgID int64
Result []*AlertRule
}
// ListAlertRulesQuery is the query for listing alert rules
@@ -385,8 +381,6 @@ type ListAlertRulesQuery struct {
// to return just those for a dashboard and panel.
DashboardUID string
PanelID int64
Result RulesGroup
}
// CountAlertRulesQuery is the query for counting alert rules
@@ -407,8 +401,6 @@ type ListNamespaceAlertRulesQuery struct {
OrgID int64
// Namespace is the folder slug
NamespaceUID string
Result []*AlertRule
}
// ListOrgRuleGroupsQuery is the query for listing unique rule groups
@@ -421,8 +413,6 @@ type ListOrgRuleGroupsQuery struct {
// to return just those for a dashboard and panel.
DashboardUID string
PanelID int64
Result [][]string
}
type UpdateRule struct {
+2 -4
View File
@@ -25,8 +25,7 @@ type HistoricAlertConfiguration struct {
// GetLatestAlertmanagerConfigurationQuery is the query to get the latest alertmanager configuration.
type GetLatestAlertmanagerConfigurationQuery struct {
OrgID int64
Result *AlertConfiguration
OrgID int64
}
// SaveAlertmanagerConfigurationCmd is the command to save an alertmanager configuration.
@@ -47,8 +46,7 @@ type MarkConfigurationAsAppliedCmd struct {
// GetAppliedConfigurationsQuery is the query for getting configurations that have been previously applied with no errors.
type GetAppliedConfigurationsQuery struct {
OrgID int64
Result []*HistoricAlertConfiguration
OrgID int64
}
func HistoricConfigFromAlertConfig(config AlertConfiguration) HistoricAlertConfiguration {
-2
View File
@@ -52,8 +52,6 @@ func (i InstanceStateType) IsValid() bool {
type ListAlertInstancesQuery struct {
RuleUID string
RuleOrgID int64 `json:"-"`
Result []*AlertInstance
}
// ValidateAlertInstance validates that the alert instance contains an alert rule id,