diff --git a/model/common_strings.smithy b/model/common_strings.smithy index b6a2c928..39fc5ef6 100644 --- a/model/common_strings.smithy +++ b/model/common_strings.smithy @@ -247,6 +247,12 @@ string PathTaskId @documentation("The name of the template.") string PathTemplateName +@xDataType("array") +@xEnumOptions(["circuit_breaker_triggered", "total_load_time", "eviction_count", "hit_count", "miss_count", "graph_memory_usage", "graph_memory_usage_percentage", "graph_index_requests", "graph_index_errors", "graph_query_requests", "graph_query_errors", "knn_query_requests", "cache_capacity_reached", "load_success_count", "load_exception_count", "indices_in_cache", "script_compilations", "script_compilation_errors", "script_query_requests", "script_query_errors", "nmslib_initialized", "faiss_initialized", "model_index_status", "indexing_from_model_degraded", "training_requests", "training_errors", "training_memory_usage", "training_memory_usage_percentage"]) +@pattern("^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$") +@documentation("Comma-separated list of stats to retrieve; use `_all` or empty string to retrieve all stats.") +string PathStats + @documentation("The analyzer to use for the query string.") string Analyzer diff --git a/model/knn/stats/operations.smithy b/model/knn/stats/operations.smithy new file mode 100644 index 00000000..6186c941 --- /dev/null +++ b/model/knn/stats/operations.smithy @@ -0,0 +1,56 @@ +// 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/#stats" +) + +@xOperationGroup("knn.stats") +@xVersionAdded("1.0") +@readonly +@suppress(["HttpUriConflict"]) +@http(method: "GET", uri: "/_plugins/_knn/stats") +@documentation("Provides information about the current status of the k-NN plugin.") +operation KNNStats { + input: KNNStats_Input, + output: KNNStats_Output +} + +@xOperationGroup("knn.stats") +@xVersionAdded("1.0") +@readonly +@suppress(["HttpUriConflict"]) +@http(method: "GET", uri: "/_plugins/_knn/{nodeId}/stats") +@documentation("Provides information about the current status of the k-NN plugin.") +operation KNNStats_WithNodeId { + input: KNNStats_WithNodeId_Input, + output: KNNStats_Output +} + +@xOperationGroup("knn.stats") +@xVersionAdded("1.0") +@readonly +@suppress(["HttpUriConflict"]) +@http(method: "GET", uri: "/_plugins/_knn/stats/{stat}") +@documentation("Provides information about the current status of the k-NN plugin.") +operation KNNStats_WithStat { + input: KNNStats_WithStat_Input, + output: KNNStats_Output +} + +@xOperationGroup("knn.stats") +@xVersionAdded("1.0") +@readonly +@suppress(["HttpUriConflict"]) +@http(method: "GET", uri: "/_plugins/_knn/{nodeId}/stats/{stat}") +@documentation("Provides information about the current status of the k-NN plugin.") +operation KNNStats_WithStatNodeId { + input: KNNStats_WithStatNodeId_Input, + output: KNNStats_Output +} diff --git a/model/knn/stats/structures.smithy b/model/knn/stats/structures.smithy new file mode 100644 index 00000000..9de659a3 --- /dev/null +++ b/model/knn/stats/structures.smithy @@ -0,0 +1,46 @@ +// 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 + +@mixin +structure KNNStats_QueryParams { + @httpQuery("timeout") + timeout: Timeout, +} + +@input +structure KNNStats_Input with [KNNStats_QueryParams] { +} + +@input +structure KNNStats_WithNodeId_Input with [KNNStats_QueryParams] { + @required + @httpLabel + nodeId: PathNodeId, +} + +@input +structure KNNStats_WithStat_Input with [KNNStats_QueryParams] { + @required + @httpLabel + stat: PathStat, +} + +@input +structure KNNStats_WithStatNodeId_Input with [KNNStats_QueryParams] { + @required + @httpLabel + nodeId: PathNodeId, + + @required + @httpLabel + stat: PathStats, +} + +// TODO: Fill in Output Structure +structure KNNStats_Output{} diff --git a/model/opensearch.smithy b/model/opensearch.smithy index ccb6b380..b30d5d2b 100644 --- a/model/opensearch.smithy +++ b/model/opensearch.smithy @@ -256,6 +256,10 @@ service OpenSearch { IngestSimulate_Get_WithId, IngestSimulate_Post, IngestSimulate_Post_WithId, + KNNStats, + KNNStats_WithNodeId, + KNNStats_WithStat, + KNNStats_WithStatNodeId, Mget_Get, Mget_Get_WithIndex, Mget_Post,