From bb7393a084f987eeffa3164787864f0925eb87e3 Mon Sep 17 00:00:00 2001 From: delvedor Date: Wed, 3 Nov 2021 13:37:32 +0100 Subject: [PATCH] API generation --- api/api/fleet.js | 6 +++--- api/api/nodes.js | 2 +- api/requestParams.d.ts | 3 ++- docs/reference.asciidoc | 8 ++++++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/api/api/fleet.js b/api/api/fleet.js index bbed83f37..2cd69b92b 100644 --- a/api/api/fleet.js +++ b/api/api/fleet.js @@ -73,10 +73,10 @@ FleetApi.prototype.msearch = function fleetMsearchApi (params, options, callback let path = '' if ((index) != null) { if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_fleet' + '/' + '_msearch' + path = '/' + encodeURIComponent(index) + '/' + '_fleet' + '/' + '_fleet_msearch' } else { if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_fleet' + '/' + '_msearch' + path = '/' + '_fleet' + '/' + '_fleet_msearch' } // build request object @@ -104,7 +104,7 @@ FleetApi.prototype.search = function fleetSearchApi (params, options, callback) let path = '' if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_fleet' + '/' + '_search' + path = '/' + encodeURIComponent(index) + '/' + '_fleet' + '/' + '_fleet_search' // build request object const request = { diff --git a/api/api/nodes.js b/api/api/nodes.js index 39176ec2e..6ba4253f1 100644 --- a/api/api/nodes.js +++ b/api/api/nodes.js @@ -23,7 +23,7 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'interval', 'snapshots', 'threads', 'ignore_idle_threads', 'type', 'timeout', 'flat_settings', 'completion_fields', 'fielddata_fields', 'fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments'] +const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'interval', 'snapshots', 'threads', 'ignore_idle_threads', 'type', 'sort', 'timeout', 'flat_settings', 'completion_fields', 'fielddata_fields', 'fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments'] const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', ignoreIdleThreads: 'ignore_idle_threads', flatSettings: 'flat_settings', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments' } function NodesApi (transport, ConfigurationError) { diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts index 5bb331621..288130acb 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -2066,7 +2066,8 @@ export interface NodesHotThreads extends Generic { snapshots?: number; threads?: number; ignore_idle_threads?: boolean; - type?: 'cpu' | 'wait' | 'block'; + type?: 'cpu' | 'wait' | 'block' | 'mem'; + sort?: 'cpu' | 'total'; timeout?: string; } diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 8c1945f4f..9be6aeecc 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -8520,7 +8520,8 @@ client.nodes.hotThreads({ snapshots: number, threads: number, ignore_idle_threads: boolean, - type: 'cpu' | 'wait' | 'block', + type: 'cpu' | 'wait' | 'block' | 'mem', + sort: 'cpu' | 'total', timeout: string }) ---- @@ -8543,7 +8544,10 @@ link:{ref}/cluster-nodes-hot-threads.html[Documentation] + |`boolean` - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) |`type` -|`'cpu' \| 'wait' \| 'block'` - The type to sample (default: cpu) +|`'cpu' \| 'wait' \| 'block' \| 'mem'` - The type to sample (default: cpu) + +|`sort` +|`'cpu' \| 'total'` - The sort order for 'cpu' type (default: total) |`timeout` |`string` - Explicit operation timeout