node

package
v0.0.156 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WebsocketMessageType = map[int]string{
	websocket.BinaryMessage: "binary",
	websocket.TextMessage:   "text",
	websocket.CloseMessage:  "close",
	websocket.PingMessage:   "ping",
	websocket.PongMessage:   "pong",
}

Functions

func RegisterActionRoutes added in v0.0.145

func RegisterActionRoutes(api *gin.RouterGroup)

func RegisterMetadataRoutes added in v0.0.145

func RegisterMetadataRoutes(api *gin.RouterGroup)

func RegisterResourceRoutes added in v0.0.145

func RegisterResourceRoutes(api *gin.RouterGroup)

func RegisterShellRoutes added in v0.0.145

func RegisterShellRoutes(api *gin.RouterGroup)

func RegisterTaintRoutes added in v0.0.145

func RegisterTaintRoutes(api *gin.RouterGroup)

Types

type ActionController added in v0.0.145

type ActionController struct{}

func (*ActionController) BatchCordon added in v0.0.145

func (nc *ActionController) BatchCordon(c *gin.Context)

@Summary 批量将指定的 Kubernetes 节点设置为不可调度(cordon) @Security BearerAuth @Param cluster query string true "集群名称" @Param name_list body []string true "节点名称列表" @Success 200 {object} string @Router /k8s/cluster/{cluster}/node/batch/cordon [post]

func (*ActionController) BatchDrain added in v0.0.145

func (nc *ActionController) BatchDrain(c *gin.Context)

@Summary 批量驱逐指定的 Kubernetes 节点 @Security BearerAuth @Param cluster query string true "集群名称" @Param name_list body []string true "节点名称列表" @Success 200 {object} string @Router /k8s/cluster/{cluster}/node/batch/drain [post]

func (*ActionController) BatchUnCordon added in v0.0.145

func (nc *ActionController) BatchUnCordon(c *gin.Context)

@Summary 批量解除指定节点的隔离状态(Uncordon),使其重新可调度 @Security BearerAuth @Param cluster query string true "集群名称" @Param name_list body []string true "节点名称列表" @Success 200 {object} string @Router /k8s/cluster/{cluster}/node/batch/uncordon [post]

func (*ActionController) Cordon added in v0.0.145

func (nc *ActionController) Cordon(c *gin.Context)

@Summary 隔离指定节点 @Security BearerAuth @Param cluster query string true "集群名称" @Param name path string true "节点名称" @Success 200 {object} string @Router /k8s/cluster/{cluster}/node/cordon/name/{name} [post]

func (*ActionController) Drain added in v0.0.145

func (nc *ActionController) Drain(c *gin.Context)

@Summary 驱逐指定节点 @Security BearerAuth @Param cluster query string true "集群名称" @Param name path string true "节点名称" @Success 200 {object} string @Router /k8s/cluster/{cluster}/node/drain/name/{name} [post]

func (*ActionController) UnCordon added in v0.0.145

func (nc *ActionController) UnCordon(c *gin.Context)

@Summary 解除指定节点隔离 @Security BearerAuth @Param cluster query string true "集群名称" @Param name path string true "节点名称" @Success 200 {object} string @Router /k8s/cluster/{cluster}/node/uncordon/name/{name} [post]

type MetadataController added in v0.0.145

type MetadataController struct{}

func (*MetadataController) AllLabelList added in v0.0.145

func (nc *MetadataController) AllLabelList(c *gin.Context)

@Summary 获取所有节点上的标签 @Security BearerAuth @Param cluster query string true "集群名称" @Success 200 {object} string @Router /k8s/cluster/{cluster}/node/labels/list [get]

func (*MetadataController) NameOptionList added in v0.0.145

func (nc *MetadataController) NameOptionList(c *gin.Context)

@Summary 获取节点名称选项列表 @Security BearerAuth @Param cluster query string true "集群名称" @Success 200 {object} string @Router /k8s/cluster/{cluster}/node/name/option_list [get]

func (*MetadataController) UniqueLabels added in v0.0.145

