# `Qdrant.Api.Http.Cluster`
[🔗](https://github.com/marinac-dev/qdrant/blob/v0.1.18/lib/qdrant/api/http/cluster.ex#L1)

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.

# `cluster_status`

```elixir
@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`

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

# `cluster_telemetry`

```elixir
@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`

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

# `cluster_telemetry`

```elixir
@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`

```elixir
@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`

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

# `create_shard_key`

```elixir
@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`

```elixir
@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`

```elixir
@spec create_shard_key(
  Qdrant.Client.t(),
  String.t(),
  Qdrant.Types.request_body(),
  Qdrant.Types.request_options()
) :: Qdrant.Types.result()
```

# `delete_shard_key`

```elixir
@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`

```elixir
@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`

```elixir
@spec delete_shard_key(
  Qdrant.Client.t(),
  String.t(),
  Qdrant.Types.request_body(),
  Qdrant.Types.request_options()
) :: Qdrant.Types.result()
```

# `list_shard_keys`

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

List shard keys configured for a collection.

# `list_shard_keys`

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

# `recover_current_peer`

```elixir
@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`

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

# `remove_peer`

```elixir
@spec remove_peer(Qdrant.Types.extended_point_id()) :: Qdrant.Types.result()
```

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`

```elixir
@spec remove_peer(Qdrant.Client.t(), Qdrant.Types.extended_point_id()) ::
  Qdrant.Types.result()
@spec remove_peer(Qdrant.Types.extended_point_id(), boolean() | nil) ::
  Qdrant.Types.result()
```

# `remove_peer`

```elixir
@spec remove_peer(
  Qdrant.Client.t(),
  Qdrant.Types.extended_point_id(),
  Qdrant.Types.request_options()
) ::
  Qdrant.Types.result()
```

# `update_collection_cluster`

```elixir
@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`

```elixir
@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`

```elixir
@spec update_collection_cluster(
  Qdrant.Client.t(),
  String.t(),
  Qdrant.Types.request_body(),
  Qdrant.Types.request_options()
) :: Qdrant.Types.result()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
