Files
EdgeAdmin/internal/web/actions/default/clusters/cluster/settings/metrics/delete.go

31 lines
735 B
Go
Raw Normal View History

2021-06-27 21:59:06 +08:00
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package metrics
2021-06-30 19:59:59 +08:00
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
2021-06-27 21:59:06 +08:00
type DeleteAction struct {
actionutils.ParentAction
}
2021-06-30 19:59:59 +08:00
func (this *DeleteAction) RunPost(params struct {
ClusterId int64
ItemId int64
}) {
defer this.CreateLogInfo("从集群 %d 中移除指标 %d", params.ClusterId, params.ItemId)
_, err := this.RPC().NodeClusterMetricItemRPC().DisableNodeClusterMetricItem(this.AdminContext(), &pb.DisableNodeClusterMetricItemRequest{
NodeClusterId: params.ClusterId,
MetricItemId: params.ItemId,
})
if err != nil {
this.ErrorPage(err)
return
}
2021-06-27 21:59:06 +08:00
this.Success()
}