Class: Stretch::Cluster
- Inherits:
-
Object
- Object
- Stretch::Cluster
- Defined in:
- lib/stretch/cluster.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
- #health(options = {}) ⇒ Object
-
#initialize(connection) ⇒ Cluster
constructor
A new instance of Cluster.
- #settings(options = {}) ⇒ Object
- #state(options = {}) ⇒ Object
Constructor Details
#initialize(connection) ⇒ Cluster
Returns a new instance of Cluster.
5 6 7 |
# File 'lib/stretch/cluster.rb', line 5 def initialize connection @connection = connection end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
3 4 5 |
# File 'lib/stretch/cluster.rb', line 3 def connection @connection end |
Instance Method Details
#health(options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/stretch/cluster.rb', line 9 def health = {} indices = .delete(:indices) if .has_key? :indices path = "/health" if indices path << "/#{[indices].flatten.join(',')}" [:level] = "indices" end get path, end |
#settings(options = {}) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/stretch/cluster.rb', line 26 def settings = {} if .any? put "/settings", else get "/settings" end end |
#state(options = {}) ⇒ Object
22 23 24 |
# File 'lib/stretch/cluster.rb', line 22 def state = {} get "/state", end |