Files
cloudpods/pkg/mcclient/modules/mod_suggestsysrule.go
T
zhaoxiangchun af9e911fd0 modify suggest rule cli
1.增加perform config方法,方便修改默认规则:执行周期,扫描窗口的属性
2020-09-30 17:15:28 +08:00

78 lines
2.0 KiB
Go

// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package modules
import (
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
)
var (
SuggestSysRuleManager *SSuggestSysRuleManager
SuggestSysAlertManager *SSuggestSysAlertManager
InfluxdbShemaManager *SInfluxdbShemaManager
)
func init() {
SuggestSysRuleManager = NewSuggestSysRuleManager()
SuggestSysAlertManager = NewSuggestSysAlertManager()
InfluxdbShemaManager = NewInfluxdbShemaManager()
for _, m := range []modulebase.IBaseManager{
SuggestSysRuleManager,
SuggestSysAlertManager,
InfluxdbShemaManager,
} {
Register(m)
}
}
type SSuggestSysRuleManager struct {
*modulebase.ResourceManager
}
type SSuggestSysAlertManager struct {
*modulebase.ResourceManager
}
type SInfluxdbShemaManager struct {
*modulebase.ResourceManager
}
func NewSuggestSysRuleManager() *SSuggestSysRuleManager {
man := NewMonitorV2Manager("suggestsysrule", "suggestsysrules",
[]string{"id", "name", "type", "enabled", "period", "time_from", "setting"},
[]string{})
return &SSuggestSysRuleManager{
ResourceManager: &man,
}
}
func NewSuggestSysAlertManager() *SSuggestSysAlertManager {
man := NewMonitorV2Manager("suggestsysalert", "suggestsysalerts",
[]string{"id", "name", "type", "res_id", "monitor_config"},
[]string{})
return &SSuggestSysAlertManager{
ResourceManager: &man,
}
}
func NewInfluxdbShemaManager() *SInfluxdbShemaManager {
man := NewMonitorV2Manager("influxdbshema", "influxdbshemas",
[]string{},
[]string{})
return &SInfluxdbShemaManager{
ResourceManager: &man,
}
}