MCPcopy Create free account
hub / github.com/apache/kvrocks-controller / Remove

Method Remove

server/api/node.go:70–84  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

68}
69
70func (handler *NodeHandler) Remove(c *gin.Context) {
71 ns := c.Param("namespace")
72 cluster, _ := c.MustGet(consts.ContextKeyCluster).(*store.Cluster)
73 shardIndex, _ := strconv.Atoi(c.Param("shard"))
74 err := cluster.RemoveNode(shardIndex, c.Param("id"))
75 if err != nil {
76 helper.ResponseError(c, err)
77 return
78 }
79 if err := handler.s.UpdateCluster(c, ns, cluster); err != nil {
80 helper.ResponseError(c, err)
81 return
82 }
83 helper.ResponseNoContent(c)
84}

Callers 1

TestNodeBasicsFunction · 0.95

Calls 4

ResponseErrorFunction · 0.92
ResponseNoContentFunction · 0.92
UpdateClusterMethod · 0.65
RemoveNodeMethod · 0.45

Tested by 1

TestNodeBasicsFunction · 0.76