github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/website/content/api-docs/operator/raft.mdx (about) 1 --- 2 layout: api 3 page_title: Raft - Operator - HTTP API 4 sidebar_title: Raft 5 description: |- 6 The /operator/raft endpoints provide tools for management of the Raft subsystem. 7 --- 8 9 # Raft Operator HTTP API 10 11 The `/operator/raft` endpoints provide tools for management of the Raft subsystem. 12 13 Please see the [Consensus Protocol Guide] for more information about Raft consensus protocol and its use. 14 15 ## Read Raft Configuration 16 17 This endpoint queries the status of a client node registered with Nomad. 18 19 | Method | Path | Produces | 20 | ------ | --------------------------------- | ------------------ | 21 | `GET` | `/v1/operator/raft/configuration` | `application/json` | 22 23 The table below shows this endpoint's support for 24 [blocking queries](/api-docs#blocking-queries) and 25 [required ACLs](/api-docs#acls). 26 27 | Blocking Queries | ACL Required | 28 | ---------------- | ------------ | 29 | `NO` | `management` | 30 31 ### Parameters 32 33 - `stale` - Specifies if the cluster should respond without an active leader. 34 This is specified as a query string parameter. 35 36 ### Sample Request 37 38 ```shell-session 39 $ curl \ 40 https://localhost:4646/v1/operator/raft/configuration 41 ``` 42 43 ### Sample Response 44 45 ```json 46 { 47 "Index": 1, 48 "Servers": [ 49 { 50 "Address": "127.0.0.1:4647", 51 "ID": "127.0.0.1:4647", 52 "Leader": true, 53 "Node": "bacon-mac.global", 54 "RaftProtocol": 2, 55 "Voter": true 56 } 57 ] 58 } 59 ``` 60 61 #### Field Reference 62 63 - `Index` `(int)` - The `Index` value is the Raft corresponding to this 64 configuration. The latest configuration may not yet be committed if changes 65 are in flight. 66 67 - `Servers` `(array: Server)` - The returned `Servers` array has information 68 about the servers in the Raft peer configuration. 69 70 - `ID` `(string)` - The ID of the server. This is the same as the `Address` 71 but may be upgraded to a GUID in a future version of Nomad. 72 73 - `Node` `(string)` - The node name of the server, as known to Nomad, or 74 `"(unknown)"` if the node is stale and not known. 75 76 - `Address` `(string)` - The `ip:port` for the server. 77 78 - `Leader` `(bool)` - is either "true" or "false" depending on the server's 79 role in the Raft configuration. 80 81 - `Voter` `(bool)` - is "true" or "false", indicating if the server has a vote 82 in the Raft configuration. Future versions of Nomad may add support for 83 non-voting servers. 84 85 ## Remove Raft Peer 86 87 This endpoint removes a Nomad server with given address from the Raft 88 configuration. The return code signifies success or failure. 89 90 | Method | Path | Produces | 91 | -------- | ------------------------ | ------------------ | 92 | `DELETE` | `/v1/operator/raft/peer` | `application/json` | 93 94 The table below shows this endpoint's support for 95 [blocking queries](/api-docs#blocking-queries) and 96 [required ACLs](/api-docs#acls). 97 98 | Blocking Queries | ACL Required | 99 | ---------------- | ------------ | 100 | `NO` | `management` | 101 102 ### Parameters 103 104 - `address` `(string: <optional>)` - Specifies the server to remove as 105 `ip:port`. This cannot be provided along with the `id` parameter. 106 107 - `id` `(string: <optional>)` - Specifies the server to remove as 108 `id`. This cannot be provided along with the `address` parameter. 109 110 ### Sample Request 111 112 ```shell-session 113 $ curl \ 114 --request DELETE \ 115 https://localhost:4646/v1/operator/raft/peer?address=1.2.3.4:4646 116 ``` 117 118 [Consensus Protocol Guide]: /docs/internals/consensus