func (nc *MetadataController) UniqueLabels(c *gin.Context)

@Summary 获取选定集群中所有唯一的节点标签键,并以选项列表形式返回 @Security BearerAuth @Param cluster query string true "集群名称" @Success 200 {object} string @Router /k8s/cluster/{cluster}/node/labels/unique_labels [get]

type ResourceController added in v0.0.145

type ResourceController struct{}

func (*ResourceController) TopList added in v0.0.145

func (nc *ResourceController) TopList(c *gin.Context)

@Summary 返回所有节点的资源使用率(top指标),包括CPU和内存的用量及其数值化表示,便于前端排序和展示 @Security BearerAuth @Param cluster query string true "集群名称" @Success 200 {object} string @Router /k8s/cluster/{cluster}/node/top/list [get]

func (*ResourceController) Usage added in v0.0.145

func (nc *ResourceController) Usage(c *gin.Context)

@Summary 获取节点资源使用情况 @Security BearerAuth @Param cluster query string true "集群名称" @Param name path string true "节点名称" @Success 200 {object} string @Router /k8s/cluster/{cluster}/node/usage/name/{name} [get]

type ShellController added in v0.0.145

type ShellController struct{}

func (*ShellController) CreateKubectlShell added in v0.0.145

func (nc *ShellController) CreateKubectlShell(c *gin.Context)

@Summary 创建kubectl shell @Security BearerAuth @Param cluster query string true "集群名称" @Param node_name path string true "节点名称" @Param cluster_id path string true "集群ID,base64编码" @Success 200 {object} string @Router /k8s/cluster/{cluster}/node/name/{node_name}/cluster_id/{cluster_id}/create_kubectl_shell [post]

func (*ShellController) CreateNodeShell added in v0.0.145

func (nc *ShellController) CreateNodeShell(c *gin.Context)

@Summary 创建节点shell @Security BearerAuth @Param cluster query string true "集群名称" @Param node_name path string true "节点名称" @Success 200 {object} string @Router /k8s/cluster/{cluster}/node/name/{node_name}/create_node_shell [post]

type TaintController added in v0.0.145

type TaintController struct{}

func (*TaintController) Add added in v0.0.145

func (tc *TaintController) Add(c *gin.Context)

@Summary 添加污点 @Security BearerAuth @Param cluster query string true "集群名称" @Param name path string true "节点名称" @Param body body TaintInfo true "污点信息" @Success 200 {object} string @Router /k8s/cluster/{cluster}/node/add_taints/name/{name} [post]

func (*TaintController) Delete added in v0.0.145

func (tc *TaintController) Delete(c *gin.Context)

@Summary 删除污点 @Security BearerAuth @Param cluster query string true "集群名称" @Param name path string true "节点名称" @Param body body TaintInfo true "污点信息" @Success 200 {object} string @Router /k8s/cluster/{cluster}/node/delete_taints/name/{name} [post]

func (*TaintController) List added in v0.0.145

func (tc *TaintController) List(c *gin.Context)

@Summary 获取所有节点上的污点 @Security BearerAuth @Param cluster query string true "集群名称" @Success 200 {object} string @Router /k8s/cluster/{cluster}/node/taints/list [get]

func (*TaintController) ListByName added in v0.0.145

func (tc *TaintController) ListByName(c *gin.Context)

@Summary 获取某个节点上的污点 @Security BearerAuth @Param cluster query string true "集群名称" @Param name path string true "节点名称" @Success 200 {object} string @Router /k8s/cluster/{cluster}/node/list_taints/name/{name} [get]

func (*TaintController) Update added in v0.0.145

func (tc *TaintController) Update(c *gin.Context)

@Summary 修改污点 @Security BearerAuth @Param cluster query string true "集群名称" @Param name path string true "节点名称" @Param body body TaintInfo true "污点信息" @Success 200 {object} string @Router /k8s/cluster/{cluster}/node/update_taints/name/{name} [post]

type TaintInfo added in v0.0.27

type TaintInfo struct {
	Key    string `json:"key"`
	Value  string `json:"value"`
	Effect string `json:"effect"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL