Skip to content

Commit 9efd4fc

Browse files
add enum values for Metric and IndexMetrics path params
1 parent 06e395a commit 9efd4fc

File tree

2 files changed

+44
-4
lines changed

2 files changed

+44
-4
lines changed

specification/_types/common.ts

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ export type ProjectRouting = string
6868
export type Routing = string
6969
export type LongId = string
7070
//TODO encode metrics as API specific enums
71-
export type IndexMetrics = string
72-
export type Metrics = string | string[]
7371

7472
export type ClusterAlias = string
7573

@@ -256,6 +254,48 @@ export enum NodeStatsLevel {
256254
shards
257255
}
258256

257+
export enum Metrics {
258+
adaptive_selection,
259+
allocations,
260+
breaker,
261+
discovery,
262+
fs,
263+
http,
264+
indexing_pressure,
265+
indices,
266+
ingest,
267+
jvm,
268+
os,
269+
process,
270+
repositories,
271+
thread_pool,
272+
transport
273+
}
274+
275+
export enum IndexMetrics{
276+
bulk,
277+
completion,
278+
docs,
279+
fielddata,
280+
flush,
281+
get,
282+
indexing,
283+
mappings,
284+
merge,
285+
query_cache,
286+
recovery,
287+
refresh,
288+
request_cache,
289+
search,
290+
segments,
291+
shard_stats,
292+
store,
293+
translog,
294+
warmer,
295+
dense_vector,
296+
sparse_vector
297+
}
298+
259299
export enum OpType {
260300
/**
261301
* Overwrite any documents that already exist.

specification/nodes/stats/NodesStatsRequest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
import { RequestBase } from '@_types/Base'
21-
import { Fields, Metrics, NodeIds, NodeStatsLevel } from '@_types/common'
21+
import {Fields, IndexMetrics, Metrics, NodeIds, NodeStatsLevel} from '@_types/common'
2222
import { Duration } from '@_types/Time'
2323

2424
/**
@@ -65,7 +65,7 @@ export interface Request extends RequestBase {
6565
/*+ Limits the information returned to the specific metrics. */
6666
metric?: Metrics
6767
/** Limit the information returned for indices metric to the specific index metrics. It can be used only if indices (or all) metric is specified.*/
68-
index_metric?: Metrics
68+
index_metric?: IndexMetrics
6969
}
7070
query_parameters: {
7171
/** Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics. */

0 commit comments

Comments
 (0)