From 9efd4fc86113e9346c68b5f99ae1333de7dd5373 Mon Sep 17 00:00:00 2001 From: ketkee-aryamane Date: Fri, 7 Nov 2025 14:09:34 +0100 Subject: [PATCH] add enum values for Metric and IndexMetrics path params --- specification/_types/common.ts | 44 ++++++++++++++++++- .../nodes/stats/NodesStatsRequest.ts | 4 +- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/specification/_types/common.ts b/specification/_types/common.ts index 91155570d1..e81cdfaa09 100644 --- a/specification/_types/common.ts +++ b/specification/_types/common.ts @@ -68,8 +68,6 @@ export type ProjectRouting = string export type Routing = string export type LongId = string //TODO encode metrics as API specific enums -export type IndexMetrics = string -export type Metrics = string | string[] export type ClusterAlias = string @@ -256,6 +254,48 @@ export enum NodeStatsLevel { shards } +export enum Metrics { + adaptive_selection, + allocations, + breaker, + discovery, + fs, + http, + indexing_pressure, + indices, + ingest, + jvm, + os, + process, + repositories, + thread_pool, + transport +} + +export enum IndexMetrics{ + bulk, + completion, + docs, + fielddata, + flush, + get, + indexing, + mappings, + merge, + query_cache, + recovery, + refresh, + request_cache, + search, + segments, + shard_stats, + store, + translog, + warmer, + dense_vector, + sparse_vector +} + export enum OpType { /** * Overwrite any documents that already exist. diff --git a/specification/nodes/stats/NodesStatsRequest.ts b/specification/nodes/stats/NodesStatsRequest.ts index 5b1ec00b42..82a635b4ab 100644 --- a/specification/nodes/stats/NodesStatsRequest.ts +++ b/specification/nodes/stats/NodesStatsRequest.ts @@ -18,7 +18,7 @@ */ import { RequestBase } from '@_types/Base' -import { Fields, Metrics, NodeIds, NodeStatsLevel } from '@_types/common' +import {Fields, IndexMetrics, Metrics, NodeIds, NodeStatsLevel} from '@_types/common' import { Duration } from '@_types/Time' /** @@ -65,7 +65,7 @@ export interface Request extends RequestBase { /*+ Limits the information returned to the specific metrics. */ metric?: Metrics /** Limit the information returned for indices metric to the specific index metrics. It can be used only if indices (or all) metric is specified.*/ - index_metric?: Metrics + index_metric?: IndexMetrics } query_parameters: { /** Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics. */