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

Function deleteNode

cmd/client/command/delete.go:164–179  ·  view source on GitHub ↗
(client *client, options *DeleteOptions, nodeID string)

Source from the content-addressed store, hash-verified

162}
163
164func deleteNode(client *client, options *DeleteOptions, nodeID string) error {
165 rsp, err := client.restyCli.R().
166 SetPathParam("namespace", options.namespace).
167 SetPathParam("cluster", options.cluster).
168 SetPathParam("shard", strconv.Itoa(options.shard)).
169 SetPathParam("node", nodeID).
170 Delete("/namespaces/{namespace}/clusters/{cluster}/shards/{shard}/nodes/{node}")
171 if err != nil {
172 return err
173 }
174 if rsp.IsError() {
175 return unmarshalError(rsp.Body())
176 }
177 printLine("delete node: %s successfully.", nodeID)
178 return nil
179}
180
181func init() {
182 DeleteCommand.Flags().StringVarP(&deleteOptions.namespace, "namespace", "n", "", "The namespace")

Callers 1

delete.goFile · 0.70

Calls 3

unmarshalErrorFunction · 0.85
printLineFunction · 0.85
DeleteMethod · 0.65

Tested by

no test coverage detected