From 0d5c7a880fbacad3f62b758913597a8b37121ca8 Mon Sep 17 00:00:00 2001 From: delvedor Date: Thu, 30 Apr 2020 11:28:37 +0200 Subject: [PATCH] API generation --- .../autoscaling.delete_autoscaling_policy.js | 1 + api/api/autoscaling.get_autoscaling_policy.js | 1 + api/api/autoscaling.put_autoscaling_policy.js | 1 + api/api/bulk.js | 2 + ...cluster.delete_voting_config_exclusions.js | 79 ++++++++++++ .../cluster.post_voting_config_exclusions.js | 82 +++++++++++++ api/api/create.js | 2 + api/api/eql.search.js | 2 +- api/api/index.js | 2 + api/api/indices.create.js | 2 + api/api/indices.rollover.js | 2 + api/api/indices.simulate_index_template.js | 85 +++++++++++++ api/api/nodes.hot_threads.js | 9 -- api/api/searchable_snapshots.clear_cache.js | 1 + api/api/searchable_snapshots.mount.js | 1 + .../searchable_snapshots.repository_stats.js | 78 ++++++++++++ api/api/searchable_snapshots.stats.js | 1 + api/api/update.js | 2 + api/index.js | 10 ++ api/requestParams.d.ts | 29 ++++- docs/reference.asciidoc | 114 +++++++++++++++++- index.d.ts | 56 +++++++-- 22 files changed, 541 insertions(+), 21 deletions(-) create mode 100644 api/api/cluster.delete_voting_config_exclusions.js create mode 100644 api/api/cluster.post_voting_config_exclusions.js create mode 100644 api/api/indices.simulate_index_template.js create mode 100644 api/api/searchable_snapshots.repository_stats.js diff --git a/api/api/autoscaling.delete_autoscaling_policy.js b/api/api/autoscaling.delete_autoscaling_policy.js index e074ce8b0..76d09d1d5 100644 --- a/api/api/autoscaling.delete_autoscaling_policy.js +++ b/api/api/autoscaling.delete_autoscaling_policy.js @@ -21,6 +21,7 @@ function buildAutoscalingDeleteAutoscalingPolicy (opts) { /** * Perform a autoscaling.delete_autoscaling_policy request + * Deletes an autoscaling policy. * https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-delete-autoscaling-policy.html */ return function autoscalingDeleteAutoscalingPolicy (params, options, callback) { diff --git a/api/api/autoscaling.get_autoscaling_policy.js b/api/api/autoscaling.get_autoscaling_policy.js index 676fb9da2..0a85e303b 100644 --- a/api/api/autoscaling.get_autoscaling_policy.js +++ b/api/api/autoscaling.get_autoscaling_policy.js @@ -21,6 +21,7 @@ function buildAutoscalingGetAutoscalingPolicy (opts) { /** * Perform a autoscaling.get_autoscaling_policy request + * Retrieves an autoscaling policy. * https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-policy.html */ return function autoscalingGetAutoscalingPolicy (params, options, callback) { diff --git a/api/api/autoscaling.put_autoscaling_policy.js b/api/api/autoscaling.put_autoscaling_policy.js index b7751339e..6a45c7648 100644 --- a/api/api/autoscaling.put_autoscaling_policy.js +++ b/api/api/autoscaling.put_autoscaling_policy.js @@ -21,6 +21,7 @@ function buildAutoscalingPutAutoscalingPolicy (opts) { /** * Perform a autoscaling.put_autoscaling_policy request + * Creates a new autoscaling policy. * https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-put-autoscaling-policy.html */ return function autoscalingPutAutoscalingPolicy (params, options, callback) { diff --git a/api/api/bulk.js b/api/api/bulk.js index 683c50310..bc3dfc366 100644 --- a/api/api/bulk.js +++ b/api/api/bulk.js @@ -23,6 +23,7 @@ function buildBulk (opts) { '_source_includes', '_source_include', 'pipeline', + 'prefer_v2_templates', 'pretty', 'human', 'error_trace', @@ -36,6 +37,7 @@ function buildBulk (opts) { _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', + preferV2Templates: 'prefer_v2_templates', errorTrace: 'error_trace', filterPath: 'filter_path' } diff --git a/api/api/cluster.delete_voting_config_exclusions.js b/api/api/cluster.delete_voting_config_exclusions.js new file mode 100644 index 000000000..fce5bfd28 --- /dev/null +++ b/api/api/cluster.delete_voting_config_exclusions.js @@ -0,0 +1,79 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information + +'use strict' + +/* eslint camelcase: 0 */ +/* eslint no-unused-vars: 0 */ + +function buildClusterDeleteVotingConfigExclusions (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + 'wait_for_removal', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ] + + const snakeCase = { + waitForRemoval: 'wait_for_removal', + errorTrace: 'error_trace', + filterPath: 'filter_path' + } + + /** + * Perform a cluster.delete_voting_config_exclusions request + * Clears cluster voting config exclusions. + * https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html + */ + return function clusterDeleteVotingConfigExclusions (params, options, callback) { + options = options || {} + if (typeof options === 'function') { + callback = options + options = {} + } + if (typeof params === 'function' || params == null) { + callback = params + params = {} + options = {} + } + + // validate headers object + if (options.headers != null && typeof options.headers !== 'object') { + const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) + return handleError(err, callback) + } + + var warnings = [] + var { method, body, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) + + var ignore = options.ignore + if (typeof ignore === 'number') { + options.ignore = [ignore] + } + + var path = '' + + if (method == null) method = 'DELETE' + path = '/' + '_cluster' + '/' + 'voting_config_exclusions' + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + options.warnings = warnings.length === 0 ? null : warnings + return makeRequest(request, options, callback) + } +} + +module.exports = buildClusterDeleteVotingConfigExclusions diff --git a/api/api/cluster.post_voting_config_exclusions.js b/api/api/cluster.post_voting_config_exclusions.js new file mode 100644 index 000000000..14cd90379 --- /dev/null +++ b/api/api/cluster.post_voting_config_exclusions.js @@ -0,0 +1,82 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information + +'use strict' + +/* eslint camelcase: 0 */ +/* eslint no-unused-vars: 0 */ + +function buildClusterPostVotingConfigExclusions (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + 'node_ids', + 'node_names', + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ] + + const snakeCase = { + nodeIds: 'node_ids', + nodeNames: 'node_names', + errorTrace: 'error_trace', + filterPath: 'filter_path' + } + + /** + * Perform a cluster.post_voting_config_exclusions request + * Updates the cluster voting config exclusions by node ids or node names. + * https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html + */ + return function clusterPostVotingConfigExclusions (params, options, callback) { + options = options || {} + if (typeof options === 'function') { + callback = options + options = {} + } + if (typeof params === 'function' || params == null) { + callback = params + params = {} + options = {} + } + + // validate headers object + if (options.headers != null && typeof options.headers !== 'object') { + const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) + return handleError(err, callback) + } + + var warnings = [] + var { method, body, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) + + var ignore = options.ignore + if (typeof ignore === 'number') { + options.ignore = [ignore] + } + + var path = '' + + if (method == null) method = 'POST' + path = '/' + '_cluster' + '/' + 'voting_config_exclusions' + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + options.warnings = warnings.length === 0 ? null : warnings + return makeRequest(request, options, callback) + } +} + +module.exports = buildClusterPostVotingConfigExclusions diff --git a/api/api/create.js b/api/api/create.js index d9bedb3d9..4bbb3d4e7 100644 --- a/api/api/create.js +++ b/api/api/create.js @@ -19,6 +19,7 @@ function buildCreate (opts) { 'version', 'version_type', 'pipeline', + 'prefer_v2_templates', 'pretty', 'human', 'error_trace', @@ -29,6 +30,7 @@ function buildCreate (opts) { const snakeCase = { waitForActiveShards: 'wait_for_active_shards', versionType: 'version_type', + preferV2Templates: 'prefer_v2_templates', errorTrace: 'error_trace', filterPath: 'filter_path' } diff --git a/api/api/eql.search.js b/api/api/eql.search.js index b171517b4..576846fce 100644 --- a/api/api/eql.search.js +++ b/api/api/eql.search.js @@ -22,7 +22,7 @@ function buildEqlSearch (opts) { /** * Perform a eql.search request * Returns results matching a query expressed in Event Query Language (EQL) - * https://www.elastic.co/guide/en/elasticsearch/reference/current/eql.html + * https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html */ return function eqlSearch (params, options, callback) { options = options || {} diff --git a/api/api/index.js b/api/api/index.js index 334e60b1c..b60078aa8 100644 --- a/api/api/index.js +++ b/api/api/index.js @@ -22,6 +22,7 @@ function buildIndex (opts) { 'if_seq_no', 'if_primary_term', 'pipeline', + 'prefer_v2_templates', 'pretty', 'human', 'error_trace', @@ -35,6 +36,7 @@ function buildIndex (opts) { versionType: 'version_type', ifSeqNo: 'if_seq_no', ifPrimaryTerm: 'if_primary_term', + preferV2Templates: 'prefer_v2_templates', errorTrace: 'error_trace', filterPath: 'filter_path' } diff --git a/api/api/indices.create.js b/api/api/indices.create.js index e720bd152..8541a5890 100644 --- a/api/api/indices.create.js +++ b/api/api/indices.create.js @@ -15,6 +15,7 @@ function buildIndicesCreate (opts) { 'wait_for_active_shards', 'timeout', 'master_timeout', + 'prefer_v2_templates', 'pretty', 'human', 'error_trace', @@ -25,6 +26,7 @@ function buildIndicesCreate (opts) { const snakeCase = { waitForActiveShards: 'wait_for_active_shards', masterTimeout: 'master_timeout', + preferV2Templates: 'prefer_v2_templates', errorTrace: 'error_trace', filterPath: 'filter_path' } diff --git a/api/api/indices.rollover.js b/api/api/indices.rollover.js index 5f4d0d281..425713a32 100644 --- a/api/api/indices.rollover.js +++ b/api/api/indices.rollover.js @@ -16,6 +16,7 @@ function buildIndicesRollover (opts) { 'dry_run', 'master_timeout', 'wait_for_active_shards', + 'prefer_v2_templates', 'pretty', 'human', 'error_trace', @@ -27,6 +28,7 @@ function buildIndicesRollover (opts) { dryRun: 'dry_run', masterTimeout: 'master_timeout', waitForActiveShards: 'wait_for_active_shards', + preferV2Templates: 'prefer_v2_templates', errorTrace: 'error_trace', filterPath: 'filter_path' } diff --git a/api/api/indices.simulate_index_template.js b/api/api/indices.simulate_index_template.js new file mode 100644 index 000000000..ae3bab82f --- /dev/null +++ b/api/api/indices.simulate_index_template.js @@ -0,0 +1,85 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information + +'use strict' + +/* eslint camelcase: 0 */ +/* eslint no-unused-vars: 0 */ + +function buildIndicesSimulateIndexTemplate (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + 'master_timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ] + + const snakeCase = { + masterTimeout: 'master_timeout', + errorTrace: 'error_trace', + filterPath: 'filter_path' + } + + /** + * Perform a indices.simulate_index_template request + * Simulate matching the given index name against the index templates in the system + * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html + */ + return function indicesSimulateIndexTemplate (params, options, callback) { + options = options || {} + if (typeof options === 'function') { + callback = options + options = {} + } + if (typeof params === 'function' || params == null) { + callback = params + params = {} + options = {} + } + + // check required parameters + if (params['name'] == null) { + const err = new ConfigurationError('Missing required parameter: name') + return handleError(err, callback) + } + + // validate headers object + if (options.headers != null && typeof options.headers !== 'object') { + const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) + return handleError(err, callback) + } + + var warnings = [] + var { method, body, name, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) + + var ignore = options.ignore + if (typeof ignore === 'number') { + options.ignore = [ignore] + } + + var path = '' + + if (method == null) method = 'POST' + path = '/' + '_index_template' + '/' + '_simulate_index' + '/' + encodeURIComponent(name) + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + options.warnings = warnings.length === 0 ? null : warnings + return makeRequest(request, options, callback) + } +} + +module.exports = buildIndicesSimulateIndexTemplate diff --git a/api/api/nodes.hot_threads.js b/api/api/nodes.hot_threads.js index 6e2a44d4b..82bafc0c2 100644 --- a/api/api/nodes.hot_threads.js +++ b/api/api/nodes.hot_threads.js @@ -68,15 +68,6 @@ function buildNodesHotThreads (opts) { if ((node_id || nodeId) != null) { if (method == null) method = 'GET' path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads' - } else if ((node_id || nodeId) != null) { - if (method == null) method = 'GET' - path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads' - } else if ((node_id || nodeId) != null) { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads' - } else if ((node_id || nodeId) != null) { - if (method == null) method = 'GET' - path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads' } else { if (method == null) method = 'GET' path = '/' + '_nodes' + '/' + 'hot_threads' diff --git a/api/api/searchable_snapshots.clear_cache.js b/api/api/searchable_snapshots.clear_cache.js index 79a5d0712..09cb13bd5 100644 --- a/api/api/searchable_snapshots.clear_cache.js +++ b/api/api/searchable_snapshots.clear_cache.js @@ -27,6 +27,7 @@ function buildSearchableSnapshotsClearCache (opts) { /** * Perform a searchable_snapshots.clear_cache request + * Clear the cache of searchable snapshots. * https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-api-clear-cache.html */ return function searchableSnapshotsClearCache (params, options, callback) { diff --git a/api/api/searchable_snapshots.mount.js b/api/api/searchable_snapshots.mount.js index 6c704c528..2a60bae63 100644 --- a/api/api/searchable_snapshots.mount.js +++ b/api/api/searchable_snapshots.mount.js @@ -23,6 +23,7 @@ function buildSearchableSnapshotsMount (opts) { /** * Perform a searchable_snapshots.mount request + * Mount a snapshot as a searchable index. * https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-api-mount-snapshot.html */ return function searchableSnapshotsMount (params, options, callback) { diff --git a/api/api/searchable_snapshots.repository_stats.js b/api/api/searchable_snapshots.repository_stats.js new file mode 100644 index 000000000..d91653f43 --- /dev/null +++ b/api/api/searchable_snapshots.repository_stats.js @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information + +'use strict' + +/* eslint camelcase: 0 */ +/* eslint no-unused-vars: 0 */ + +function buildSearchableSnapshotsRepositoryStats (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + + ] + + const snakeCase = { + + } + + /** + * Perform a searchable_snapshots.repository_stats request + * Retrieve usage statistics about a snapshot repository. + * https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-repository-stats.html + */ + return function searchableSnapshotsRepositoryStats (params, options, callback) { + options = options || {} + if (typeof options === 'function') { + callback = options + options = {} + } + if (typeof params === 'function' || params == null) { + callback = params + params = {} + options = {} + } + + // check required parameters + if (params['repository'] == null) { + const err = new ConfigurationError('Missing required parameter: repository') + return handleError(err, callback) + } + + // validate headers object + if (options.headers != null && typeof options.headers !== 'object') { + const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) + return handleError(err, callback) + } + + var warnings = [] + var { method, body, repository, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) + + var ignore = options.ignore + if (typeof ignore === 'number') { + options.ignore = [ignore] + } + + var path = '' + + if (method == null) method = 'GET' + path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_stats' + + // build request object + const request = { + method, + path, + body: null, + querystring + } + + options.warnings = warnings.length === 0 ? null : warnings + return makeRequest(request, options, callback) + } +} + +module.exports = buildSearchableSnapshotsRepositoryStats diff --git a/api/api/searchable_snapshots.stats.js b/api/api/searchable_snapshots.stats.js index a1a3d6fba..e295866e2 100644 --- a/api/api/searchable_snapshots.stats.js +++ b/api/api/searchable_snapshots.stats.js @@ -21,6 +21,7 @@ function buildSearchableSnapshotsStats (opts) { /** * Perform a searchable_snapshots.stats request + * Retrieve various statistics about searchable snapshots. * https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-api-stats.html */ return function searchableSnapshotsStats (params, options, callback) { diff --git a/api/api/update.js b/api/api/update.js index bd5744bba..c74afb62d 100644 --- a/api/api/update.js +++ b/api/api/update.js @@ -25,6 +25,7 @@ function buildUpdate (opts) { 'timeout', 'if_seq_no', 'if_primary_term', + 'prefer_v2_templates', 'pretty', 'human', 'error_trace', @@ -41,6 +42,7 @@ function buildUpdate (opts) { retryOnConflict: 'retry_on_conflict', ifSeqNo: 'if_seq_no', ifPrimaryTerm: 'if_primary_term', + preferV2Templates: 'prefer_v2_templates', errorTrace: 'error_trace', filterPath: 'filter_path' } diff --git a/api/index.js b/api/index.js index fd75aa869..6bc38203d 100644 --- a/api/index.js +++ b/api/index.js @@ -102,6 +102,8 @@ function ESAPI (opts) { allocationExplain: lazyLoad('cluster.allocation_explain', opts), delete_component_template: lazyLoad('cluster.delete_component_template', opts), deleteComponentTemplate: lazyLoad('cluster.delete_component_template', opts), + delete_voting_config_exclusions: lazyLoad('cluster.delete_voting_config_exclusions', opts), + deleteVotingConfigExclusions: lazyLoad('cluster.delete_voting_config_exclusions', opts), exists_component_template: lazyLoad('cluster.exists_component_template', opts), existsComponentTemplate: lazyLoad('cluster.exists_component_template', opts), get_component_template: lazyLoad('cluster.get_component_template', opts), @@ -111,6 +113,8 @@ function ESAPI (opts) { health: lazyLoad('cluster.health', opts), pending_tasks: lazyLoad('cluster.pending_tasks', opts), pendingTasks: lazyLoad('cluster.pending_tasks', opts), + post_voting_config_exclusions: lazyLoad('cluster.post_voting_config_exclusions', opts), + postVotingConfigExclusions: lazyLoad('cluster.post_voting_config_exclusions', opts), put_component_template: lazyLoad('cluster.put_component_template', opts), putComponentTemplate: lazyLoad('cluster.put_component_template', opts), put_settings: lazyLoad('cluster.put_settings', opts), @@ -285,6 +289,8 @@ function ESAPI (opts) { shard_stores: lazyLoad('indices.shard_stores', opts), shardStores: lazyLoad('indices.shard_stores', opts), shrink: lazyLoad('indices.shrink', opts), + simulate_index_template: lazyLoad('indices.simulate_index_template', opts), + simulateIndexTemplate: lazyLoad('indices.simulate_index_template', opts), split: lazyLoad('indices.split', opts), stats: lazyLoad('indices.stats', opts), unfreeze: lazyLoad('indices.unfreeze', opts), @@ -496,12 +502,16 @@ function ESAPI (opts) { clear_cache: lazyLoad('searchable_snapshots.clear_cache', opts), clearCache: lazyLoad('searchable_snapshots.clear_cache', opts), mount: lazyLoad('searchable_snapshots.mount', opts), + repository_stats: lazyLoad('searchable_snapshots.repository_stats', opts), + repositoryStats: lazyLoad('searchable_snapshots.repository_stats', opts), stats: lazyLoad('searchable_snapshots.stats', opts) }, searchableSnapshots: { clear_cache: lazyLoad('searchable_snapshots.clear_cache', opts), clearCache: lazyLoad('searchable_snapshots.clear_cache', opts), mount: lazyLoad('searchable_snapshots.mount', opts), + repository_stats: lazyLoad('searchable_snapshots.repository_stats', opts), + repositoryStats: lazyLoad('searchable_snapshots.repository_stats', opts), stats: lazyLoad('searchable_snapshots.stats', opts) }, security: { diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts index 85e6a444d..3f8adb1b1 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -27,6 +27,7 @@ export interface Bulk extends Generic { _source_excludes?: string | string[]; _source_includes?: string | string[]; pipeline?: string; + prefer_v2_templates?: boolean; body: T; } @@ -268,6 +269,10 @@ export interface ClusterDeleteComponentTemplate extends Generic { master_timeout?: string; } +export interface ClusterDeleteVotingConfigExclusions extends Generic { + wait_for_removal?: boolean; +} + export interface ClusterExistsComponentTemplate extends Generic { name: string; master_timeout?: string; @@ -307,6 +312,12 @@ export interface ClusterPendingTasks extends Generic { master_timeout?: string; } +export interface ClusterPostVotingConfigExclusions extends Generic { + node_ids?: string; + node_names?: string; + timeout?: string; +} + export interface ClusterPutComponentTemplate extends Generic { name: string; create?: boolean; @@ -384,6 +395,7 @@ export interface Create extends Generic { version?: number; version_type?: 'internal' | 'external' | 'external_gte'; pipeline?: string; + prefer_v2_templates?: boolean; body: T; } @@ -571,6 +583,7 @@ export interface Index extends Generic { if_seq_no?: number; if_primary_term?: number; pipeline?: string; + prefer_v2_templates?: boolean; body: T; } @@ -614,6 +627,7 @@ export interface IndicesCreate extends Generic { wait_for_active_shards?: string; timeout?: string; master_timeout?: string; + prefer_v2_templates?: boolean; body?: T; } @@ -867,6 +881,7 @@ export interface IndicesRollover extends Generic { dry_run?: boolean; master_timeout?: string; wait_for_active_shards?: string; + prefer_v2_templates?: boolean; body?: T; } @@ -895,6 +910,12 @@ export interface IndicesShrink extends Generic { body?: T; } +export interface IndicesSimulateIndexTemplate extends Generic { + name: string; + master_timeout?: string; + body?: T; +} + export interface IndicesSplit extends Generic { index: string; target: string; @@ -1053,9 +1074,10 @@ export interface NodesInfo extends Generic { timeout?: string; } -export interface NodesReloadSecureSettings extends Generic { +export interface NodesReloadSecureSettings extends Generic { node_id?: string | string[]; timeout?: string; + body?: T; } export interface NodesStats extends Generic { @@ -1335,6 +1357,7 @@ export interface Update extends Generic { timeout?: string; if_seq_no?: number; if_primary_term?: number; + prefer_v2_templates?: boolean; body: T; } @@ -2209,6 +2232,10 @@ export interface SearchableSnapshotsMount extends Generic { body: T; } +export interface SearchableSnapshotsRepositoryStats extends Generic { + repository: string; +} + export interface SearchableSnapshotsStats extends Generic { index?: string | string[]; } diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index ff225854f..5d76ef6ec 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -110,6 +110,7 @@ client.bulk({ _source_excludes: string | string[], _source_includes: string | string[], pipeline: string, + prefer_v2_templates: boolean, body: object }) ---- @@ -147,6 +148,9 @@ link:{ref}/docs-bulk.html[Documentation] + |`pipeline` |`string` - The pipeline id to preprocess incoming documents with +|`prefer_v2_templates` or `preferV2Templates` +|`boolean` - favor V2 templates instead of V1 templates during automatic index creation + |`body` |`object` - The operation definition and data (action-data pairs), separated by newlines @@ -1109,6 +1113,23 @@ link:{ref}/indices-component-templates.html[Documentation] + |=== +=== cluster.deleteVotingConfigExclusions + +[source,ts] +---- +client.cluster.deleteVotingConfigExclusions({ + wait_for_removal: boolean +}) +---- +link:{ref}/voting-config-exclusions.html[Documentation] + +[cols=2*] +|=== +|`wait_for_removal` or `waitForRemoval` +|`boolean` - Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. + +_Default:_ `true` + +|=== + === cluster.existsComponentTemplate [source,ts] @@ -1267,6 +1288,31 @@ link:{ref}/cluster-pending.html[Documentation] + |=== +=== cluster.postVotingConfigExclusions + +[source,ts] +---- +client.cluster.postVotingConfigExclusions({ + node_ids: string, + node_names: string, + timeout: string +}) +---- +link:{ref}/voting-config-exclusions.html[Documentation] + +[cols=2*] +|=== +|`node_ids` or `nodeIds` +|`string` - A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_names. + +|`node_names` or `nodeNames` +|`string` - A comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_ids. + +|`timeout` +|`string` - Explicit operation timeout + +_Default:_ `30s` + +|=== + === cluster.putComponentTemplate [source,ts] @@ -1546,6 +1592,7 @@ client.create({ version: number, version_type: 'internal' | 'external' | 'external_gte', pipeline: string, + prefer_v2_templates: boolean, body: object }) ---- @@ -1584,6 +1631,9 @@ WARNING: This parameter has been deprecated. |`pipeline` |`string` - The pipeline id to preprocess incoming documents with +|`prefer_v2_templates` or `preferV2Templates` +|`boolean` - favor V2 templates instead of V1 templates during automatic index creation + |`body` |`object` - The document @@ -2251,6 +2301,7 @@ client.index({ if_seq_no: number, if_primary_term: number, pipeline: string, + prefer_v2_templates: boolean, body: object }) ---- @@ -2293,6 +2344,9 @@ link:{ref}/docs-index_.html[Documentation] + |`pipeline` |`string` - The pipeline id to preprocess incoming documents with +|`prefer_v2_templates` or `preferV2Templates` +|`boolean` - favor V2 templates instead of V1 templates during automatic index creation + |`body` |`object` - The document @@ -2449,6 +2503,7 @@ client.indices.create({ wait_for_active_shards: string, timeout: string, master_timeout: string, + prefer_v2_templates: boolean, body: object }) ---- @@ -2467,6 +2522,9 @@ link:{ref}/indices-create-index.html[Documentation] + |`master_timeout` or `masterTimeout` |`string` - Specify timeout for connection to master +|`prefer_v2_templates` or `preferV2Templates` +|`boolean` - favor V2 templates instead of V1 templates during index creation + |`body` |`object` - The configuration for the index (`settings` and `mappings`) @@ -3471,6 +3529,7 @@ client.indices.rollover({ dry_run: boolean, master_timeout: string, wait_for_active_shards: string, + prefer_v2_templates: boolean, body: object }) ---- @@ -3495,6 +3554,9 @@ link:{ref}/indices-rollover-index.html[Documentation] + |`wait_for_active_shards` or `waitForActiveShards` |`string` - Set the number of active shards to wait for on the newly created rollover index before the operation returns. +|`prefer_v2_templates` or `preferV2Templates` +|`boolean` - favor V2 templates instead of V1 templates during automatic index creation + |`body` |`object` - The conditions that needs to be met for executing rollover @@ -3602,6 +3664,30 @@ link:{ref}/indices-shrink-index.html[Documentation] + |=== +=== indices.simulateIndexTemplate + +[source,ts] +---- +client.indices.simulateIndexTemplate({ + name: string, + master_timeout: string, + body: object +}) +---- +link:{ref}/indices-templates.html[Documentation] + +[cols=2*] +|=== +|`name` +|`string` - The name of the index (it must be a concrete index name) + +|`master_timeout` or `masterTimeout` +|`string` - Specify timeout for connection to master + +|`body` +|`object` - New index template definition, which will be included in the simulation, as if it already exists in the system + +|=== + === indices.split [source,ts] @@ -4242,7 +4328,8 @@ link:{ref}/cluster-nodes-info.html[Documentation] + ---- client.nodes.reloadSecureSettings({ node_id: string | string[], - timeout: string + timeout: string, + body: object }) ---- link:{ref}/secure-settings.html#reloadable-secure-settings[Documentation] + @@ -4254,6 +4341,9 @@ link:{ref}/secure-settings.html#reloadable-secure-settings[Documentation] + |`timeout` |`string` - Explicit operation timeout +|`body` +|`object` - An object containing the password for the elasticsearch keystore + |=== === nodes.stats @@ -5330,6 +5420,7 @@ client.update({ timeout: string, if_seq_no: number, if_primary_term: number, + prefer_v2_templates: boolean, body: object }) ---- @@ -5381,6 +5472,9 @@ WARNING: This parameter has been deprecated. |`if_primary_term` or `ifPrimaryTerm` |`number` - only perform the update operation if the last operation that has changed the document has the specified primary term +|`prefer_v2_templates` or `preferV2Templates` +|`boolean` - favor V2 templates instead of V1 templates during automatic index creation + |`body` |`object` - The request definition requires either `script` or partial `doc` @@ -6618,7 +6712,7 @@ client.eql.search({ body: object }) ---- -link:{ref}/eql.html[Documentation] + +link:{ref}/eql-search-api.html[Documentation] + [cols=2*] |=== |`index` @@ -8862,6 +8956,22 @@ link:{ref}/searchable-snapshots-api-mount-snapshot.html[Documentation] + |=== +=== searchableSnapshots.repositoryStats +*Stability:* experimental +[source,ts] +---- +client.searchableSnapshots.repositoryStats({ + repository: string +}) +---- +link:{ref}/searchable-snapshots-repository-stats.html[Documentation] + +[cols=2*] +|=== +|`repository` +|`string` - The repository for which to get the stats for + +|=== + === searchableSnapshots.stats *Stability:* experimental [source,ts] diff --git a/index.d.ts b/index.d.ts index e3eecf68e..cb48b1c44 100644 --- a/index.d.ts +++ b/index.d.ts @@ -423,6 +423,14 @@ declare class Client extends EventEmitter { deleteComponentTemplate, TContext = unknown>(callback: callbackFn): TransportRequestCallback deleteComponentTemplate, TContext = unknown>(params: RequestParams.ClusterDeleteComponentTemplate, callback: callbackFn): TransportRequestCallback deleteComponentTemplate, TContext = unknown>(params: RequestParams.ClusterDeleteComponentTemplate, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + delete_voting_config_exclusions, TContext = unknown>(params?: RequestParams.ClusterDeleteVotingConfigExclusions, options?: TransportRequestOptions): TransportRequestPromise> + delete_voting_config_exclusions, TContext = unknown>(callback: callbackFn): TransportRequestCallback + delete_voting_config_exclusions, TContext = unknown>(params: RequestParams.ClusterDeleteVotingConfigExclusions, callback: callbackFn): TransportRequestCallback + delete_voting_config_exclusions, TContext = unknown>(params: RequestParams.ClusterDeleteVotingConfigExclusions, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + deleteVotingConfigExclusions, TContext = unknown>(params?: RequestParams.ClusterDeleteVotingConfigExclusions, options?: TransportRequestOptions): TransportRequestPromise> + deleteVotingConfigExclusions, TContext = unknown>(callback: callbackFn): TransportRequestCallback + deleteVotingConfigExclusions, TContext = unknown>(params: RequestParams.ClusterDeleteVotingConfigExclusions, callback: callbackFn): TransportRequestCallback + deleteVotingConfigExclusions, TContext = unknown>(params: RequestParams.ClusterDeleteVotingConfigExclusions, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback exists_component_template, TContext = unknown>(params?: RequestParams.ClusterExistsComponentTemplate, options?: TransportRequestOptions): TransportRequestPromise> exists_component_template, TContext = unknown>(callback: callbackFn): TransportRequestCallback exists_component_template, TContext = unknown>(params: RequestParams.ClusterExistsComponentTemplate, callback: callbackFn): TransportRequestCallback @@ -459,6 +467,14 @@ declare class Client extends EventEmitter { pendingTasks, TContext = unknown>(callback: callbackFn): TransportRequestCallback pendingTasks, TContext = unknown>(params: RequestParams.ClusterPendingTasks, callback: callbackFn): TransportRequestCallback pendingTasks, TContext = unknown>(params: RequestParams.ClusterPendingTasks, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + post_voting_config_exclusions, TContext = unknown>(params?: RequestParams.ClusterPostVotingConfigExclusions, options?: TransportRequestOptions): TransportRequestPromise> + post_voting_config_exclusions, TContext = unknown>(callback: callbackFn): TransportRequestCallback + post_voting_config_exclusions, TContext = unknown>(params: RequestParams.ClusterPostVotingConfigExclusions, callback: callbackFn): TransportRequestCallback + post_voting_config_exclusions, TContext = unknown>(params: RequestParams.ClusterPostVotingConfigExclusions, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + postVotingConfigExclusions, TContext = unknown>(params?: RequestParams.ClusterPostVotingConfigExclusions, options?: TransportRequestOptions): TransportRequestPromise> + postVotingConfigExclusions, TContext = unknown>(callback: callbackFn): TransportRequestCallback + postVotingConfigExclusions, TContext = unknown>(params: RequestParams.ClusterPostVotingConfigExclusions, callback: callbackFn): TransportRequestCallback + postVotingConfigExclusions, TContext = unknown>(params: RequestParams.ClusterPostVotingConfigExclusions, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback put_component_template, TRequestBody extends RequestBody = Record, TContext = unknown>(params?: RequestParams.ClusterPutComponentTemplate, options?: TransportRequestOptions): TransportRequestPromise> put_component_template, TRequestBody extends RequestBody = Record, TContext = unknown>(callback: callbackFn): TransportRequestCallback put_component_template, TRequestBody extends RequestBody = Record, TContext = unknown>(params: RequestParams.ClusterPutComponentTemplate, callback: callbackFn): TransportRequestCallback @@ -1113,6 +1129,14 @@ declare class Client extends EventEmitter { shrink, TRequestBody extends RequestBody = Record, TContext = unknown>(callback: callbackFn): TransportRequestCallback shrink, TRequestBody extends RequestBody = Record, TContext = unknown>(params: RequestParams.IndicesShrink, callback: callbackFn): TransportRequestCallback shrink, TRequestBody extends RequestBody = Record, TContext = unknown>(params: RequestParams.IndicesShrink, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + simulate_index_template, TRequestBody extends RequestBody = Record, TContext = unknown>(params?: RequestParams.IndicesSimulateIndexTemplate, options?: TransportRequestOptions): TransportRequestPromise> + simulate_index_template, TRequestBody extends RequestBody = Record, TContext = unknown>(callback: callbackFn): TransportRequestCallback + simulate_index_template, TRequestBody extends RequestBody = Record, TContext = unknown>(params: RequestParams.IndicesSimulateIndexTemplate, callback: callbackFn): TransportRequestCallback + simulate_index_template, TRequestBody extends RequestBody = Record, TContext = unknown>(params: RequestParams.IndicesSimulateIndexTemplate, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + simulateIndexTemplate, TRequestBody extends RequestBody = Record, TContext = unknown>(params?: RequestParams.IndicesSimulateIndexTemplate, options?: TransportRequestOptions): TransportRequestPromise> + simulateIndexTemplate, TRequestBody extends RequestBody = Record, TContext = unknown>(callback: callbackFn): TransportRequestCallback + simulateIndexTemplate, TRequestBody extends RequestBody = Record, TContext = unknown>(params: RequestParams.IndicesSimulateIndexTemplate, callback: callbackFn): TransportRequestCallback + simulateIndexTemplate, TRequestBody extends RequestBody = Record, TContext = unknown>(params: RequestParams.IndicesSimulateIndexTemplate, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback split, TRequestBody extends RequestBody = Record, TContext = unknown>(params?: RequestParams.IndicesSplit, options?: TransportRequestOptions): TransportRequestPromise> split, TRequestBody extends RequestBody = Record, TContext = unknown>(callback: callbackFn): TransportRequestCallback split, TRequestBody extends RequestBody = Record, TContext = unknown>(params: RequestParams.IndicesSplit, callback: callbackFn): TransportRequestCallback @@ -1741,14 +1765,14 @@ declare class Client extends EventEmitter { info, TContext = unknown>(callback: callbackFn): TransportRequestCallback info, TContext = unknown>(params: RequestParams.NodesInfo, callback: callbackFn): TransportRequestCallback info, TContext = unknown>(params: RequestParams.NodesInfo, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - reload_secure_settings, TContext = unknown>(params?: RequestParams.NodesReloadSecureSettings, options?: TransportRequestOptions): TransportRequestPromise> - reload_secure_settings, TContext = unknown>(callback: callbackFn): TransportRequestCallback - reload_secure_settings, TContext = unknown>(params: RequestParams.NodesReloadSecureSettings, callback: callbackFn): TransportRequestCallback - reload_secure_settings, TContext = unknown>(params: RequestParams.NodesReloadSecureSettings, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - reloadSecureSettings, TContext = unknown>(params?: RequestParams.NodesReloadSecureSettings, options?: TransportRequestOptions): TransportRequestPromise> - reloadSecureSettings, TContext = unknown>(callback: callbackFn): TransportRequestCallback - reloadSecureSettings, TContext = unknown>(params: RequestParams.NodesReloadSecureSettings, callback: callbackFn): TransportRequestCallback - reloadSecureSettings, TContext = unknown>(params: RequestParams.NodesReloadSecureSettings, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + reload_secure_settings, TRequestBody extends RequestBody = Record, TContext = unknown>(params?: RequestParams.NodesReloadSecureSettings, options?: TransportRequestOptions): TransportRequestPromise> + reload_secure_settings, TRequestBody extends RequestBody = Record, TContext = unknown>(callback: callbackFn): TransportRequestCallback + reload_secure_settings, TRequestBody extends RequestBody = Record, TContext = unknown>(params: RequestParams.NodesReloadSecureSettings, callback: callbackFn): TransportRequestCallback + reload_secure_settings, TRequestBody extends RequestBody = Record, TContext = unknown>(params: RequestParams.NodesReloadSecureSettings, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + reloadSecureSettings, TRequestBody extends RequestBody = Record, TContext = unknown>(params?: RequestParams.NodesReloadSecureSettings, options?: TransportRequestOptions): TransportRequestPromise> + reloadSecureSettings, TRequestBody extends RequestBody = Record, TContext = unknown>(callback: callbackFn): TransportRequestCallback + reloadSecureSettings, TRequestBody extends RequestBody = Record, TContext = unknown>(params: RequestParams.NodesReloadSecureSettings, callback: callbackFn): TransportRequestCallback + reloadSecureSettings, TRequestBody extends RequestBody = Record, TContext = unknown>(params: RequestParams.NodesReloadSecureSettings, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback stats, TContext = unknown>(params?: RequestParams.NodesStats, options?: TransportRequestOptions): TransportRequestPromise> stats, TContext = unknown>(callback: callbackFn): TransportRequestCallback stats, TContext = unknown>(params: RequestParams.NodesStats, callback: callbackFn): TransportRequestCallback @@ -1909,6 +1933,14 @@ declare class Client extends EventEmitter { mount, TRequestBody extends RequestBody = Record, TContext = unknown>(callback: callbackFn): TransportRequestCallback mount, TRequestBody extends RequestBody = Record, TContext = unknown>(params: RequestParams.SearchableSnapshotsMount, callback: callbackFn): TransportRequestCallback mount, TRequestBody extends RequestBody = Record, TContext = unknown>(params: RequestParams.SearchableSnapshotsMount, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + repository_stats, TContext = unknown>(params?: RequestParams.SearchableSnapshotsRepositoryStats, options?: TransportRequestOptions): TransportRequestPromise> + repository_stats, TContext = unknown>(callback: callbackFn): TransportRequestCallback + repository_stats, TContext = unknown>(params: RequestParams.SearchableSnapshotsRepositoryStats, callback: callbackFn): TransportRequestCallback + repository_stats, TContext = unknown>(params: RequestParams.SearchableSnapshotsRepositoryStats, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + repositoryStats, TContext = unknown>(params?: RequestParams.SearchableSnapshotsRepositoryStats, options?: TransportRequestOptions): TransportRequestPromise> + repositoryStats, TContext = unknown>(callback: callbackFn): TransportRequestCallback + repositoryStats, TContext = unknown>(params: RequestParams.SearchableSnapshotsRepositoryStats, callback: callbackFn): TransportRequestCallback + repositoryStats, TContext = unknown>(params: RequestParams.SearchableSnapshotsRepositoryStats, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback stats, TContext = unknown>(params?: RequestParams.SearchableSnapshotsStats, options?: TransportRequestOptions): TransportRequestPromise> stats, TContext = unknown>(callback: callbackFn): TransportRequestCallback stats, TContext = unknown>(params: RequestParams.SearchableSnapshotsStats, callback: callbackFn): TransportRequestCallback @@ -1927,6 +1959,14 @@ declare class Client extends EventEmitter { mount, TRequestBody extends RequestBody = Record, TContext = unknown>(callback: callbackFn): TransportRequestCallback mount, TRequestBody extends RequestBody = Record, TContext = unknown>(params: RequestParams.SearchableSnapshotsMount, callback: callbackFn): TransportRequestCallback mount, TRequestBody extends RequestBody = Record, TContext = unknown>(params: RequestParams.SearchableSnapshotsMount, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + repository_stats, TContext = unknown>(params?: RequestParams.SearchableSnapshotsRepositoryStats, options?: TransportRequestOptions): TransportRequestPromise> + repository_stats, TContext = unknown>(callback: callbackFn): TransportRequestCallback + repository_stats, TContext = unknown>(params: RequestParams.SearchableSnapshotsRepositoryStats, callback: callbackFn): TransportRequestCallback + repository_stats, TContext = unknown>(params: RequestParams.SearchableSnapshotsRepositoryStats, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + repositoryStats, TContext = unknown>(params?: RequestParams.SearchableSnapshotsRepositoryStats, options?: TransportRequestOptions): TransportRequestPromise> + repositoryStats, TContext = unknown>(callback: callbackFn): TransportRequestCallback + repositoryStats, TContext = unknown>(params: RequestParams.SearchableSnapshotsRepositoryStats, callback: callbackFn): TransportRequestCallback + repositoryStats, TContext = unknown>(params: RequestParams.SearchableSnapshotsRepositoryStats, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback stats, TContext = unknown>(params?: RequestParams.SearchableSnapshotsStats, options?: TransportRequestOptions): TransportRequestPromise> stats, TContext = unknown>(callback: callbackFn): TransportRequestCallback stats, TContext = unknown>(params: RequestParams.SearchableSnapshotsStats, callback: callbackFn): TransportRequestCallback