Documentation ¶
Index ¶
- Constants
- type Alert
- type AlertDB
- func (db *AlertDB) CountByScopeAndScopeID(scope, scopeID, name string) (int, error)
- func (db *AlertDB) DeleteByID(id uint64) error
- func (db *AlertDB) GetAllAvailableAlertIds() ([]uint64, error)
- func (db *AlertDB) GetAvailableAlertIdByScope(scope, scopeID string) ([]uint64, error)
- func (db *AlertDB) GetByID(id uint64) (*Alert, error)
- func (db *AlertDB) GetByScopeAndScopeIDAndId(scope, scopeID string, id uint64) (*Alert, error)
- func (db *AlertDB) GetByScopeAndScopeIDAndName(scope, scopeID, name string) (*Alert, error)
- func (db *AlertDB) Insert(alert *Alert) error
- func (db *AlertDB) QueryByScopeAndScopeID(scope, scopeID string, pageNo, pageSize uint64, name string) ([]*Alert, error)
- func (db *AlertDB) Update(alert *Alert) error
- func (db *AlertDB) UpdateEnable(id uint64, enable bool) error
- type AlertEvent
- type AlertEventDB
- func (db *AlertEventDB) CountByCondition(scope, scopeId string, condition *AlertEventQueryCondition) (int64, error)
- func (db *AlertEventDB) CountUnRecoverEvents(scope, scopeId string, inAlertIds []uint64) (int64, error)
- func (db *AlertEventDB) CountUnRecoverEventsGroupByScope() ([]*AlertEventScopeCountResult, error)
- func (db *AlertEventDB) CreateAlertEvent(data *AlertEvent) error
- func (db *AlertEventDB) GetByAlertGroupID(groupID string) (*AlertEvent, error)
- func (db *AlertEventDB) GetById(id string) (*AlertEvent, error)
- func (db *AlertEventDB) QueryByCondition(scope, scopeId string, condition *AlertEventQueryCondition, ...) ([]*AlertEvent, error)
- func (db *AlertEventDB) UpdateAlertEvent(id string, fields map[string]interface{}) error
- type AlertEventQueryCondition
- type AlertEventScopeCountResult
- type AlertEventSort
- type AlertEventSuppress
- type AlertEventSuppressDB
- func (db *AlertEventSuppressDB) CancelSuppress(eventId string) (bool, error)
- func (db *AlertEventSuppressDB) QueryByCondition(scope, scopeId string, condition *AlertEventSuppressQueryCondition) ([]*AlertEventSuppress, error)
- func (db *AlertEventSuppressDB) Suppress(orgId int64, scope, scopeId string, eventId string, suppressType string, ...) (bool, error)
- type AlertEventSuppressQueryCondition
- type AlertExpression
- type AlertExpressionDB
- func (db *AlertExpressionDB) DeleteByAlertID(alertID uint64) error
- func (db *AlertExpressionDB) DeleteByIDs(ids []uint64) error
- func (db *AlertExpressionDB) GetAllAlertExpression(pageNo, pageSize int64) ([]*AlertExpression, int64, error)
- func (db *AlertExpressionDB) Insert(expression *AlertExpression) error
- func (db *AlertExpressionDB) QueryByAlertIDs(alertIDs []uint64) ([]*AlertExpression, error)
- func (db *AlertExpressionDB) QueryByIDs(ids []uint64) ([]*AlertExpression, error)
- func (db *AlertExpressionDB) QueryRuleCount(alertIds []uint64) (map[uint64]int64, error)
- func (db *AlertExpressionDB) Update(expression *AlertExpression) error
- func (db *AlertExpressionDB) UpdateEnableByAlertID(alertID uint64, enable bool) error
- type AlertNotify
- type AlertNotifyDB
- func (db *AlertNotifyDB) DeleteByAlertID(alertID uint64) error
- func (db *AlertNotifyDB) DeleteByIDs(ids []uint64) error
- func (db *AlertNotifyDB) Insert(notify *AlertNotify) error
- func (db *AlertNotifyDB) QueryAlertNotify(pageNo, pageSize int64) ([]*AlertNotify, int64, error)
- func (db *AlertNotifyDB) QueryByAlertIDs(alertIDs []uint64) ([]*AlertNotify, error)
- func (db *AlertNotifyDB) Update(notify *AlertNotify) error
- func (db *AlertNotifyDB) UpdateEnableByAlertID(alertID uint64, enable bool) error
- type AlertNotifyTemplate
- type AlertNotifyTemplateDB
- type AlertRecord
- type AlertRecordDB
- func (db *AlertRecordDB) CountByCondition(scope, scopeKey string, ...) (int, error)
- func (db *AlertRecordDB) GetByGroupID(groupID string) (*AlertRecord, error)
- func (db *AlertRecordDB) QueryByCondition(scope, scopeKey string, ...) ([]*AlertRecord, error)
- func (db *AlertRecordDB) UpdateHandle(groupID string, issueID uint64, handlerID string, handleState string) error
- type AlertRule
- type AlertRuleCount
- type AlertRuleDB
- func (db *AlertRuleDB) DistinctAlertTypeByScope(scope string) ([]string, error)
- func (db *AlertRuleDB) QueryByIndexes(indexes []string) ([]*AlertRule, error)
- func (db *AlertRuleDB) QueryEnabledByScope(scope string) ([]*AlertRule, error)
- func (db *AlertRuleDB) QueryEnabledByScopeAndIndices(scope string, indices []string) ([]*AlertRule, error)
- type CustomizeAlert
- type CustomizeAlertDB
- func (db *CustomizeAlertDB) CountByScopeAndScopeID(scope, scopeID, name string) (int, error)
- func (db *CustomizeAlertDB) DeleteByID(id uint64) error
- func (db *CustomizeAlertDB) GetByID(id uint64) (*CustomizeAlert, error)
- func (db *CustomizeAlertDB) GetByScopeAndScopeIDAndName(scope, scopeID, name string) (*CustomizeAlert, error)
- func (db *CustomizeAlertDB) Insert(alert *CustomizeAlert) error
- func (db *CustomizeAlertDB) QueryByScopeAndScopeID(scope, scopeID string, pageNo, pageSize int, name string) ([]*CustomizeAlert, error)
- func (db *CustomizeAlertDB) Update(alert *CustomizeAlert) error
- func (db *CustomizeAlertDB) UpdateEnable(id uint64, enable bool) error
- type CustomizeAlertNotifyTemplate
- type CustomizeAlertNotifyTemplateDB
- func (db *CustomizeAlertNotifyTemplateDB) DeleteByAlertID(alertID uint64) error
- func (db *CustomizeAlertNotifyTemplateDB) DeleteByIDs(ids []uint64) error
- func (db *CustomizeAlertNotifyTemplateDB) Insert(notify *CustomizeAlertNotifyTemplate) error
- func (db *CustomizeAlertNotifyTemplateDB) QueryByAlertIDs(alertIDs []uint64) ([]*CustomizeAlertNotifyTemplate, error)
- func (db *CustomizeAlertNotifyTemplateDB) QueryCustomizeAlertTemplate() ([]*CustomizeAlertNotifyTemplate, error)
- func (db *CustomizeAlertNotifyTemplateDB) QueryEnabledByTypesAndIndexes(types, indexes []string) ([]*CustomizeAlertNotifyTemplate, error)
- func (db *CustomizeAlertNotifyTemplateDB) Update(notify *CustomizeAlertNotifyTemplate) error
- func (db *CustomizeAlertNotifyTemplateDB) UpdateEnableByAlertID(alertID uint64, enable bool) error
- type CustomizeAlertRule
- type CustomizeAlertRuleDB
- func (db *CustomizeAlertRuleDB) DeleteByAlertID(alertID uint64) error
- func (db *CustomizeAlertRuleDB) DeleteByIDs(ids []uint64) error
- func (db *CustomizeAlertRuleDB) Insert(rule *CustomizeAlertRule) error
- func (db *CustomizeAlertRuleDB) QueryByAlertIDs(alertIDs []uint64) ([]*CustomizeAlertRule, error)
- func (db *CustomizeAlertRuleDB) QueryEnabledByScope(scope, scopeID string) ([]*CustomizeAlertRule, error)
- func (db *CustomizeAlertRuleDB) QueryEnabledByScopeAndIndices(scope, scopeID string, indices []string) ([]*CustomizeAlertRule, error)
- func (db *CustomizeAlertRuleDB) Update(rule *CustomizeAlertRule) error
- func (db *CustomizeAlertRuleDB) UpdateEnableByAlertID(alertID uint64, enable bool) error
- type DB
- type MetricExpression
- type MetricExpressionDB
Constants ¶
const ( SuppressTypePause = "pause" SuppressTypeStop = "stop" )
const ( TableAlertRecord = "sp_alert_record" TableCustomizeAlert = "sp_customize_alert" TableCustomizeAlertRule = "sp_customize_alert_rule" TableCustomizeAlertNotifyTemplate = "sp_customize_alert_notify_template" TableAlertRules = "sp_alert_rules" TableAlertNotify = "sp_alert_notify" TableAlertNotifyTemplate = "sp_alert_notify_template" TableAlertExpression = "sp_alert_expression" TableMetricExpression = "sp_metric_expression" TableAlert = "sp_alert" TableAlertEvent = "sp_alert_event" TableAlertEventSuppress = "sp_alert_event_suppress" )
tables name
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { ID uint64 `gorm:"column:id"` Name string `gorm:"column:name"` AlertScope string `gorm:"column:alert_scope"` AlertScopeID string `gorm:"column:alert_scope_id"` Attributes jsonmap.JSONMap `gorm:"column:attributes"` Enable bool `gorm:"column:enable"` CreatorID string `gorm:"column:creator_id"` Created time.Time `gorm:"column:created"` Updated time.Time `gorm:"column:updated"` }
Alert .
type AlertDB ¶
AlertDB .
func (*AlertDB) CountByScopeAndScopeID ¶
CountByScopeAndScopeID .
func (*AlertDB) GetAllAvailableAlertIds ¶
func (*AlertDB) GetAvailableAlertIdByScope ¶
func (*AlertDB) GetByScopeAndScopeIDAndId ¶
GetByScopeAndScopeIDAndId .
func (*AlertDB) GetByScopeAndScopeIDAndName ¶
GetByScopeAndScopeIDAndName .
type AlertEvent ¶
type AlertEvent struct { Id string `gorm:"column:id;primary_key"` Name string `gorm:"column:name"` OrgID int64 `gorm:"column:org_id"` AlertGroupID string `gorm:"column:alert_group_id"` AlertGroup string `gorm:"column:alert_group"` Scope string `gorm:"column:scope"` ScopeID string `gorm:"column:scope_id"` AlertID uint64 `gorm:"column:alert_id"` AlertName string `gorm:"column:alert_name"` AlertType string `gorm:"column:alert_type"` AlertIndex string `gorm:"column:alert_index"` AlertLevel string `gorm:"column:alert_level"` AlertSource string `gorm:"column:alert_source"` AlertSubject string `gorm:"column:alert_subject"` AlertState string `gorm:"column:alert_state"` RuleID uint64 `gorm:"column:rule_id"` RuleName string `gorm:"column:rule_name"` ExpressionID uint64 `gorm:"column:expression_id"` LastTriggerTime time.Time `gorm:"column:last_trigger_time"` FirstTriggerTime time.Time `gorm:"column:first_trigger_time"` }
type AlertEventDB ¶
AlertEventDB .
func (*AlertEventDB) CountByCondition ¶
func (db *AlertEventDB) CountByCondition(scope, scopeId string, condition *AlertEventQueryCondition) (int64, error)
CountByCondition .
func (*AlertEventDB) CountUnRecoverEvents ¶
func (db *AlertEventDB) CountUnRecoverEvents(scope, scopeId string, inAlertIds []uint64) (int64, error)
func (*AlertEventDB) CountUnRecoverEventsGroupByScope ¶
func (db *AlertEventDB) CountUnRecoverEventsGroupByScope() ([]*AlertEventScopeCountResult, error)
func (*AlertEventDB) CreateAlertEvent ¶
func (db *AlertEventDB) CreateAlertEvent(data *AlertEvent) error
func (*AlertEventDB) GetByAlertGroupID ¶
func (db *AlertEventDB) GetByAlertGroupID(groupID string) (*AlertEvent, error)
GetByAlertGroupID .
func (*AlertEventDB) GetById ¶
func (db *AlertEventDB) GetById(id string) (*AlertEvent, error)
func (*AlertEventDB) QueryByCondition ¶
func (db *AlertEventDB) QueryByCondition(scope, scopeId string, condition *AlertEventQueryCondition, sorts []*AlertEventSort, pageNo, pageSize int64) ([]*AlertEvent, error)
QueryByCondition .
func (*AlertEventDB) UpdateAlertEvent ¶
func (db *AlertEventDB) UpdateAlertEvent(id string, fields map[string]interface{}) error
type AlertEventSort ¶
type AlertEventSuppress ¶
type AlertEventSuppress struct { Id string `gorm:"column:id;primary_key"` OrgID int64 `gorm:"column:org_id"` Scope string `gorm:"column:scope"` ScopeID string `gorm:"column:scope_id"` AlertEventID string `gorm:"column:alert_event_id"` SuppressType string `gorm:"column:suppress_type"` ExpireTime time.Time `gorm:"column:expire_time"` Enabled bool `gorm:"column:enabled"` }
func (AlertEventSuppress) TableName ¶
func (AlertEventSuppress) TableName() string
type AlertEventSuppressDB ¶
AlertEventSuppressDB .
func (*AlertEventSuppressDB) CancelSuppress ¶
func (db *AlertEventSuppressDB) CancelSuppress(eventId string) (bool, error)
func (*AlertEventSuppressDB) QueryByCondition ¶
func (db *AlertEventSuppressDB) QueryByCondition(scope, scopeId string, condition *AlertEventSuppressQueryCondition) ([]*AlertEventSuppress, error)
type AlertExpression ¶
type AlertExpression struct { ID uint64 `gorm:"column:id" json:"id"` AlertID uint64 `gorm:"column:alert_id" json:"alert_id"` Attributes jsonmap.JSONMap `gorm:"column:attributes" json:"attributes"` Expression jsonmap.JSONMap `gorm:"column:expression" json:"expression"` Version string `gorm:"column:version" json:"version"` Enable bool `gorm:"column:enable" json:"enable"` Created time.Time `gorm:"column:created" json:"created"` Updated time.Time `gorm:"column:updated" json:"updated"` }
AlertExpression .
type AlertExpressionDB ¶
AlertExpressionDB .
func (*AlertExpressionDB) DeleteByAlertID ¶
func (db *AlertExpressionDB) DeleteByAlertID(alertID uint64) error
DeleteByAlertID .
func (*AlertExpressionDB) DeleteByIDs ¶
func (db *AlertExpressionDB) DeleteByIDs(ids []uint64) error
DeleteByIDs .
func (*AlertExpressionDB) GetAllAlertExpression ¶
func (db *AlertExpressionDB) GetAllAlertExpression(pageNo, pageSize int64) ([]*AlertExpression, int64, error)
GetAllAlertExpression
func (*AlertExpressionDB) Insert ¶
func (db *AlertExpressionDB) Insert(expression *AlertExpression) error
Insert .
func (*AlertExpressionDB) QueryByAlertIDs ¶
func (db *AlertExpressionDB) QueryByAlertIDs(alertIDs []uint64) ([]*AlertExpression, error)
QueryByAlertIDs .
func (*AlertExpressionDB) QueryByIDs ¶
func (db *AlertExpressionDB) QueryByIDs(ids []uint64) ([]*AlertExpression, error)
QueryByIDs .
func (*AlertExpressionDB) QueryRuleCount ¶
func (db *AlertExpressionDB) QueryRuleCount(alertIds []uint64) (map[uint64]int64, error)
QueryRuleCount .
func (*AlertExpressionDB) Update ¶
func (db *AlertExpressionDB) Update(expression *AlertExpression) error
Update .
func (*AlertExpressionDB) UpdateEnableByAlertID ¶
func (db *AlertExpressionDB) UpdateEnableByAlertID(alertID uint64, enable bool) error
UpdateEnableByAlertID .
type AlertNotify ¶
type AlertNotify struct { ID uint64 `gorm:"column:id" json:"id"` AlertID uint64 `gorm:"column:alert_id" json:"alert_id"` NotifyKey string `gorm:"column:notify_key" json:"notify_key"` NotifyTarget jsonmap.JSONMap `gorm:"column:notify_target" json:"notify_target"` NotifyTargetID string `gorm:"column:notify_target_id" json:"notify_target_id"` Silence int64 `gorm:"column:silence" json:"silence"` SilencePolicy string `gorm:"column:silence_policy" json:"silence_policy"` Enable bool `gorm:"column:enable" json:"enable"` Created time.Time `gorm:"column:created" json:"created"` Updated time.Time `gorm:"column:updated" json:"updated"` }
AlertNotify .
type AlertNotifyDB ¶
AlertNotifyDB .
func (*AlertNotifyDB) DeleteByAlertID ¶
func (db *AlertNotifyDB) DeleteByAlertID(alertID uint64) error
DeleteByAlertID .
func (*AlertNotifyDB) DeleteByIDs ¶
func (db *AlertNotifyDB) DeleteByIDs(ids []uint64) error
DeleteByIDs .
func (*AlertNotifyDB) QueryAlertNotify ¶
func (db *AlertNotifyDB) QueryAlertNotify(pageNo, pageSize int64) ([]*AlertNotify, int64, error)
func (*AlertNotifyDB) QueryByAlertIDs ¶
func (db *AlertNotifyDB) QueryByAlertIDs(alertIDs []uint64) ([]*AlertNotify, error)
QueryByAlertIDs .
func (*AlertNotifyDB) UpdateEnableByAlertID ¶
func (db *AlertNotifyDB) UpdateEnableByAlertID(alertID uint64, enable bool) error
UpdateEnableByAlertID .
type AlertNotifyTemplate ¶
type AlertNotifyTemplate struct { ID uint64 `gorm:"column:id"` Name string `gorm:"column:name"` AlertType string `gorm:"column:alert_type"` AlertIndex string `gorm:"column:alert_index"` Target string `gorm:"column:target"` Trigger string `gorm:"column:trigger"` Title string `gorm:"column:title"` Template string `gorm:"column:template"` Formats jsonmap.JSONMap `gorm:"column:formats"` Version string `gorm:"column:version"` Enable bool `gorm:"column:enable"` CreateTime time.Time `gorm:"column:create_time"` UpdateTime time.Time `gorm:"column:update_time"` }
AlertNotifyTemplate .
type AlertNotifyTemplateDB ¶
AlertNotifyTemplateDB .
func (*AlertNotifyTemplateDB) QueryEnabledByTypesAndIndexes ¶
func (db *AlertNotifyTemplateDB) QueryEnabledByTypesAndIndexes( types, indexes []string) ([]*AlertNotifyTemplate, error)
QueryEnabledByTypesAndIndexes .
type AlertRecord ¶
type AlertRecord struct { GroupID string `gorm:"column:group_id;primary_key"` Scope string `gorm:"column:scope"` ScopeKey string `gorm:"column:scope_key"` AlertGroup string `gorm:"column:alert_group"` Title string `gorm:"column:title"` AlertState string `gorm:"column:alert_state"` AlertType string `gorm:"column:alert_type"` AlertIndex string `gorm:"column:alert_index"` ExpressionKey string `gorm:"column:expression_key"` AlertID uint64 `gorm:"column:alert_id"` AlertName string `gorm:"column:alert_name"` RuleID uint64 `gorm:"column:rule_id"` IssueID uint64 `gorm:"column:issue_id"` HandleState string `gorm:"column:handle_state"` HandlerID string `gorm:"column:handler_id"` AlertTime time.Time `gorm:"column:alert_time"` HandleTime time.Time `gorm:"column:handle_time;default:null"` CreateTime time.Time `gorm:"column:create_time"` UpdateTime time.Time `gorm:"column:update_time"` }
type AlertRecordDB ¶
AlertRecordDB .
func (*AlertRecordDB) CountByCondition ¶
func (db *AlertRecordDB) CountByCondition(scope, scopeKey string, alertGroups, alertStates, alertTypes, handleStates, handlerIDs []string) (int, error)
CountByCondition .
func (*AlertRecordDB) GetByGroupID ¶
func (db *AlertRecordDB) GetByGroupID(groupID string) (*AlertRecord, error)
GetByGroupID .
func (*AlertRecordDB) QueryByCondition ¶
func (db *AlertRecordDB) QueryByCondition(scope, scopeKey string, alertGroups, alertStates, alertTypes, handleStates, handlerIDs []string, pageNo, pageSize uint) ( []*AlertRecord, error)
QueryByCondition .
func (*AlertRecordDB) UpdateHandle ¶
func (db *AlertRecordDB) UpdateHandle(groupID string, issueID uint64, handlerID string, handleState string) error
UpdateHandle .
type AlertRule ¶
type AlertRule struct { ID uint64 `gorm:"column:id"` Name string `gorm:"column:name"` AlertScope string `gorm:"column:alert_scope"` AlertType string `gorm:"column:alert_type"` AlertIndex string `gorm:"column:alert_index"` Template jsonmap.JSONMap `gorm:"column:template"` Attributes jsonmap.JSONMap `gorm:"column:attributes"` Version string `gorm:"column:version"` Enable bool `gorm:"column:enable"` CreateTime time.Time `gorm:"column:create_time"` UpdateTime time.Time `gorm:"column:update_time"` }
AlertRule .
type AlertRuleCount ¶
AlertRuleCount .
type AlertRuleDB ¶
AlertRuleDB .
func (*AlertRuleDB) DistinctAlertTypeByScope ¶
func (db *AlertRuleDB) DistinctAlertTypeByScope(scope string) ([]string, error)
DistinctAlertTypeByScope .
func (*AlertRuleDB) QueryByIndexes ¶
func (db *AlertRuleDB) QueryByIndexes(indexes []string) ([]*AlertRule, error)
QueryByIndexes .
func (*AlertRuleDB) QueryEnabledByScope ¶
func (db *AlertRuleDB) QueryEnabledByScope(scope string) ([]*AlertRule, error)
QueryEnabledByScope .
func (*AlertRuleDB) QueryEnabledByScopeAndIndices ¶
func (db *AlertRuleDB) QueryEnabledByScopeAndIndices(scope string, indices []string) ([]*AlertRule, error)
QueryEnabledByScopeAndIndices .
type CustomizeAlert ¶
type CustomizeAlert struct { ID uint64 `gorm:"column:id"` Name string `gorm:"column:name"` AlertType string `gorm:"column:alert_type"` AlertScope string `gorm:"column:alert_scope"` AlertScopeID string `gorm:"column:alert_scope_id"` Attributes jsonmap.JSONMap `gorm:"column:attributes"` Enable bool `gorm:"column:enable"` CreatorID string `gorm:"column:creator_id"` CreateTime time.Time `gorm:"column:create_time"` UpdateTime time.Time `gorm:"column:update_time"` }
CustomizeAlert .
type CustomizeAlertDB ¶
CustomizeAlertDB .
func (*CustomizeAlertDB) CountByScopeAndScopeID ¶
func (db *CustomizeAlertDB) CountByScopeAndScopeID(scope, scopeID, name string) (int, error)
CountByScopeAndScopeID .
func (*CustomizeAlertDB) DeleteByID ¶
func (db *CustomizeAlertDB) DeleteByID(id uint64) error
DeleteByID .
func (*CustomizeAlertDB) GetByID ¶
func (db *CustomizeAlertDB) GetByID(id uint64) (*CustomizeAlert, error)
GetByID .
func (*CustomizeAlertDB) GetByScopeAndScopeIDAndName ¶
func (db *CustomizeAlertDB) GetByScopeAndScopeIDAndName(scope, scopeID, name string) (*CustomizeAlert, error)
GetByScopeAndScopeIDAndName .
func (*CustomizeAlertDB) Insert ¶
func (db *CustomizeAlertDB) Insert(alert *CustomizeAlert) error
Insert .
func (*CustomizeAlertDB) QueryByScopeAndScopeID ¶
func (db *CustomizeAlertDB) QueryByScopeAndScopeID(scope, scopeID string, pageNo, pageSize int, name string) ([]*CustomizeAlert, error)
QueryByScopeAndScopeID .
func (*CustomizeAlertDB) Update ¶
func (db *CustomizeAlertDB) Update(alert *CustomizeAlert) error
Update .
func (*CustomizeAlertDB) UpdateEnable ¶
func (db *CustomizeAlertDB) UpdateEnable(id uint64, enable bool) error
UpdateEnable .
type CustomizeAlertNotifyTemplate ¶
type CustomizeAlertNotifyTemplate struct { ID uint64 `gorm:"column:id" json:"id"` Name string `gorm:"column:name" json:"name"` CustomizeAlertID uint64 `gorm:"column:customize_alert_id" json:"customize_alert_id"` AlertType string `gorm:"column:alert_type" json:"alert_type"` AlertIndex string `gorm:"column:alert_index" json:"alert_index"` Target string `gorm:"column:target" json:"target"` Trigger string `gorm:"column:trigger" json:"trigger"` Title string `gorm:"column:title" json:"title"` Template string `gorm:"column:template" json:"template"` Formats jsonmap.JSONMap `gorm:"column:formats" json:"formats"` Version string `gorm:"column:version" json:"version"` Enable bool `gorm:"column:Enable" json:"enable"` CreateTime time.Time `gorm:"column:create_time" json:"create_time"` UpdateTime time.Time `gorm:"column:update_time" json:"update_time"` }
CustomizeAlertNotifyTemplate .
func (CustomizeAlertNotifyTemplate) TableName ¶
func (CustomizeAlertNotifyTemplate) TableName() string
TableName .
type CustomizeAlertNotifyTemplateDB ¶
CustomizeAlertNotifyTemplateDB .
func (*CustomizeAlertNotifyTemplateDB) DeleteByAlertID ¶
func (db *CustomizeAlertNotifyTemplateDB) DeleteByAlertID(alertID uint64) error
DeleteByAlertID .
func (*CustomizeAlertNotifyTemplateDB) DeleteByIDs ¶
func (db *CustomizeAlertNotifyTemplateDB) DeleteByIDs(ids []uint64) error
DeleteByIDs .
func (*CustomizeAlertNotifyTemplateDB) Insert ¶
func (db *CustomizeAlertNotifyTemplateDB) Insert(notify *CustomizeAlertNotifyTemplate) error
Insert .
func (*CustomizeAlertNotifyTemplateDB) QueryByAlertIDs ¶
func (db *CustomizeAlertNotifyTemplateDB) QueryByAlertIDs(alertIDs []uint64) ([]*CustomizeAlertNotifyTemplate, error)
QueryByAlertIDs .
func (*CustomizeAlertNotifyTemplateDB) QueryCustomizeAlertTemplate ¶
func (db *CustomizeAlertNotifyTemplateDB) QueryCustomizeAlertTemplate() ([]*CustomizeAlertNotifyTemplate, error)
func (*CustomizeAlertNotifyTemplateDB) QueryEnabledByTypesAndIndexes ¶
func (db *CustomizeAlertNotifyTemplateDB) QueryEnabledByTypesAndIndexes( types, indexes []string) ([]*CustomizeAlertNotifyTemplate, error)
QueryEnabledByTypesAndIndexes .
func (*CustomizeAlertNotifyTemplateDB) Update ¶
func (db *CustomizeAlertNotifyTemplateDB) Update(notify *CustomizeAlertNotifyTemplate) error
Update .
func (*CustomizeAlertNotifyTemplateDB) UpdateEnableByAlertID ¶
func (db *CustomizeAlertNotifyTemplateDB) UpdateEnableByAlertID(alertID uint64, enable bool) error
UpdateEnableByAlertID .
type CustomizeAlertRule ¶
type CustomizeAlertRule struct { ID uint64 `gorm:"column:id"` Name string `gorm:"column:name"` CustomizeAlertID uint64 `gorm:"column:customize_alert_id"` AlertType string `gorm:"column:alert_type"` AlertIndex string `gorm:"column:alert_index"` AlertScope string `gorm:"column:alert_scope"` AlertScopeID string `gorm:"column:alert_scope_id"` Template jsonmap.JSONMap `gorm:"column:template"` Attributes jsonmap.JSONMap `gorm:"column:attributes"` Enable bool `gorm:"column:enable"` CreateTime time.Time `gorm:"column:create_time"` UpdateTime time.Time `gorm:"column:update_time"` }
CustomizeAlertRule .
type CustomizeAlertRuleDB ¶
CustomizeAlertRuleDB .
func (*CustomizeAlertRuleDB) DeleteByAlertID ¶
func (db *CustomizeAlertRuleDB) DeleteByAlertID(alertID uint64) error
DeleteByAlertID .
func (*CustomizeAlertRuleDB) DeleteByIDs ¶
func (db *CustomizeAlertRuleDB) DeleteByIDs(ids []uint64) error
DeleteByIDs .
func (*CustomizeAlertRuleDB) Insert ¶
func (db *CustomizeAlertRuleDB) Insert(rule *CustomizeAlertRule) error
Insert .
func (*CustomizeAlertRuleDB) QueryByAlertIDs ¶
func (db *CustomizeAlertRuleDB) QueryByAlertIDs(alertIDs []uint64) ([]*CustomizeAlertRule, error)
QueryByAlertIDs .
func (*CustomizeAlertRuleDB) QueryEnabledByScope ¶
func (db *CustomizeAlertRuleDB) QueryEnabledByScope(scope, scopeID string) ([]*CustomizeAlertRule, error)
QueryEnabledByScope .
func (*CustomizeAlertRuleDB) QueryEnabledByScopeAndIndices ¶
func (db *CustomizeAlertRuleDB) QueryEnabledByScopeAndIndices( scope, scopeID string, indices []string) ([]*CustomizeAlertRule, error)
QueryEnabledByScopeAndIndices .
func (*CustomizeAlertRuleDB) Update ¶
func (db *CustomizeAlertRuleDB) Update(rule *CustomizeAlertRule) error
Update .
func (*CustomizeAlertRuleDB) UpdateEnableByAlertID ¶
func (db *CustomizeAlertRuleDB) UpdateEnableByAlertID(alertID uint64, enable bool) error
UpdateEnableByAlertID .
type DB ¶
type DB struct { *gorm.DB CustomizeAlert CustomizeAlertDB CustomizeAlertRule CustomizeAlertRuleDB CustomizeAlertNotifyTemplate CustomizeAlertNotifyTemplateDB Alert AlertDB AlertExpression AlertExpressionDB AlertNotify AlertNotifyDB AlertNotifyTemplate AlertNotifyTemplateDB AlertRule AlertRuleDB AlertRecord AlertRecordDB AlertEventDB AlertEventDB AlertEventSuppressDB AlertEventSuppressDB }
DB .
type MetricExpression ¶
type MetricExpression struct { ID uint64 `gorm:"column:id" json:"id"` Attributes jsonmap.JSONMap `gorm:"column:attributes" json:"attributes"` Expression jsonmap.JSONMap `gorm:"column:expression" json:"expression"` Version string `gorm:"column:version" json:"version"` Enable bool `gorm:"column:enable" json:"enable"` Created time.Time `gorm:"column:created" json:"created"` Updated time.Time `gorm:"column:updated" json:"updated"` }
func (MetricExpression) TableName ¶
func (MetricExpression) TableName() string
type MetricExpressionDB ¶
MetricExpression
func (*MetricExpressionDB) GetAllMetricExpression ¶
func (db *MetricExpressionDB) GetAllMetricExpression(pageNo, pageSize int64) ([]*MetricExpression, error)