(client *client, options *DeleteOptions, nodeID string)
| 162 | } |
| 163 | |
| 164 | func 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 | |
| 181 | func init() { |
| 182 | DeleteCommand.Flags().StringVarP(&deleteOptions.namespace, "namespace", "n", "", "The namespace") |
no test coverage detected