From acca36cb2f7db98bf3476c2d8a19bdfa2ec8df61 Mon Sep 17 00:00:00 2001 From: saimedhi Date: Thu, 22 Feb 2024 12:41:59 -0800 Subject: [PATCH] Added spec for k-NN warmup api Signed-off-by: saimedhi --- model/knn/warmup/operations.smithy | 23 +++++++++++++++++++++++ model/knn/warmup/structures.smithy | 18 ++++++++++++++++++ model/opensearch.smithy | 1 + 3 files changed, 42 insertions(+) create mode 100644 model/knn/warmup/operations.smithy create mode 100644 model/knn/warmup/structures.smithy diff --git a/model/knn/warmup/operations.smithy b/model/knn/warmup/operations.smithy new file mode 100644 index 000000000..485c56bf0 --- /dev/null +++ b/model/knn/warmup/operations.smithy @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +$version: "2" +namespace OpenSearch + +@externalDocumentation( + "API Reference": "https://opensearch.org/docs/latest/search-plugins/knn/api/#warmup-operation" +) + +@xOperationGroup("knn.warmup") +@xVersionAdded("1.0") +@readonly +@suppress(["HttpUriConflict"]) +@http(method: "GET", uri: "/_plugins/_knn/warmup/{index}") +@documentation("Preloads native library files into memory, reducing initial search latency for specified indexes") +operation KNNWarmup { + input: KNNWarmup_Input, + output: KNNWarmup_Output +} diff --git a/model/knn/warmup/structures.smithy b/model/knn/warmup/structures.smithy new file mode 100644 index 000000000..febefdbc8 --- /dev/null +++ b/model/knn/warmup/structures.smithy @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +$version: "2" +namespace OpenSearch + +@input +structure KNNWarmup_Input { + @required + @httpLabel + index: PathIndices, +} + +// TODO: Fill in Output Structure +structure KNNWarmup_Output{} diff --git a/model/opensearch.smithy b/model/opensearch.smithy index ccb6b3805..b48ee6159 100644 --- a/model/opensearch.smithy +++ b/model/opensearch.smithy @@ -256,6 +256,7 @@ service OpenSearch { IngestSimulate_Get_WithId, IngestSimulate_Post, IngestSimulate_Post_WithId, + KNNWarmup, Mget_Get, Mget_Get_WithIndex, Mget_Post,