Class: Qdrant::Clusters

Inherits:
Base
  • Object
show all
Defined in:
lib/qdrant/clusters.rb

Constant Summary collapse

PATH =
"cluster"

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Qdrant::Base

Instance Method Details

#infoObject

Get information about the current state and composition of the cluster



8
9
10
11
# File 'lib/qdrant/clusters.rb', line 8

def info
  response = client.connection.get(PATH)
  response.body
end

#recoverObject

Tries to recover current peer Raft state.



14
15
16
17
# File 'lib/qdrant/clusters.rb', line 14

def recover
  response = client.connection.post("#{PATH}/recover")
  response.body
end

#remove_peer(peer_id:, force: nil) ⇒ Object

Remove peer from the cluster



20
21
22
23
24
25
26
27
28
# File 'lib/qdrant/clusters.rb', line 20

def remove_peer(
  peer_id:,
  force: nil
)
  response = client.connection.post("#{PATH}/recover") do |req|
    req.params["force"] = force if force
  end
  response.body
end