Qdrant.Api.Http.Cluster (Qdrant v0.1.18)

Copy Markdown View Source

Service distributed setup and cluster management.

Functions accepting a Qdrant.Client are the primary API. No-client forms remain available for compatibility with application and environment configuration.

Summary

Functions

cluster_status()

@spec cluster_status() :: Qdrant.Types.result()

Get information about the current state and composition of the cluster.

Example

client = Qdrant.Client.new!(url: "http://localhost:6333")
Qdrant.Api.Http.Cluster.cluster_status(client)

cluster_status(client)

@spec cluster_status(Qdrant.Client.t()) :: Qdrant.Types.result()

cluster_telemetry()

@spec cluster_telemetry() :: Qdrant.Types.result()

Collect cluster-wide telemetry, including peer, collection, transfer, and resharding information.

Options are :details_level and :timeout.

cluster_telemetry(client)

@spec cluster_telemetry(Qdrant.Client.t()) :: Qdrant.Types.result()
@spec cluster_telemetry(Qdrant.Types.request_options()) :: Qdrant.Types.result()

cluster_telemetry(client, opts)

@spec cluster_telemetry(Qdrant.Client.t(), Qdrant.Types.request_options()) ::
  Qdrant.Types.result()
@spec cluster_telemetry(integer() | nil, integer() | nil) :: Qdrant.Types.result()

collection_cluster_info(collection_name)

@spec collection_cluster_info(String.t()) :: Qdrant.Types.result()

Get cluster information for a collection.

Example

client = Qdrant.Client.new!(url: "http://localhost:6333")
Qdrant.Api.Http.Cluster.collection_cluster_info(client, "my_collection")

collection_cluster_info(client, collection_name)

@spec collection_cluster_info(Qdrant.Client.t(), String.t()) :: Qdrant.Types.result()

create_shard_key(collection_name, body)

@spec create_shard_key(String.t(), Qdrant.Types.request_body()) ::
  Qdrant.Types.result()

Create a shard key for a collection.

Options:

  • :timeout - operation commit timeout in seconds

Example

client = Qdrant.Client.new!(url: "http://localhost:6333")
body = %{shard_key: "city"}
Qdrant.Api.Http.Cluster.create_shard_key(client, "my_collection", body)

create_shard_key(client, collection_name, body)

@spec create_shard_key(Qdrant.Client.t(), String.t(), Qdrant.Types.request_body()) ::
  Qdrant.Types.result()
@spec create_shard_key(String.t(), Qdrant.Types.request_body(), integer() | nil) ::
  Qdrant.Types.result()

create_shard_key(client, collection_name, body, opts)

delete_shard_key(collection_name, body)

@spec delete_shard_key(String.t(), Qdrant.Types.request_body()) ::
  Qdrant.Types.result()

Delete a shard key for a collection.

Options:

  • :timeout - operation commit timeout in seconds

Example

client = Qdrant.Client.new!(url: "http://localhost:6333")
body = %{shard_key: "city"}
Qdrant.Api.Http.Cluster.delete_shard_key(client, "my_collection", body)

delete_shard_key(client, collection_name, body)

@spec delete_shard_key(Qdrant.Client.t(), String.t(), Qdrant.Types.request_body()) ::
  Qdrant.Types.result()
@spec delete_shard_key(String.t(), Qdrant.Types.request_body(), integer() | nil) ::
  Qdrant.Types.result()

delete_shard_key(client, collection_name, body, opts)

list_shard_keys(collection_name)

@spec list_shard_keys(String.t()) :: Qdrant.Types.result()

List shard keys configured for a collection.

list_shard_keys(client, collection_name)

@spec list_shard_keys(Qdrant.Client.t(), String.t()) :: Qdrant.Types.result()

recover_current_peer()

@spec recover_current_peer() :: Qdrant.Types.result()

Tries to recover the current peer Raft state.

Example

client = Qdrant.Client.new!(url: "http://localhost:6333")
Qdrant.Api.Http.Cluster.recover_current_peer(client)

recover_current_peer(client)

@spec recover_current_peer(Qdrant.Client.t()) :: Qdrant.Types.result()

remove_peer(peer_id)

Remove a peer from the cluster by its id.

Options:

  • :force - remove the peer even when it has shards or replicas

Example

client = Qdrant.Client.new!(url: "http://localhost:6333")
Qdrant.Api.Http.Cluster.remove_peer(client, 42, force: true)

remove_peer(client, peer_id)

remove_peer(client, peer_id, opts)

update_collection_cluster(collection_name, body)

@spec update_collection_cluster(String.t(), Qdrant.Types.request_body()) ::
  Qdrant.Types.result()

Update collection cluster setup.

Options:

  • :timeout - operation commit timeout in seconds

Example

client = Qdrant.Client.new!(url: "http://localhost:6333")
body = %{move_shard: %{shard_id: 1, to_peer_id: 2, from_peer_id: 1}}
Qdrant.Api.Http.Cluster.update_collection_cluster(client, "my_collection", body)

update_collection_cluster(client, collection_name, body)

@spec update_collection_cluster(
  Qdrant.Client.t(),
  String.t(),
  Qdrant.Types.request_body()
) ::
  Qdrant.Types.result()
@spec update_collection_cluster(
  String.t(),
  Qdrant.Types.request_body(),
  integer() | nil
) ::
  Qdrant.Types.result()

update_collection_cluster(client, collection_name, body, opts)