(cli *client, id uint64)
| 153 | } |
| 154 | |
| 155 | func removeRaftPeer(cli *client, id uint64) error { |
| 156 | var request struct { |
| 157 | ID uint64 `json:"id"` |
| 158 | Operation string `json:"operation"` |
| 159 | } |
| 160 | request.ID = id |
| 161 | request.Operation = "remove" |
| 162 | |
| 163 | rsp, err := cli.restyCli.R(). |
| 164 | SetBody(&request). |
| 165 | Post("/raft/peers") |
| 166 | if err != nil { |
| 167 | return err |
| 168 | } |
| 169 | if rsp.IsError() { |
| 170 | return unmarshalError(rsp.Body()) |
| 171 | } |
| 172 | |
| 173 | printLine("Remove node '%d' successfully", id) |
| 174 | return nil |
| 175 | } |
no test coverage detected