Class: Consul::Client::Status

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/consul/client/status.rb

Instance Method Summary collapse

Methods included from Base

#initialize, #is_reachable

Instance Method Details

#build_url(suffix) ⇒ Object



28
29
30
# File 'lib/consul/client/status.rb', line 28

def build_url(suffix)
  "#{base_versioned_url}/status/#{suffix}"
end

#leaderObject

Public: This endpoint is used to get the Raft leader for the datacenter in which the agent is running

Reference: www.consul.io/docs/agent/http/status.html

Returns: Address, host:port.



14
15
16
# File 'lib/consul/client/status.rb', line 14

def leader
  RestClient.get leader_url
end

#peersObject

Public: This endpoint retrieves the Raft peers for the datacenter in which the the agent is running

Reference: www.consul.io/docs/agent/http/status.html

Returns: List of addresses.



24
25
26
# File 'lib/consul/client/status.rb', line 24

def peers
  RestClient.get peers_url
end