Files
EdgeAdmin/internal/web/actions/default/clusters/cluster/node/up.go

30 lines
590 B
Go
Raw Normal View History

package node
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
2023-06-30 18:08:30 +08:00
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
// 手动上线
type UpAction struct {
actionutils.ParentAction
}
func (this *UpAction) RunPost(params struct {
NodeId int64
}) {
2023-06-30 18:08:30 +08:00
defer this.CreateLogInfo(codes.Node_LogUpNode, params.NodeId)
_, err := this.RPC().NodeRPC().UpdateNodeUp(this.AdminContext(), &pb.UpdateNodeUpRequest{
NodeId: params.NodeId,
IsUp: true,
})
if err != nil {
this.ErrorPage(err)
return
}
this.Success()
}