37 Star 407 Fork 74

GVPrancher/rancher

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
formatter.go 1.59 KB
一键复制 编辑 原始数据 按行查看 历史
orangedeng 提交于 2018-11-29 10:35 . Deploy Cluster&Project Monitoring
package monitor
import (
"github.com/rancher/norman/types"
)
const (
ResourceNode = "node"
ResourceCluster = "cluster"
ResourceEtcd = "etcd"
ResourceAPIServer = "apiserver"
ResourceScheduler = "scheduler"
ResourceControllerManager = "controllermanager"
ResourceIngressController = "ingressController"
ResourceFluentd = "fluentd"
ResourceWorkload = "workload"
ResourcePod = "pod"
ResourceContainer = "container"
)
const (
queryAction = "query"
querycluster = "querycluster"
queryproject = "queryproject"
listclustermetricname = "listclustermetricname"
listprojectmetricname = "listprojectmetricname"
)
func GraphFormatter(apiContext *types.APIContext, resource *types.RawResource) {
resource.AddAction(apiContext, queryAction)
}
func QueryGraphCollectionFormatter(apiContext *types.APIContext, collection *types.GenericCollection) {
collection.AddAction(apiContext, queryAction)
}
func MetricFormatter(apiContext *types.APIContext, resource *types.RawResource) {
resource.AddAction(apiContext, querycluster)
resource.AddAction(apiContext, queryproject)
resource.AddAction(apiContext, listclustermetricname)
resource.AddAction(apiContext, listprojectmetricname)
}
func MetricCollectionFormatter(apiContext *types.APIContext, collection *types.GenericCollection) {
collection.AddAction(apiContext, querycluster)
collection.AddAction(apiContext, queryproject)
collection.AddAction(apiContext, listclustermetricname)
collection.AddAction(apiContext, listprojectmetricname)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/rancher/rancher.git
git@gitee.com:rancher/rancher.git
rancher
rancher
rancher
v2.2.11

搜索帮助