Selaa lähdekoodia

feat(Documentation): document the entire admin machines API

Flesh out this document a bit more completely.
Brandon Philips 11 vuotta sitten
vanhempi
commit
0eba3c9000
1 muutettua tiedostoa jossa 32 lisäystä ja 0 poistoa
  1. 32 0
      Documentation/api.md

+ 32 - 0
Documentation/api.md

@@ -1241,6 +1241,36 @@ curl -L http://127.0.0.1:7001/v2/admin/config
 At times you may want to manually remove a machine. Using the machines endpoint
 you can find and remove machines.
 
+First, list all the machines in the cluster.
+
+```sh
+curl -L http://127.0.0.1:7001/v2/admin/machines
+```
+```json
+[
+    {
+        "clientURL": "http://127.0.0.1:4001",
+        "name": "peer1",
+        "peerURL": "http://127.0.0.1:7001",
+        "state": "leader"
+    },
+    {
+        "clientURL": "http://127.0.0.1:4002",
+        "name": "peer2",
+        "peerURL": "http://127.0.0.1:7002",
+        "state": "follower"
+    },
+    {
+        "clientURL": "http://127.0.0.1:4003",
+        "name": "peer3",
+        "peerURL": "http://127.0.0.1:7003",
+        "state": "follower"
+    }
+]
+```
+
+Then take a closer look at the machine you want to remove.
+
 ```sh
 curl -L http://127.0.0.1:7001/v2/admin/machines/peer2
 ```
@@ -1254,6 +1284,8 @@ curl -L http://127.0.0.1:7001/v2/admin/machines/peer2
 }
 ```
 
+And finally remove it.
+
 ```sh
 curl -L -XDELETE http://127.0.0.1:7001/v2/admin/machines/peer2
 ```