Class: Weaviate::Nodes

Inherits:
Base
  • Object
show all
Defined in:
lib/weaviate/nodes.rb,
sig/weaviate.rbs

Constant Summary collapse

PATH =
"nodes"

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 Weaviate::Base

Instance Method Details

#list(output: nil, class_name: nil, shard_name: nil) ⇒ json

Parameters:

  • output (String) (defaults to: nil) —

    "minimal" (default) or "verbose", which includes shard details

  • class_name (String) (defaults to: nil) —

    Only return shards of this collection

  • shard_name (String) (defaults to: nil) —

    Only return this shard, requires class_name

  • output: (String, nil) (defaults to: nil)
  • class_name: (String, nil) (defaults to: nil)
  • shard_name: (String, nil) (defaults to: nil)

Returns:

  • (json)


10
11
12
13
14
15
16
17
18
# File 'lib/weaviate/nodes.rb', line 10

def list(output: nil, class_name: nil, shard_name: nil)
  path = class_name.nil? ? PATH : "#{PATH}/#{class_name}"

  response = client.connection.get(path) do |req|
    req.params["output"] = output unless output.nil?
    req.params["shardName"] = shard_name unless shard_name.nil?
  end
  response.body
end