1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! Body of `POST /api/membership`
use Deserialize;
use Serialize;
use crateNodeRole;
/// A change to who is in the cluster
///
/// One request for every such change, because they are one decision made in stages: whether a
/// node is a member at all, and whether it counts towards a quorum.
///
/// Tagged by `op` rather than wrapped, so the JSON stays flat:
///
/// ```json
/// {"op": "Add", "node_id": 2, "addr": "127.0.0.1:8081"}
/// {"op": "SetRole", "node_id": 2, "role": "Voter"}
/// {"op": "Remove", "node_id": 2}
/// ```