Files
cloudpods/pkg/mcclient/modules/mod_suggestsysrule.go
zhaoxiangchun a42e9c9462 优化建议功能-未使用的eip
1.通过cronman 调用eipUnused相关的driver,查询未使用的eip
2.依据对步骤1中的中的数据,对资源列表就行create、update、delete进行三种类型的操作

deal with comments

gencopyright

climc for SuggestSysRule and SuggestSysAlert

monitor: fix sysrule related models not generated

eip未使用的监控参数结构调整
2020-04-14 15:37:01 +08:00

62 lines
1.6 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
)
func init() {
SuggestSysRuleManager = NewSuggestSysRuleManager()
SuggestSysAlertManager = NewSuggestSysAlertManager()
for _, m := range []modulebase.IBaseManager{
SuggestSysRuleManager,
SuggestSysAlertManager,
} {
Register(m)
}
}
type SSuggestSysRuleManager struct {
*modulebase.ResourceManager
}
type SSuggestSysAlertManager struct {
*modulebase.ResourceManager
}
func NewSuggestSysRuleManager() *SSuggestSysRuleManager {
man := NewMonitorV2Manager("suggestsysrule", "suggestsysrules",
[]string{"id", "name", "type", "enabled", "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,
}
}