mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
fix(server): add user facing remove API
This was accidently removed as we refactored the standy stuff. Re-add this user facing remove endpoint that matches the config endpoints.
This commit is contained in:
parent
3c04f8b664
commit
62560f9959
@ -1233,3 +1233,25 @@ curl -L http://127.0.0.1:7001/v2/admin/config
|
|||||||
"promoteDelay": 1800
|
"promoteDelay": 1800
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Remove Machines
|
||||||
|
|
||||||
|
At times you may want to manually remove a machine. Using the machines endpoint
|
||||||
|
you can find and remove machines.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -L http://127.0.0.1:7001/v2/admin/machines/peer2
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"clientURL": "http://127.0.0.1:4002",
|
||||||
|
"name": "peer2",
|
||||||
|
"peerURL": "http://127.0.0.1:7002",
|
||||||
|
"state": "follower"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -L -XDELETE http://127.0.0.1:7001/v2/admin/machines/peer2
|
||||||
|
```
|
||||||
|
@ -355,6 +355,7 @@ func (s *PeerServer) HTTPHandler() http.Handler {
|
|||||||
router.HandleFunc("/v2/admin/config", s.setClusterConfigHttpHandler).Methods("PUT")
|
router.HandleFunc("/v2/admin/config", s.setClusterConfigHttpHandler).Methods("PUT")
|
||||||
router.HandleFunc("/v2/admin/machines", s.getMachinesHttpHandler).Methods("GET")
|
router.HandleFunc("/v2/admin/machines", s.getMachinesHttpHandler).Methods("GET")
|
||||||
router.HandleFunc("/v2/admin/machines/{name}", s.getMachineHttpHandler).Methods("GET")
|
router.HandleFunc("/v2/admin/machines/{name}", s.getMachineHttpHandler).Methods("GET")
|
||||||
|
router.HandleFunc("/v2/admin/machines/{name}", s.RemoveHttpHandler).Methods("DELETE")
|
||||||
|
|
||||||
return router
|
return router
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user