diff --git a/specification/_types/common.ts b/specification/_types/common.ts index ea9b806929..74b38c6b44 100644 --- a/specification/_types/common.ts +++ b/specification/_types/common.ts @@ -67,6 +67,7 @@ export type ProjectRouting = string export type Routing = string export type LongId = string +//TODO encode metrics as API specific enums export type ClusterAlias = string @@ -253,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 152399cad6..c3bb4642e4 100644 --- a/specification/nodes/stats/NodesStatsRequest.ts +++ b/specification/nodes/stats/NodesStatsRequest.ts @@ -18,6 +18,7 @@ */ import { RequestBase } from '@_types/Base' +import {Fields, IndexMetrics, Metrics, NodeIds, NodeStatsLevel} from '@_types/common' import { CommonStatsFlags, Fields, @@ -70,7 +71,7 @@ export interface Request extends RequestBase { /*+ Limits the information returned to the specific metrics. */ metric?: NodeStatsMetrics /** 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?: CommonStatsFlags + index_metric?: IndexMetrics } query_parameters: { /** Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics. */