UNPKG

@qdrant/js-client-rest

Version:

This repository contains the REST client for the [Qdrant](https://github.com/qdrant/qdrant) vector search engine.

333 lines (332 loc) 13.2 kB
import { Client } from '../api-client.js'; export declare function createClusterApi(client: Client): { /** * Get information about the current state and composition of the cluster */ readonly clusterStatus: import("@qdrant/openapi-typescript-fetch").TypedFetch<{ responses: { 200: { content: { "application/json": { time?: number | undefined; status?: string | undefined; result?: ({} & { status: "enabled"; peer_id: number; peers: { [key: string]: { uri: string; } | undefined; }; raft_info: { term: number; commit: number; pending_operations: number; leader?: number | null | undefined; role?: Record<string, unknown> | "Follower" | "Candidate" | "Leader" | "PreCandidate" | null | undefined; is_voter: boolean; }; consensus_thread_status: ({ last_update?: undefined; } & { consensus_thread_status: "stopped_with_err"; err: string; }) | ({ err?: undefined; } & (({ last_update?: undefined; } & { consensus_thread_status: "stopped"; }) | ({} & { consensus_thread_status: "working"; last_update: string; }))); message_send_failures: { [key: string]: { count: number; latest_error?: string | null | undefined; latest_error_timestamp?: string | null | undefined; } | undefined; }; }) | ({ consensus_thread_status?: undefined; peer_id?: undefined; peers?: undefined; raft_info?: undefined; message_send_failures?: undefined; } & { status: "disabled"; }) | undefined; }; }; }; default: { content: { "application/json": { time?: number | undefined; status?: { error?: string | undefined; } | undefined; result?: Record<string, unknown> | null | undefined; }; }; }; "4XX": { content: { "application/json": { time?: number | undefined; status?: { error?: string | undefined; } | undefined; result?: Record<string, unknown> | null | undefined; }; }; }; }; }>; /** * Get cluster information for a collection */ readonly collectionClusterInfo: import("@qdrant/openapi-typescript-fetch").TypedFetch<{ parameters: { path: { collection_name: string; }; }; responses: { 200: { content: { "application/json": { time?: number | undefined; status?: string | undefined; result?: { peer_id: number; shard_count: number; local_shards: { shard_id: number; shard_key?: string | number | Record<string, unknown> | null | undefined; points_count: number; state: "Active" | "Dead" | "Partial" | "Initializing" | "Listener" | "PartialSnapshot" | "Recovery"; }[]; remote_shards: { shard_id: number; shard_key?: string | number | Record<string, unknown> | null | undefined; peer_id: number; state: "Active" | "Dead" | "Partial" | "Initializing" | "Listener" | "PartialSnapshot" | "Recovery"; }[]; shard_transfers: { shard_id: number; from: number; to: number; sync: boolean; method?: Record<string, unknown> | "stream_records" | "snapshot" | "wal_delta" | null | undefined; comment?: string | null | undefined; }[]; resharding_operations: { direction: "up" | "down"; shard_id: number; peer_id: number; shard_key?: string | number | Record<string, unknown> | null | undefined; comment?: string | null | undefined; }[]; } | undefined; }; }; }; default: { content: { "application/json": { time?: number | undefined; status?: { error?: string | undefined; } | undefined; result?: Record<string, unknown> | null | undefined; }; }; }; "4XX": { content: { "application/json": { time?: number | undefined; status?: { error?: string | undefined; } | undefined; result?: Record<string, unknown> | null | undefined; }; }; }; }; }>; readonly recoverCurrentPeer: import("@qdrant/openapi-typescript-fetch").TypedFetch<{ responses: { 200: { content: { "application/json": { time?: number | undefined; status?: string | undefined; result?: boolean | undefined; }; }; }; default: { content: { "application/json": { time?: number | undefined; status?: { error?: string | undefined; } | undefined; result?: Record<string, unknown> | null | undefined; }; }; }; "4XX": { content: { "application/json": { time?: number | undefined; status?: { error?: string | undefined; } | undefined; result?: Record<string, unknown> | null | undefined; }; }; }; }; }>; /** * Tries to remove peer from the cluster. Will return an error if peer has shards on it. */ readonly removePeer: import("@qdrant/openapi-typescript-fetch").TypedFetch<{ parameters: { query?: { force?: boolean | undefined; } | undefined; path: { peer_id: number; }; }; responses: { 200: { content: { "application/json": { time?: number | undefined; status?: string | undefined; result?: boolean | undefined; }; }; }; default: { content: { "application/json": { time?: number | undefined; status?: { error?: string | undefined; } | undefined; result?: Record<string, unknown> | null | undefined; }; }; }; "4XX": { content: { "application/json": { time?: number | undefined; status?: { error?: string | undefined; } | undefined; result?: Record<string, unknown> | null | undefined; }; }; }; }; }>; readonly updateCollectionCluster: import("@qdrant/openapi-typescript-fetch").TypedFetch<{ parameters: { query?: { timeout?: number | undefined; } | undefined; path: { collection_name: string; }; }; requestBody?: { content: { "application/json": { move_shard: { shard_id: number; to_peer_id: number; from_peer_id: number; method?: Record<string, unknown> | "stream_records" | "snapshot" | "wal_delta" | null | undefined; }; } | { replicate_shard: { shard_id: number; to_peer_id: number; from_peer_id: number; method?: Record<string, unknown> | "stream_records" | "snapshot" | "wal_delta" | null | undefined; }; } | { abort_transfer: { shard_id: number; to_peer_id: number; from_peer_id: number; }; } | { drop_replica: { shard_id: number; peer_id: number; }; } | { create_sharding_key: { shard_key: string | number; shards_number?: number | null | undefined; replication_factor?: number | null | undefined; placement?: number[] | null | undefined; }; } | { drop_sharding_key: { shard_key: string | number; }; } | { restart_transfer: { shard_id: number; from_peer_id: number; to_peer_id: number; method: "stream_records" | "snapshot" | "wal_delta"; }; }; }; } | undefined; responses: { 200: { content: { "application/json": { time?: number | undefined; status?: string | undefined; result?: boolean | undefined; }; }; }; default: { content: { "application/json": { time?: number | undefined; status?: { error?: string | undefined; } | undefined; result?: Record<string, unknown> | null | undefined; }; }; }; "4XX": { content: { "application/json": { time?: number | undefined; status?: { error?: string | undefined; } | undefined; result?: Record<string, unknown> | null | undefined; }; }; }; }; }>; };