github.com/hhrutter/nomad@v0.6.0-rc2.0.20170723054333-80c4b03f0705/website/source/api/operator.html.md (about) 1 --- 2 layout: api 3 page_title: Operator - HTTP API 4 sidebar_current: api-operator 5 description: |- 6 The /operator endpoints provides cluster-level tools for Nomad operators, such 7 as interacting with the Raft subsystem. 8 --- 9 # /v1/operator 10 11 The `/operator` endpoint provides cluster-level tools for Nomad operators, such 12 as interacting with the Raft subsystem. 13 14 ~> Use this interface with extreme caution, as improper use could lead to a 15 Nomad outage and even loss of data. 16 17 See the [Outage Recovery](/guides/outage.html) guide for some examples of how 18 these capabilities are used. For a CLI to perform these operations manually, 19 please see the documentation for the 20 [`nomad operator`](/docs/commands/operator-index.html) command. 21 22 23 ## Read Raft Configuration 24 25 This endpoint queries the status of a client node registered with Nomad. 26 27 | Method | Path | Produces | 28 | ------ | --------------------------------- | -------------------------- | 29 | `GET` | `/v1/operator/raft/configuration` | `application/json` | 30 31 The table below shows this endpoint's support for 32 [blocking queries](/api/index.html#blocking-queries) and 33 [required ACLs](/api/index.html#acls). 34 35 | Blocking Queries | ACL Required | 36 | ---------------- | ------------ | 37 | `NO` | `none` | 38 39 ### Parameters 40 41 - `stale` - Specifies if the cluster should respond without an active leader. 42 This is specified as a querystring parameter. 43 44 ### Sample Request 45 46 ```text 47 $ curl \ 48 https://nomad.rocks/v1/operator/raft/configuration 49 ``` 50 51 ### Sample Response 52 53 ```json 54 { 55 "Index": 1, 56 "Servers": [ 57 { 58 "Address": "127.0.0.1:4647", 59 "ID": "127.0.0.1:4647", 60 "Leader": true, 61 "Node": "bacon-mac.global", 62 "Voter": true 63 } 64 ] 65 } 66 ``` 67 68 #### Field Reference 69 70 - `Index` `(int)` - The `Index` value is the Raft corresponding to this 71 configuration. The latest configuration may not yet be committed if changes 72 are in flight. 73 74 - `Servers` `(array: Server)` - The returned `Servers` array has information 75 about the servers in the Raft peer configuration. 76 77 - `ID` `(string)` - The ID of the server. This is the same as the `Address` 78 but may be upgraded to a GUID in a future version of Nomad. 79 80 - `Node` `(string)` - The node name of the server, as known to Nomad, or 81 `"(unknown)"` if the node is stale and not known. 82 83 - `Address` `(string)` - The `ip:port` for the server. 84 85 - `Leader` `(bool)` - is either "true" or "false" depending on the server's 86 role in the Raft configuration. 87 88 - `Voter` `(bool)` - is "true" or "false", indicating if the server has a vote 89 in the Raft configuration. Future versions of Nomad may add support for 90 non-voting servers. 91 92 ## Remove Raft Peer 93 94 This endpoint removes a Nomad server with given address from the Raft 95 configuration. The return code signifies success or failure. 96 97 | Method | Path | Produces | 98 | -------- | ---------------------------| -------------------------- | 99 | `DELETE` | `/v1/operator/raft/peer` | `application/json` | 100 101 The table below shows this endpoint's support for 102 [blocking queries](/api/index.html#blocking-queries) and 103 [required ACLs](/api/index.html#acls). 104 105 | Blocking Queries | ACL Required | 106 | ---------------- | ------------ | 107 | `NO` | `none` | 108 109 ### Parameters 110 111 - `address` `(string: <required>)` - Specifies the server to remove as 112 `ip:port`. This may be provided multiple times and is provided as a 113 querystring parameter. 114 115 - `stale` - Specifies if the cluster should respond without an active leader. 116 This is specified as a querystring parameter. 117 118 ### Sample Request 119 120 ```text 121 $ curl \ 122 --request DELETE \ 123 https://nomad.rocks/v1/operator/raft/peer?address=1.2.3.4 124 ```