Files
kubesphere/pkg/models/customalerting/rules/rule.go
junotx 9831eb3533 custom alerting optimize
Signed-off-by: junotx <junotx@126.com>
2021-01-12 16:52:36 +08:00

32 lines
701 B
Go

package rules
import (
promresourcesv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
"kubesphere.io/kubesphere/pkg/api/customalerting/v1alpha1"
)
type ResourceRuleCollection struct {
GroupSet map[string]struct{}
IdRules map[string]*ResourceRuleItem
NameRules map[string][]*ResourceRuleItem
}
type ResourceRuleItem struct {
ResourceName string
Group string
Id string
Rule *promresourcesv1.Rule
}
type ResourceRule struct {
Level v1alpha1.RuleLevel
Custom bool
ResourceRuleItem
}
type ResourceRuleChunk struct {
Level v1alpha1.RuleLevel
Custom bool
ResourceRulesMap map[string]*ResourceRuleCollection
}