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:
Brandon Philips 2014-05-20 20:01:10 -07:00
parent 3c04f8b664
commit 62560f9959
2 changed files with 23 additions and 0 deletions

View File

@ -1233,3 +1233,25 @@ curl -L http://127.0.0.1:7001/v2/admin/config
"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
```

View File

@ -355,6 +355,7 @@ func (s *PeerServer) HTTPHandler() http.Handler {
router.HandleFunc("/v2/admin/config", s.setClusterConfigHttpHandler).Methods("PUT")
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.RemoveHttpHandler).Methods("DELETE")
return router
}