github.com/ncodes/nomad@v0.5.7-0.20170403112158-97adf4a74fb3/nomad/structs/operator.go (about) 1 package structs 2 3 import ( 4 "github.com/hashicorp/raft" 5 ) 6 7 // RaftServer has information about a server in the Raft configuration. 8 type RaftServer struct { 9 // ID is the unique ID for the server. These are currently the same 10 // as the address, but they will be changed to a real GUID in a future 11 // release of Nomad. 12 ID raft.ServerID 13 14 // Node is the node name of the server, as known by Nomad, or this 15 // will be set to "(unknown)" otherwise. 16 Node string 17 18 // Address is the IP:port of the server, used for Raft communications. 19 Address raft.ServerAddress 20 21 // Leader is true if this server is the current cluster leader. 22 Leader bool 23 24 // Voter is true if this server has a vote in the cluster. This might 25 // be false if the server is staging and still coming online, or if 26 // it's a non-voting server, which will be added in a future release of 27 // Nomad. 28 Voter bool 29 } 30 31 // RaftConfigrationResponse is returned when querying for the current Raft 32 // configuration. 33 type RaftConfigurationResponse struct { 34 // Servers has the list of servers in the Raft configuration. 35 Servers []*RaftServer 36 37 // Index has the Raft index of this configuration. 38 Index uint64 39 } 40 41 // RaftPeerByAddressRequest is used by the Operator endpoint to apply a Raft 42 // operation on a specific Raft peer by address in the form of "IP:port". 43 type RaftPeerByAddressRequest struct { 44 // Address is the peer to remove, in the form "IP:port". 45 Address raft.ServerAddress 46 47 // WriteRequest holds the Region for this request. 48 WriteRequest 49 }