From 9b6d2fc329173712871d5de915295ff8db53a5cd Mon Sep 17 00:00:00 2001 From: delvedor Date: Mon, 2 Dec 2019 09:09:20 +0100 Subject: [PATCH 1/8] API generation --- api/api/bulk.js | 4 - api/api/cat.aliases.js | 2 - api/api/cat.count.js | 3 - api/api/cat.fielddata.js | 3 - api/api/cat.health.js | 4 +- api/api/cat.indices.js | 1 + api/api/cat.nodes.js | 2 + api/api/cat.pending_tasks.js | 1 + api/api/cat.recovery.js | 7 +- api/api/cat.shards.js | 1 + api/api/cat.snapshots.js | 1 + api/api/cat.tasks.js | 1 + api/api/ccr.pause_auto_follow_pattern.js | 77 +++ api/api/ccr.resume_auto_follow_pattern.js | 77 +++ ..._transform_deprecated.delete_transform.js} | 8 +- ...rame_transform_deprecated.get_transform.js | 73 +++ ...ansform_deprecated.get_transform_stats.js} | 8 +- ..._transform_deprecated.preview_transform.js | 74 +++ ...ame_transform_deprecated.put_transform.js} | 8 +- ...e_transform_deprecated.start_transform.js} | 8 +- ...me_transform_deprecated.stop_transform.js} | 8 +- ..._transform_deprecated.update_transform.js} | 8 +- api/api/delete_by_query.js | 4 - api/api/enrich.delete_policy.js | 76 +++ api/api/enrich.execute_policy.js | 76 +++ api/api/enrich.get_policy.js | 75 +++ api/api/enrich.put_policy.js | 80 +++ api/api/enrich.stats.js | 70 +++ api/api/exists.js | 4 - api/api/exists_source.js | 4 - api/api/explain.js | 4 - api/api/get.js | 4 - api/api/get_source.js | 4 - api/api/index.js | 4 +- api/api/mget.js | 4 - api/api/search.js | 4 - api/api/security.get_api_key.js | 4 +- api/api/slm.execute_retention.js | 71 +++ api/api/slm.get_stats.js | 71 +++ api/api/transform.delete_transform.js | 77 +++ ...ransform.js => transform.get_transform.js} | 12 +- api/api/transform.get_transform_stats.js | 79 +++ ...form.js => transform.preview_transform.js} | 10 +- api/api/transform.put_transform.js | 81 +++ api/api/transform.start_transform.js | 77 +++ api/api/transform.stop_transform.js | 80 +++ api/api/transform.update_transform.js | 81 +++ api/api/update.js | 4 - api/api/update_by_query.js | 4 - api/index.js | 105 ++-- api/requestParams.d.ts | 146 ++++-- docs/reference.asciidoc | 495 +++++++++++++++--- index.d.ts | 105 ++-- 53 files changed, 2011 insertions(+), 283 deletions(-) create mode 100644 api/api/ccr.pause_auto_follow_pattern.js create mode 100644 api/api/ccr.resume_auto_follow_pattern.js rename api/api/{data_frame.delete_data_frame_transform.js => data_frame_transform_deprecated.delete_transform.js} (87%) create mode 100644 api/api/data_frame_transform_deprecated.get_transform.js rename api/api/{data_frame.get_data_frame_transform_stats.js => data_frame_transform_deprecated.get_transform_stats.js} (87%) create mode 100644 api/api/data_frame_transform_deprecated.preview_transform.js rename api/api/{data_frame.put_data_frame_transform.js => data_frame_transform_deprecated.put_transform.js} (88%) rename api/api/{data_frame.start_data_frame_transform.js => data_frame_transform_deprecated.start_transform.js} (87%) rename api/api/{data_frame.stop_data_frame_transform.js => data_frame_transform_deprecated.stop_transform.js} (88%) rename api/api/{data_frame.update_data_frame_transform.js => data_frame_transform_deprecated.update_transform.js} (88%) create mode 100644 api/api/enrich.delete_policy.js create mode 100644 api/api/enrich.execute_policy.js create mode 100644 api/api/enrich.get_policy.js create mode 100644 api/api/enrich.put_policy.js create mode 100644 api/api/enrich.stats.js create mode 100644 api/api/slm.execute_retention.js create mode 100644 api/api/slm.get_stats.js create mode 100644 api/api/transform.delete_transform.js rename api/api/{data_frame.get_data_frame_transform.js => transform.get_transform.js} (81%) create mode 100644 api/api/transform.get_transform_stats.js rename api/api/{data_frame.preview_data_frame_transform.js => transform.preview_transform.js} (84%) create mode 100644 api/api/transform.put_transform.js create mode 100644 api/api/transform.start_transform.js create mode 100644 api/api/transform.stop_transform.js create mode 100644 api/api/transform.update_transform.js diff --git a/api/api/bulk.js b/api/api/bulk.js index 683c50310..361dd22b1 100644 --- a/api/api/bulk.js +++ b/api/api/bulk.js @@ -19,9 +19,7 @@ function buildBulk (opts) { 'type', '_source', '_source_excludes', - '_source_exclude', '_source_includes', - '_source_include', 'pipeline', 'pretty', 'human', @@ -33,9 +31,7 @@ function buildBulk (opts) { const snakeCase = { waitForActiveShards: 'wait_for_active_shards', _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', errorTrace: 'error_trace', filterPath: 'filter_path' } diff --git a/api/api/cat.aliases.js b/api/api/cat.aliases.js index a291a4629..a706265dd 100644 --- a/api/api/cat.aliases.js +++ b/api/api/cat.aliases.js @@ -14,7 +14,6 @@ function buildCatAliases (opts) { const acceptedQuerystring = [ 'format', 'local', - 'master_timeout', 'h', 'help', 's', @@ -27,7 +26,6 @@ function buildCatAliases (opts) { ] const snakeCase = { - masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' } diff --git a/api/api/cat.count.js b/api/api/cat.count.js index 7578a3259..10cf6fd2c 100644 --- a/api/api/cat.count.js +++ b/api/api/cat.count.js @@ -13,8 +13,6 @@ function buildCatCount (opts) { const acceptedQuerystring = [ 'format', - 'local', - 'master_timeout', 'h', 'help', 's', @@ -27,7 +25,6 @@ function buildCatCount (opts) { ] const snakeCase = { - masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' } diff --git a/api/api/cat.fielddata.js b/api/api/cat.fielddata.js index 6a058e46f..e8767eb00 100644 --- a/api/api/cat.fielddata.js +++ b/api/api/cat.fielddata.js @@ -14,8 +14,6 @@ function buildCatFielddata (opts) { const acceptedQuerystring = [ 'format', 'bytes', - 'local', - 'master_timeout', 'h', 'help', 's', @@ -29,7 +27,6 @@ function buildCatFielddata (opts) { ] const snakeCase = { - masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' } diff --git a/api/api/cat.health.js b/api/api/cat.health.js index e6b99d266..c655333e7 100644 --- a/api/api/cat.health.js +++ b/api/api/cat.health.js @@ -13,11 +13,10 @@ function buildCatHealth (opts) { const acceptedQuerystring = [ 'format', - 'local', - 'master_timeout', 'h', 'help', 's', + 'time', 'ts', 'v', 'pretty', @@ -28,7 +27,6 @@ function buildCatHealth (opts) { ] const snakeCase = { - masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' } diff --git a/api/api/cat.indices.js b/api/api/cat.indices.js index 6bbcd49cc..cf5876aff 100644 --- a/api/api/cat.indices.js +++ b/api/api/cat.indices.js @@ -21,6 +21,7 @@ function buildCatIndices (opts) { 'help', 'pri', 's', + 'time', 'v', 'include_unloaded_segments', 'pretty', diff --git a/api/api/cat.nodes.js b/api/api/cat.nodes.js index 8c7beed6f..01923de06 100644 --- a/api/api/cat.nodes.js +++ b/api/api/cat.nodes.js @@ -12,6 +12,7 @@ function buildCatNodes (opts) { const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts const acceptedQuerystring = [ + 'bytes', 'format', 'full_id', 'local', @@ -19,6 +20,7 @@ function buildCatNodes (opts) { 'h', 'help', 's', + 'time', 'v', 'pretty', 'human', diff --git a/api/api/cat.pending_tasks.js b/api/api/cat.pending_tasks.js index f97e120b3..10f6b5ab0 100644 --- a/api/api/cat.pending_tasks.js +++ b/api/api/cat.pending_tasks.js @@ -18,6 +18,7 @@ function buildCatPendingTasks (opts) { 'h', 'help', 's', + 'time', 'v', 'pretty', 'human', diff --git a/api/api/cat.recovery.js b/api/api/cat.recovery.js index 05b2c0f65..7a75f6433 100644 --- a/api/api/cat.recovery.js +++ b/api/api/cat.recovery.js @@ -13,11 +13,14 @@ function buildCatRecovery (opts) { const acceptedQuerystring = [ 'format', + 'active_only', 'bytes', - 'master_timeout', + 'detailed', 'h', 'help', + 'index', 's', + 'time', 'v', 'pretty', 'human', @@ -27,7 +30,7 @@ function buildCatRecovery (opts) { ] const snakeCase = { - masterTimeout: 'master_timeout', + activeOnly: 'active_only', errorTrace: 'error_trace', filterPath: 'filter_path' } diff --git a/api/api/cat.shards.js b/api/api/cat.shards.js index 551488839..634d78cd0 100644 --- a/api/api/cat.shards.js +++ b/api/api/cat.shards.js @@ -19,6 +19,7 @@ function buildCatShards (opts) { 'h', 'help', 's', + 'time', 'v', 'pretty', 'human', diff --git a/api/api/cat.snapshots.js b/api/api/cat.snapshots.js index 22809b988..78d8921b9 100644 --- a/api/api/cat.snapshots.js +++ b/api/api/cat.snapshots.js @@ -18,6 +18,7 @@ function buildCatSnapshots (opts) { 'h', 'help', 's', + 'time', 'v', 'pretty', 'human', diff --git a/api/api/cat.tasks.js b/api/api/cat.tasks.js index c84a22797..1e0eda879 100644 --- a/api/api/cat.tasks.js +++ b/api/api/cat.tasks.js @@ -20,6 +20,7 @@ function buildCatTasks (opts) { 'h', 'help', 's', + 'time', 'v', 'pretty', 'human', diff --git a/api/api/ccr.pause_auto_follow_pattern.js b/api/api/ccr.pause_auto_follow_pattern.js new file mode 100644 index 000000000..5782467f9 --- /dev/null +++ b/api/api/ccr.pause_auto_follow_pattern.js @@ -0,0 +1,77 @@ +// 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 buildCcrPauseAutoFollowPattern (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + + ] + + const snakeCase = { + + } + + /** + * Perform a ccr.pause_auto_follow_pattern request + * https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html + */ + return function ccrPauseAutoFollowPattern (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 = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name) + '/' + 'pause' + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + options.warnings = warnings.length === 0 ? null : warnings + return makeRequest(request, options, callback) + } +} + +module.exports = buildCcrPauseAutoFollowPattern diff --git a/api/api/ccr.resume_auto_follow_pattern.js b/api/api/ccr.resume_auto_follow_pattern.js new file mode 100644 index 000000000..d8adf6dc0 --- /dev/null +++ b/api/api/ccr.resume_auto_follow_pattern.js @@ -0,0 +1,77 @@ +// 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 buildCcrResumeAutoFollowPattern (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + + ] + + const snakeCase = { + + } + + /** + * Perform a ccr.resume_auto_follow_pattern request + * https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-resume-auto-follow-pattern.html + */ + return function ccrResumeAutoFollowPattern (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 = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name) + '/' + 'resume' + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + options.warnings = warnings.length === 0 ? null : warnings + return makeRequest(request, options, callback) + } +} + +module.exports = buildCcrResumeAutoFollowPattern diff --git a/api/api/data_frame.delete_data_frame_transform.js b/api/api/data_frame_transform_deprecated.delete_transform.js similarity index 87% rename from api/api/data_frame.delete_data_frame_transform.js rename to api/api/data_frame_transform_deprecated.delete_transform.js index ce0d66f1e..beaf9a387 100644 --- a/api/api/data_frame.delete_data_frame_transform.js +++ b/api/api/data_frame_transform_deprecated.delete_transform.js @@ -7,7 +7,7 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ -function buildDataFrameDeleteDataFrameTransform (opts) { +function buildDataFrameTransformDeprecatedDeleteTransform (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts @@ -20,10 +20,10 @@ function buildDataFrameDeleteDataFrameTransform (opts) { } /** - * Perform a data_frame.delete_data_frame_transform request + * Perform a data_frame_transform_deprecated.delete_transform request * https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html */ - return function dataFrameDeleteDataFrameTransform (params, options, callback) { + return function dataFrameTransformDeprecatedDeleteTransform (params, options, callback) { options = options || {} if (typeof options === 'function') { callback = options @@ -74,4 +74,4 @@ function buildDataFrameDeleteDataFrameTransform (opts) { } } -module.exports = buildDataFrameDeleteDataFrameTransform +module.exports = buildDataFrameTransformDeprecatedDeleteTransform diff --git a/api/api/data_frame_transform_deprecated.get_transform.js b/api/api/data_frame_transform_deprecated.get_transform.js new file mode 100644 index 000000000..a2eb48f66 --- /dev/null +++ b/api/api/data_frame_transform_deprecated.get_transform.js @@ -0,0 +1,73 @@ +// 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 buildDataFrameTransformDeprecatedGetTransform (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + 'from', + 'size', + 'allow_no_match' + ] + + const snakeCase = { + allowNoMatch: 'allow_no_match' + } + + /** + * Perform a data_frame_transform_deprecated.get_transform request + * https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html + */ + return function dataFrameTransformDeprecatedGetTransform (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, transformId, transform_id, ...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 = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) + + // build request object + const request = { + method, + path, + body: null, + querystring + } + + options.warnings = warnings.length === 0 ? null : warnings + return makeRequest(request, options, callback) + } +} + +module.exports = buildDataFrameTransformDeprecatedGetTransform diff --git a/api/api/data_frame.get_data_frame_transform_stats.js b/api/api/data_frame_transform_deprecated.get_transform_stats.js similarity index 87% rename from api/api/data_frame.get_data_frame_transform_stats.js rename to api/api/data_frame_transform_deprecated.get_transform_stats.js index 32b6d358d..fa23121a3 100644 --- a/api/api/data_frame.get_data_frame_transform_stats.js +++ b/api/api/data_frame_transform_deprecated.get_transform_stats.js @@ -7,7 +7,7 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ -function buildDataFrameGetDataFrameTransformStats (opts) { +function buildDataFrameTransformDeprecatedGetTransformStats (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts @@ -22,10 +22,10 @@ function buildDataFrameGetDataFrameTransformStats (opts) { } /** - * Perform a data_frame.get_data_frame_transform_stats request + * Perform a data_frame_transform_deprecated.get_transform_stats request * https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html */ - return function dataFrameGetDataFrameTransformStats (params, options, callback) { + return function dataFrameTransformDeprecatedGetTransformStats (params, options, callback) { options = options || {} if (typeof options === 'function') { callback = options @@ -76,4 +76,4 @@ function buildDataFrameGetDataFrameTransformStats (opts) { } } -module.exports = buildDataFrameGetDataFrameTransformStats +module.exports = buildDataFrameTransformDeprecatedGetTransformStats diff --git a/api/api/data_frame_transform_deprecated.preview_transform.js b/api/api/data_frame_transform_deprecated.preview_transform.js new file mode 100644 index 000000000..24c26c166 --- /dev/null +++ b/api/api/data_frame_transform_deprecated.preview_transform.js @@ -0,0 +1,74 @@ +// 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 buildDataFrameTransformDeprecatedPreviewTransform (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + + ] + + const snakeCase = { + + } + + /** + * Perform a data_frame_transform_deprecated.preview_transform request + * https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html + */ + return function dataFrameTransformDeprecatedPreviewTransform (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['body'] == null) { + const err = new ConfigurationError('Missing required parameter: body') + 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, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) + + var ignore = options.ignore + if (typeof ignore === 'number') { + options.ignore = [ignore] + } + + var path = '' + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + options.warnings = warnings.length === 0 ? null : warnings + return makeRequest(request, options, callback) + } +} + +module.exports = buildDataFrameTransformDeprecatedPreviewTransform diff --git a/api/api/data_frame.put_data_frame_transform.js b/api/api/data_frame_transform_deprecated.put_transform.js similarity index 88% rename from api/api/data_frame.put_data_frame_transform.js rename to api/api/data_frame_transform_deprecated.put_transform.js index 1f3028380..e57e8f04e 100644 --- a/api/api/data_frame.put_data_frame_transform.js +++ b/api/api/data_frame_transform_deprecated.put_transform.js @@ -7,7 +7,7 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ -function buildDataFramePutDataFrameTransform (opts) { +function buildDataFrameTransformDeprecatedPutTransform (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts @@ -20,10 +20,10 @@ function buildDataFramePutDataFrameTransform (opts) { } /** - * Perform a data_frame.put_data_frame_transform request + * Perform a data_frame_transform_deprecated.put_transform request * https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html */ - return function dataFramePutDataFrameTransform (params, options, callback) { + return function dataFrameTransformDeprecatedPutTransform (params, options, callback) { options = options || {} if (typeof options === 'function') { callback = options @@ -78,4 +78,4 @@ function buildDataFramePutDataFrameTransform (opts) { } } -module.exports = buildDataFramePutDataFrameTransform +module.exports = buildDataFrameTransformDeprecatedPutTransform diff --git a/api/api/data_frame.start_data_frame_transform.js b/api/api/data_frame_transform_deprecated.start_transform.js similarity index 87% rename from api/api/data_frame.start_data_frame_transform.js rename to api/api/data_frame_transform_deprecated.start_transform.js index 7ade50b5d..933e2bc28 100644 --- a/api/api/data_frame.start_data_frame_transform.js +++ b/api/api/data_frame_transform_deprecated.start_transform.js @@ -7,7 +7,7 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ -function buildDataFrameStartDataFrameTransform (opts) { +function buildDataFrameTransformDeprecatedStartTransform (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts @@ -20,10 +20,10 @@ function buildDataFrameStartDataFrameTransform (opts) { } /** - * Perform a data_frame.start_data_frame_transform request + * Perform a data_frame_transform_deprecated.start_transform request * https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html */ - return function dataFrameStartDataFrameTransform (params, options, callback) { + return function dataFrameTransformDeprecatedStartTransform (params, options, callback) { options = options || {} if (typeof options === 'function') { callback = options @@ -74,4 +74,4 @@ function buildDataFrameStartDataFrameTransform (opts) { } } -module.exports = buildDataFrameStartDataFrameTransform +module.exports = buildDataFrameTransformDeprecatedStartTransform diff --git a/api/api/data_frame.stop_data_frame_transform.js b/api/api/data_frame_transform_deprecated.stop_transform.js similarity index 88% rename from api/api/data_frame.stop_data_frame_transform.js rename to api/api/data_frame_transform_deprecated.stop_transform.js index 09a09bef2..fcc8a0140 100644 --- a/api/api/data_frame.stop_data_frame_transform.js +++ b/api/api/data_frame_transform_deprecated.stop_transform.js @@ -7,7 +7,7 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ -function buildDataFrameStopDataFrameTransform (opts) { +function buildDataFrameTransformDeprecatedStopTransform (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts @@ -23,10 +23,10 @@ function buildDataFrameStopDataFrameTransform (opts) { } /** - * Perform a data_frame.stop_data_frame_transform request + * Perform a data_frame_transform_deprecated.stop_transform request * https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html */ - return function dataFrameStopDataFrameTransform (params, options, callback) { + return function dataFrameTransformDeprecatedStopTransform (params, options, callback) { options = options || {} if (typeof options === 'function') { callback = options @@ -77,4 +77,4 @@ function buildDataFrameStopDataFrameTransform (opts) { } } -module.exports = buildDataFrameStopDataFrameTransform +module.exports = buildDataFrameTransformDeprecatedStopTransform diff --git a/api/api/data_frame.update_data_frame_transform.js b/api/api/data_frame_transform_deprecated.update_transform.js similarity index 88% rename from api/api/data_frame.update_data_frame_transform.js rename to api/api/data_frame_transform_deprecated.update_transform.js index dbb7519ef..3c276c974 100644 --- a/api/api/data_frame.update_data_frame_transform.js +++ b/api/api/data_frame_transform_deprecated.update_transform.js @@ -7,7 +7,7 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ -function buildDataFrameUpdateDataFrameTransform (opts) { +function buildDataFrameTransformDeprecatedUpdateTransform (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts @@ -20,10 +20,10 @@ function buildDataFrameUpdateDataFrameTransform (opts) { } /** - * Perform a data_frame.update_data_frame_transform request + * Perform a data_frame_transform_deprecated.update_transform request * https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html */ - return function dataFrameUpdateDataFrameTransform (params, options, callback) { + return function dataFrameTransformDeprecatedUpdateTransform (params, options, callback) { options = options || {} if (typeof options === 'function') { callback = options @@ -78,4 +78,4 @@ function buildDataFrameUpdateDataFrameTransform (opts) { } } -module.exports = buildDataFrameUpdateDataFrameTransform +module.exports = buildDataFrameTransformDeprecatedUpdateTransform diff --git a/api/api/delete_by_query.js b/api/api/delete_by_query.js index a9ad61615..75bee3817 100644 --- a/api/api/delete_by_query.js +++ b/api/api/delete_by_query.js @@ -32,9 +32,7 @@ function buildDeleteByQuery (opts) { 'sort', '_source', '_source_excludes', - '_source_exclude', '_source_includes', - '_source_include', 'terminate_after', 'stats', 'version', @@ -63,9 +61,7 @@ function buildDeleteByQuery (opts) { searchTimeout: 'search_timeout', maxDocs: 'max_docs', _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', terminateAfter: 'terminate_after', requestCache: 'request_cache', waitForActiveShards: 'wait_for_active_shards', diff --git a/api/api/enrich.delete_policy.js b/api/api/enrich.delete_policy.js new file mode 100644 index 000000000..c2658df0a --- /dev/null +++ b/api/api/enrich.delete_policy.js @@ -0,0 +1,76 @@ +// 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 buildEnrichDeletePolicy (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + + ] + + const snakeCase = { + + } + + /** + * Perform a enrich.delete_policy request + */ + return function enrichDeletePolicy (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 = 'DELETE' + path = '/' + '_enrich' + '/' + 'policy' + '/' + 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 = buildEnrichDeletePolicy diff --git a/api/api/enrich.execute_policy.js b/api/api/enrich.execute_policy.js new file mode 100644 index 000000000..61f09e411 --- /dev/null +++ b/api/api/enrich.execute_policy.js @@ -0,0 +1,76 @@ +// 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 buildEnrichExecutePolicy (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + 'wait_for_completion' + ] + + const snakeCase = { + waitForCompletion: 'wait_for_completion' + } + + /** + * Perform a enrich.execute_policy request + */ + return function enrichExecutePolicy (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 = 'PUT' + path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name) + '/' + '_execute' + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + options.warnings = warnings.length === 0 ? null : warnings + return makeRequest(request, options, callback) + } +} + +module.exports = buildEnrichExecutePolicy diff --git a/api/api/enrich.get_policy.js b/api/api/enrich.get_policy.js new file mode 100644 index 000000000..4225e808b --- /dev/null +++ b/api/api/enrich.get_policy.js @@ -0,0 +1,75 @@ +// 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 buildEnrichGetPolicy (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + + ] + + const snakeCase = { + + } + + /** + * Perform a enrich.get_policy request + */ + return function enrichGetPolicy (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, name, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) + + var ignore = options.ignore + if (typeof ignore === 'number') { + options.ignore = [ignore] + } + + var path = '' + + if ((name) != null) { + if (method == null) method = 'GET' + path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name) + } else { + if (method == null) method = 'GET' + path = '/' + '_enrich' + '/' + 'policy' + } + + // build request object + const request = { + method, + path, + body: null, + querystring + } + + options.warnings = warnings.length === 0 ? null : warnings + return makeRequest(request, options, callback) + } +} + +module.exports = buildEnrichGetPolicy diff --git a/api/api/enrich.put_policy.js b/api/api/enrich.put_policy.js new file mode 100644 index 000000000..53830f100 --- /dev/null +++ b/api/api/enrich.put_policy.js @@ -0,0 +1,80 @@ +// 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 buildEnrichPutPolicy (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + + ] + + const snakeCase = { + + } + + /** + * Perform a enrich.put_policy request + */ + return function enrichPutPolicy (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) + } + if (params['body'] == null) { + const err = new ConfigurationError('Missing required parameter: body') + 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 = 'PUT' + path = '/' + '_enrich' + '/' + 'policy' + '/' + 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 = buildEnrichPutPolicy diff --git a/api/api/enrich.stats.js b/api/api/enrich.stats.js new file mode 100644 index 000000000..98d7cd7cf --- /dev/null +++ b/api/api/enrich.stats.js @@ -0,0 +1,70 @@ +// 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 buildEnrichStats (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + + ] + + const snakeCase = { + + } + + /** + * Perform a enrich.stats request + */ + return function enrichStats (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 = 'GET' + path = '/' + '_enrich' + '/' + '_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 = buildEnrichStats diff --git a/api/api/exists.js b/api/api/exists.js index c48a5299b..7659a0907 100644 --- a/api/api/exists.js +++ b/api/api/exists.js @@ -19,9 +19,7 @@ function buildExists (opts) { 'routing', '_source', '_source_excludes', - '_source_exclude', '_source_includes', - '_source_include', 'version', 'version_type', 'pretty', @@ -34,9 +32,7 @@ function buildExists (opts) { const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' diff --git a/api/api/exists_source.js b/api/api/exists_source.js index fab3f6d85..059ed1de5 100644 --- a/api/api/exists_source.js +++ b/api/api/exists_source.js @@ -18,9 +18,7 @@ function buildExistsSource (opts) { 'routing', '_source', '_source_excludes', - '_source_exclude', '_source_includes', - '_source_include', 'version', 'version_type', 'pretty', @@ -32,9 +30,7 @@ function buildExistsSource (opts) { const snakeCase = { _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' diff --git a/api/api/explain.js b/api/api/explain.js index 71aab5acf..cf513bdcb 100644 --- a/api/api/explain.js +++ b/api/api/explain.js @@ -23,9 +23,7 @@ function buildExplain (opts) { 'routing', '_source', '_source_excludes', - '_source_exclude', '_source_includes', - '_source_include', 'pretty', 'human', 'error_trace', @@ -38,9 +36,7 @@ function buildExplain (opts) { defaultOperator: 'default_operator', storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', errorTrace: 'error_trace', filterPath: 'filter_path' } diff --git a/api/api/get.js b/api/api/get.js index 87b127cab..ee5aeeee7 100644 --- a/api/api/get.js +++ b/api/api/get.js @@ -19,9 +19,7 @@ function buildGet (opts) { 'routing', '_source', '_source_excludes', - '_source_exclude', '_source_includes', - '_source_include', 'version', 'version_type', 'pretty', @@ -34,9 +32,7 @@ function buildGet (opts) { const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' diff --git a/api/api/get_source.js b/api/api/get_source.js index 70bd3deff..08543b96a 100644 --- a/api/api/get_source.js +++ b/api/api/get_source.js @@ -18,9 +18,7 @@ function buildGetSource (opts) { 'routing', '_source', '_source_excludes', - '_source_exclude', '_source_includes', - '_source_include', 'version', 'version_type', 'pretty', @@ -32,9 +30,7 @@ function buildGetSource (opts) { const snakeCase = { _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' diff --git a/api/api/index.js b/api/api/index.js index 67f47b96a..6136772b9 100644 --- a/api/api/index.js +++ b/api/api/index.js @@ -84,10 +84,10 @@ function buildIndex (opts) { var path = '' if ((index) != null && (type) != null && (id) != null) { - if (method == null) method = 'POST' + if (method == null) method = 'PUT' path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) } else if ((index) != null && (id) != null) { - if (method == null) method = 'POST' + if (method == null) method = 'PUT' path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) } else if ((index) != null && (type) != null) { if (method == null) method = 'POST' diff --git a/api/api/mget.js b/api/api/mget.js index fbf6f03f4..2e6093e5e 100644 --- a/api/api/mget.js +++ b/api/api/mget.js @@ -19,9 +19,7 @@ function buildMget (opts) { 'routing', '_source', '_source_excludes', - '_source_exclude', '_source_includes', - '_source_include', 'pretty', 'human', 'error_trace', @@ -32,9 +30,7 @@ function buildMget (opts) { const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', errorTrace: 'error_trace', filterPath: 'filter_path' } diff --git a/api/api/search.js b/api/api/search.js index 8e058048f..c17ccd295 100644 --- a/api/api/search.js +++ b/api/api/search.js @@ -35,9 +35,7 @@ function buildSearch (opts) { 'sort', '_source', '_source_excludes', - '_source_exclude', '_source_includes', - '_source_include', 'terminate_after', 'stats', 'suggest_field', @@ -75,9 +73,7 @@ function buildSearch (opts) { expandWildcards: 'expand_wildcards', searchType: 'search_type', _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', terminateAfter: 'terminate_after', suggestField: 'suggest_field', suggestMode: 'suggest_mode', diff --git a/api/api/security.get_api_key.js b/api/api/security.get_api_key.js index bbcfc0162..80e21a104 100644 --- a/api/api/security.get_api_key.js +++ b/api/api/security.get_api_key.js @@ -15,11 +15,13 @@ function buildSecurityGetApiKey (opts) { 'id', 'name', 'username', - 'realm_name' + 'realm_name', + 'owner' ] const snakeCase = { realmName: 'realm_name' + } /** diff --git a/api/api/slm.execute_retention.js b/api/api/slm.execute_retention.js new file mode 100644 index 000000000..f23dfb5e2 --- /dev/null +++ b/api/api/slm.execute_retention.js @@ -0,0 +1,71 @@ +// 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 buildSlmExecuteRetention (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + + ] + + const snakeCase = { + + } + + /** + * Perform a slm.execute_retention request + * https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html + */ + return function slmExecuteRetention (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 = '/' + '_slm' + '/' + '_execute_retention' + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + options.warnings = warnings.length === 0 ? null : warnings + return makeRequest(request, options, callback) + } +} + +module.exports = buildSlmExecuteRetention diff --git a/api/api/slm.get_stats.js b/api/api/slm.get_stats.js new file mode 100644 index 000000000..07369f451 --- /dev/null +++ b/api/api/slm.get_stats.js @@ -0,0 +1,71 @@ +// 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 buildSlmGetStats (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + + ] + + const snakeCase = { + + } + + /** + * Perform a slm.get_stats request + * https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-get-stats.html + */ + return function slmGetStats (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 = 'GET' + path = '/' + '_slm' + '/' + '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 = buildSlmGetStats diff --git a/api/api/transform.delete_transform.js b/api/api/transform.delete_transform.js new file mode 100644 index 000000000..043e3d13a --- /dev/null +++ b/api/api/transform.delete_transform.js @@ -0,0 +1,77 @@ +// 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 buildTransformDeleteTransform (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + 'force' + ] + + const snakeCase = { + + } + + /** + * Perform a transform.delete_transform request + * https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html + */ + return function transformDeleteTransform (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['transform_id'] == null && params['transformId'] == null) { + const err = new ConfigurationError('Missing required parameter: transform_id or transformId') + 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, transformId, transform_id, ...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 = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + options.warnings = warnings.length === 0 ? null : warnings + return makeRequest(request, options, callback) + } +} + +module.exports = buildTransformDeleteTransform diff --git a/api/api/data_frame.get_data_frame_transform.js b/api/api/transform.get_transform.js similarity index 81% rename from api/api/data_frame.get_data_frame_transform.js rename to api/api/transform.get_transform.js index dd7aea3c2..643debd27 100644 --- a/api/api/data_frame.get_data_frame_transform.js +++ b/api/api/transform.get_transform.js @@ -7,7 +7,7 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ -function buildDataFrameGetDataFrameTransform (opts) { +function buildTransformGetTransform (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts @@ -22,10 +22,10 @@ function buildDataFrameGetDataFrameTransform (opts) { } /** - * Perform a data_frame.get_data_frame_transform request + * Perform a transform.get_transform request * https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html */ - return function dataFrameGetDataFrameTransform (params, options, callback) { + return function transformGetTransform (params, options, callback) { options = options || {} if (typeof options === 'function') { callback = options @@ -56,10 +56,10 @@ function buildDataFrameGetDataFrameTransform (opts) { if ((transform_id || transformId) != null) { if (method == null) method = 'GET' - path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) + path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) } else { if (method == null) method = 'GET' - path = '/' + '_data_frame' + '/' + 'transforms' + path = '/' + '_transform' } // build request object @@ -75,4 +75,4 @@ function buildDataFrameGetDataFrameTransform (opts) { } } -module.exports = buildDataFrameGetDataFrameTransform +module.exports = buildTransformGetTransform diff --git a/api/api/transform.get_transform_stats.js b/api/api/transform.get_transform_stats.js new file mode 100644 index 000000000..7dc8fa140 --- /dev/null +++ b/api/api/transform.get_transform_stats.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 buildTransformGetTransformStats (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + 'from', + 'size', + 'allow_no_match' + ] + + const snakeCase = { + allowNoMatch: 'allow_no_match' + } + + /** + * Perform a transform.get_transform_stats request + * https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html + */ + return function transformGetTransformStats (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['transform_id'] == null && params['transformId'] == null) { + const err = new ConfigurationError('Missing required parameter: transform_id or transformId') + 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, transformId, transform_id, ...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 = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_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 = buildTransformGetTransformStats diff --git a/api/api/data_frame.preview_data_frame_transform.js b/api/api/transform.preview_transform.js similarity index 84% rename from api/api/data_frame.preview_data_frame_transform.js rename to api/api/transform.preview_transform.js index 820ec1e2b..78333d69f 100644 --- a/api/api/data_frame.preview_data_frame_transform.js +++ b/api/api/transform.preview_transform.js @@ -7,7 +7,7 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ -function buildDataFramePreviewDataFrameTransform (opts) { +function buildTransformPreviewTransform (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts @@ -20,10 +20,10 @@ function buildDataFramePreviewDataFrameTransform (opts) { } /** - * Perform a data_frame.preview_data_frame_transform request + * Perform a transform.preview_transform request * https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html */ - return function dataFramePreviewDataFrameTransform (params, options, callback) { + return function transformPreviewTransform (params, options, callback) { options = options || {} if (typeof options === 'function') { callback = options @@ -59,7 +59,7 @@ function buildDataFramePreviewDataFrameTransform (opts) { var path = '' if (method == null) method = 'POST' - path = '/' + '_data_frame' + '/' + 'transforms' + '/' + '_preview' + path = '/' + '_transform' + '/' + '_preview' // build request object const request = { @@ -74,4 +74,4 @@ function buildDataFramePreviewDataFrameTransform (opts) { } } -module.exports = buildDataFramePreviewDataFrameTransform +module.exports = buildTransformPreviewTransform diff --git a/api/api/transform.put_transform.js b/api/api/transform.put_transform.js new file mode 100644 index 000000000..4832ea689 --- /dev/null +++ b/api/api/transform.put_transform.js @@ -0,0 +1,81 @@ +// 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 buildTransformPutTransform (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + 'defer_validation' + ] + + const snakeCase = { + deferValidation: 'defer_validation' + } + + /** + * Perform a transform.put_transform request + * https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html + */ + return function transformPutTransform (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['transform_id'] == null && params['transformId'] == null) { + const err = new ConfigurationError('Missing required parameter: transform_id or transformId') + return handleError(err, callback) + } + if (params['body'] == null) { + const err = new ConfigurationError('Missing required parameter: body') + 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, transformId, transform_id, ...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 = 'PUT' + path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + options.warnings = warnings.length === 0 ? null : warnings + return makeRequest(request, options, callback) + } +} + +module.exports = buildTransformPutTransform diff --git a/api/api/transform.start_transform.js b/api/api/transform.start_transform.js new file mode 100644 index 000000000..8482d4dd6 --- /dev/null +++ b/api/api/transform.start_transform.js @@ -0,0 +1,77 @@ +// 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 buildTransformStartTransform (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + 'timeout' + ] + + const snakeCase = { + + } + + /** + * Perform a transform.start_transform request + * https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html + */ + return function transformStartTransform (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['transform_id'] == null && params['transformId'] == null) { + const err = new ConfigurationError('Missing required parameter: transform_id or transformId') + 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, transformId, transform_id, ...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 = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_start' + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + options.warnings = warnings.length === 0 ? null : warnings + return makeRequest(request, options, callback) + } +} + +module.exports = buildTransformStartTransform diff --git a/api/api/transform.stop_transform.js b/api/api/transform.stop_transform.js new file mode 100644 index 000000000..1ee434793 --- /dev/null +++ b/api/api/transform.stop_transform.js @@ -0,0 +1,80 @@ +// 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 buildTransformStopTransform (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + 'wait_for_completion', + 'timeout', + 'allow_no_match' + ] + + const snakeCase = { + waitForCompletion: 'wait_for_completion', + allowNoMatch: 'allow_no_match' + } + + /** + * Perform a transform.stop_transform request + * https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html + */ + return function transformStopTransform (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['transform_id'] == null && params['transformId'] == null) { + const err = new ConfigurationError('Missing required parameter: transform_id or transformId') + 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, transformId, transform_id, ...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 = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stop' + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + options.warnings = warnings.length === 0 ? null : warnings + return makeRequest(request, options, callback) + } +} + +module.exports = buildTransformStopTransform diff --git a/api/api/transform.update_transform.js b/api/api/transform.update_transform.js new file mode 100644 index 000000000..d8623e7a9 --- /dev/null +++ b/api/api/transform.update_transform.js @@ -0,0 +1,81 @@ +// 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 buildTransformUpdateTransform (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts + + const acceptedQuerystring = [ + 'defer_validation' + ] + + const snakeCase = { + deferValidation: 'defer_validation' + } + + /** + * Perform a transform.update_transform request + * https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html + */ + return function transformUpdateTransform (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['transform_id'] == null && params['transformId'] == null) { + const err = new ConfigurationError('Missing required parameter: transform_id or transformId') + return handleError(err, callback) + } + if (params['body'] == null) { + const err = new ConfigurationError('Missing required parameter: body') + 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, transformId, transform_id, ...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 = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_update' + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + options.warnings = warnings.length === 0 ? null : warnings + return makeRequest(request, options, callback) + } +} + +module.exports = buildTransformUpdateTransform diff --git a/api/api/update.js b/api/api/update.js index bd5744bba..e45c32c38 100644 --- a/api/api/update.js +++ b/api/api/update.js @@ -15,9 +15,7 @@ function buildUpdate (opts) { 'wait_for_active_shards', '_source', '_source_excludes', - '_source_exclude', '_source_includes', - '_source_include', 'lang', 'refresh', 'retry_on_conflict', @@ -35,9 +33,7 @@ function buildUpdate (opts) { const snakeCase = { waitForActiveShards: 'wait_for_active_shards', _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', retryOnConflict: 'retry_on_conflict', ifSeqNo: 'if_seq_no', ifPrimaryTerm: 'if_primary_term', diff --git a/api/api/update_by_query.js b/api/api/update_by_query.js index 682e44ddd..2ba13c742 100644 --- a/api/api/update_by_query.js +++ b/api/api/update_by_query.js @@ -34,9 +34,7 @@ function buildUpdateByQuery (opts) { 'sort', '_source', '_source_excludes', - '_source_exclude', '_source_includes', - '_source_include', 'terminate_after', 'stats', 'version', @@ -66,9 +64,7 @@ function buildUpdateByQuery (opts) { searchTimeout: 'search_timeout', maxDocs: 'max_docs', _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', terminateAfter: 'terminate_after', versionType: 'version_type', requestCache: 'request_cache', diff --git a/api/index.js b/api/index.js index e64a3456c..9dc5951ee 100644 --- a/api/index.js +++ b/api/index.js @@ -53,10 +53,14 @@ function ESAPI (opts) { forgetFollower: lazyLoad('ccr.forget_follower', opts), get_auto_follow_pattern: lazyLoad('ccr.get_auto_follow_pattern', opts), getAutoFollowPattern: lazyLoad('ccr.get_auto_follow_pattern', opts), + pause_auto_follow_pattern: lazyLoad('ccr.pause_auto_follow_pattern', opts), + pauseAutoFollowPattern: lazyLoad('ccr.pause_auto_follow_pattern', opts), pause_follow: lazyLoad('ccr.pause_follow', opts), pauseFollow: lazyLoad('ccr.pause_follow', opts), put_auto_follow_pattern: lazyLoad('ccr.put_auto_follow_pattern', opts), putAutoFollowPattern: lazyLoad('ccr.put_auto_follow_pattern', opts), + resume_auto_follow_pattern: lazyLoad('ccr.resume_auto_follow_pattern', opts), + resumeAutoFollowPattern: lazyLoad('ccr.resume_auto_follow_pattern', opts), resume_follow: lazyLoad('ccr.resume_follow', opts), resumeFollow: lazyLoad('ccr.resume_follow', opts), stats: lazyLoad('ccr.stats', opts), @@ -82,41 +86,41 @@ function ESAPI (opts) { }, count: lazyLoad('count', opts), create: lazyLoad('create', opts), - data_frame: { - delete_data_frame_transform: lazyLoad('data_frame.delete_data_frame_transform', opts), - deleteDataFrameTransform: lazyLoad('data_frame.delete_data_frame_transform', opts), - get_data_frame_transform: lazyLoad('data_frame.get_data_frame_transform', opts), - getDataFrameTransform: lazyLoad('data_frame.get_data_frame_transform', opts), - get_data_frame_transform_stats: lazyLoad('data_frame.get_data_frame_transform_stats', opts), - getDataFrameTransformStats: lazyLoad('data_frame.get_data_frame_transform_stats', opts), - preview_data_frame_transform: lazyLoad('data_frame.preview_data_frame_transform', opts), - previewDataFrameTransform: lazyLoad('data_frame.preview_data_frame_transform', opts), - put_data_frame_transform: lazyLoad('data_frame.put_data_frame_transform', opts), - putDataFrameTransform: lazyLoad('data_frame.put_data_frame_transform', opts), - start_data_frame_transform: lazyLoad('data_frame.start_data_frame_transform', opts), - startDataFrameTransform: lazyLoad('data_frame.start_data_frame_transform', opts), - stop_data_frame_transform: lazyLoad('data_frame.stop_data_frame_transform', opts), - stopDataFrameTransform: lazyLoad('data_frame.stop_data_frame_transform', opts), - update_data_frame_transform: lazyLoad('data_frame.update_data_frame_transform', opts), - updateDataFrameTransform: lazyLoad('data_frame.update_data_frame_transform', opts) + data_frame_transform_deprecated: { + delete_transform: lazyLoad('data_frame_transform_deprecated.delete_transform', opts), + deleteTransform: lazyLoad('data_frame_transform_deprecated.delete_transform', opts), + get_transform: lazyLoad('data_frame_transform_deprecated.get_transform', opts), + getTransform: lazyLoad('data_frame_transform_deprecated.get_transform', opts), + get_transform_stats: lazyLoad('data_frame_transform_deprecated.get_transform_stats', opts), + getTransformStats: lazyLoad('data_frame_transform_deprecated.get_transform_stats', opts), + preview_transform: lazyLoad('data_frame_transform_deprecated.preview_transform', opts), + previewTransform: lazyLoad('data_frame_transform_deprecated.preview_transform', opts), + put_transform: lazyLoad('data_frame_transform_deprecated.put_transform', opts), + putTransform: lazyLoad('data_frame_transform_deprecated.put_transform', opts), + start_transform: lazyLoad('data_frame_transform_deprecated.start_transform', opts), + startTransform: lazyLoad('data_frame_transform_deprecated.start_transform', opts), + stop_transform: lazyLoad('data_frame_transform_deprecated.stop_transform', opts), + stopTransform: lazyLoad('data_frame_transform_deprecated.stop_transform', opts), + update_transform: lazyLoad('data_frame_transform_deprecated.update_transform', opts), + updateTransform: lazyLoad('data_frame_transform_deprecated.update_transform', opts) }, - dataFrame: { - delete_data_frame_transform: lazyLoad('data_frame.delete_data_frame_transform', opts), - deleteDataFrameTransform: lazyLoad('data_frame.delete_data_frame_transform', opts), - get_data_frame_transform: lazyLoad('data_frame.get_data_frame_transform', opts), - getDataFrameTransform: lazyLoad('data_frame.get_data_frame_transform', opts), - get_data_frame_transform_stats: lazyLoad('data_frame.get_data_frame_transform_stats', opts), - getDataFrameTransformStats: lazyLoad('data_frame.get_data_frame_transform_stats', opts), - preview_data_frame_transform: lazyLoad('data_frame.preview_data_frame_transform', opts), - previewDataFrameTransform: lazyLoad('data_frame.preview_data_frame_transform', opts), - put_data_frame_transform: lazyLoad('data_frame.put_data_frame_transform', opts), - putDataFrameTransform: lazyLoad('data_frame.put_data_frame_transform', opts), - start_data_frame_transform: lazyLoad('data_frame.start_data_frame_transform', opts), - startDataFrameTransform: lazyLoad('data_frame.start_data_frame_transform', opts), - stop_data_frame_transform: lazyLoad('data_frame.stop_data_frame_transform', opts), - stopDataFrameTransform: lazyLoad('data_frame.stop_data_frame_transform', opts), - update_data_frame_transform: lazyLoad('data_frame.update_data_frame_transform', opts), - updateDataFrameTransform: lazyLoad('data_frame.update_data_frame_transform', opts) + dataFrameTransformDeprecated: { + delete_transform: lazyLoad('data_frame_transform_deprecated.delete_transform', opts), + deleteTransform: lazyLoad('data_frame_transform_deprecated.delete_transform', opts), + get_transform: lazyLoad('data_frame_transform_deprecated.get_transform', opts), + getTransform: lazyLoad('data_frame_transform_deprecated.get_transform', opts), + get_transform_stats: lazyLoad('data_frame_transform_deprecated.get_transform_stats', opts), + getTransformStats: lazyLoad('data_frame_transform_deprecated.get_transform_stats', opts), + preview_transform: lazyLoad('data_frame_transform_deprecated.preview_transform', opts), + previewTransform: lazyLoad('data_frame_transform_deprecated.preview_transform', opts), + put_transform: lazyLoad('data_frame_transform_deprecated.put_transform', opts), + putTransform: lazyLoad('data_frame_transform_deprecated.put_transform', opts), + start_transform: lazyLoad('data_frame_transform_deprecated.start_transform', opts), + startTransform: lazyLoad('data_frame_transform_deprecated.start_transform', opts), + stop_transform: lazyLoad('data_frame_transform_deprecated.stop_transform', opts), + stopTransform: lazyLoad('data_frame_transform_deprecated.stop_transform', opts), + update_transform: lazyLoad('data_frame_transform_deprecated.update_transform', opts), + updateTransform: lazyLoad('data_frame_transform_deprecated.update_transform', opts) }, delete: lazyLoad('delete', opts), delete_by_query: lazyLoad('delete_by_query', opts), @@ -125,6 +129,17 @@ function ESAPI (opts) { deleteByQueryRethrottle: lazyLoad('delete_by_query_rethrottle', opts), delete_script: lazyLoad('delete_script', opts), deleteScript: lazyLoad('delete_script', opts), + enrich: { + delete_policy: lazyLoad('enrich.delete_policy', opts), + deletePolicy: lazyLoad('enrich.delete_policy', opts), + execute_policy: lazyLoad('enrich.execute_policy', opts), + executePolicy: lazyLoad('enrich.execute_policy', opts), + get_policy: lazyLoad('enrich.get_policy', opts), + getPolicy: lazyLoad('enrich.get_policy', opts), + put_policy: lazyLoad('enrich.put_policy', opts), + putPolicy: lazyLoad('enrich.put_policy', opts), + stats: lazyLoad('enrich.stats', opts) + }, exists: lazyLoad('exists', opts), exists_source: lazyLoad('exists_source', opts), existsSource: lazyLoad('exists_source', opts), @@ -469,8 +484,12 @@ function ESAPI (opts) { deleteLifecycle: lazyLoad('slm.delete_lifecycle', opts), execute_lifecycle: lazyLoad('slm.execute_lifecycle', opts), executeLifecycle: lazyLoad('slm.execute_lifecycle', opts), + execute_retention: lazyLoad('slm.execute_retention', opts), + executeRetention: lazyLoad('slm.execute_retention', opts), get_lifecycle: lazyLoad('slm.get_lifecycle', opts), getLifecycle: lazyLoad('slm.get_lifecycle', opts), + get_stats: lazyLoad('slm.get_stats', opts), + getStats: lazyLoad('slm.get_stats', opts), put_lifecycle: lazyLoad('slm.put_lifecycle', opts), putLifecycle: lazyLoad('slm.put_lifecycle', opts) }, @@ -506,6 +525,24 @@ function ESAPI (opts) { list: lazyLoad('tasks.list', opts) }, termvectors: lazyLoad('termvectors', opts), + transform: { + delete_transform: lazyLoad('transform.delete_transform', opts), + deleteTransform: lazyLoad('transform.delete_transform', opts), + get_transform: lazyLoad('transform.get_transform', opts), + getTransform: lazyLoad('transform.get_transform', opts), + get_transform_stats: lazyLoad('transform.get_transform_stats', opts), + getTransformStats: lazyLoad('transform.get_transform_stats', opts), + preview_transform: lazyLoad('transform.preview_transform', opts), + previewTransform: lazyLoad('transform.preview_transform', opts), + put_transform: lazyLoad('transform.put_transform', opts), + putTransform: lazyLoad('transform.put_transform', opts), + start_transform: lazyLoad('transform.start_transform', opts), + startTransform: lazyLoad('transform.start_transform', opts), + stop_transform: lazyLoad('transform.stop_transform', opts), + stopTransform: lazyLoad('transform.stop_transform', opts), + update_transform: lazyLoad('transform.update_transform', opts), + updateTransform: lazyLoad('transform.update_transform', opts) + }, update: lazyLoad('update', opts), update_by_query: lazyLoad('update_by_query', opts), updateByQuery: lazyLoad('update_by_query', opts), diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts index d1f1555bd..7924733e2 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -15,8 +15,6 @@ export interface Generic { export interface Bulk extends Generic { index?: string; type?: string; - _source_exclude?: string | string[]; - _source_include?: string | string[]; wait_for_active_shards?: string; refresh?: 'true' | 'false' | 'wait_for'; routing?: string; @@ -32,7 +30,6 @@ export interface CatAliases extends Generic { name?: string | string[]; format?: string; local?: boolean; - master_timeout?: string; h?: string | string[]; help?: boolean; s?: string | string[]; @@ -54,8 +51,6 @@ export interface CatAllocation extends Generic { export interface CatCount extends Generic { index?: string | string[]; format?: string; - local?: boolean; - master_timeout?: string; h?: string | string[]; help?: boolean; s?: string | string[]; @@ -66,8 +61,6 @@ export interface CatFielddata extends Generic { fields?: string | string[]; format?: string; bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb'; - local?: boolean; - master_timeout?: string; h?: string | string[]; help?: boolean; s?: string | string[]; @@ -76,11 +69,10 @@ export interface CatFielddata extends Generic { export interface CatHealth extends Generic { format?: string; - local?: boolean; - master_timeout?: string; h?: string | string[]; help?: boolean; s?: string | string[]; + time?: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)'; ts?: boolean; v?: boolean; } @@ -101,6 +93,7 @@ export interface CatIndices extends Generic { help?: boolean; pri?: boolean; s?: string | string[]; + time?: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)'; v?: boolean; include_unloaded_segments?: boolean; } @@ -126,6 +119,7 @@ export interface CatNodeattrs extends Generic { } export interface CatNodes extends Generic { + bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb'; format?: string; full_id?: boolean; local?: boolean; @@ -133,6 +127,7 @@ export interface CatNodes extends Generic { h?: string | string[]; help?: boolean; s?: string | string[]; + time?: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)'; v?: boolean; } @@ -143,6 +138,7 @@ export interface CatPendingTasks extends Generic { h?: string | string[]; help?: boolean; s?: string | string[]; + time?: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)'; v?: boolean; } @@ -159,11 +155,13 @@ export interface CatPlugins extends Generic { export interface CatRecovery extends Generic { index?: string | string[]; format?: string; + active_only?: boolean; bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb'; - master_timeout?: string; + detailed?: boolean; h?: string | string[]; help?: boolean; s?: string | string[]; + time?: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)'; v?: boolean; } @@ -196,6 +194,7 @@ export interface CatShards extends Generic { h?: string | string[]; help?: boolean; s?: string | string[]; + time?: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)'; v?: boolean; } @@ -207,6 +206,7 @@ export interface CatSnapshots extends Generic { h?: string | string[]; help?: boolean; s?: string | string[]; + time?: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)'; v?: boolean; } @@ -219,6 +219,7 @@ export interface CatTasks extends Generic { h?: string | string[]; help?: boolean; s?: string | string[]; + time?: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)'; v?: boolean; } @@ -351,7 +352,7 @@ export interface Create extends Generic { routing?: string; timeout?: string; version?: number; - version_type?: 'internal' | 'external' | 'external_gte' | 'force'; + version_type?: 'internal' | 'external' | 'external_gte'; pipeline?: string; body: T; } @@ -373,8 +374,6 @@ export interface Delete extends Generic { export interface DeleteByQuery extends Generic { index: string | string[]; type?: string | string[]; - _source_exclude?: string | string[]; - _source_include?: string | string[]; analyze_wildcard?: boolean; default_operator?: 'AND' | 'OR'; df?: string; @@ -425,8 +424,6 @@ export interface Exists extends Generic { id: string; index: string; type?: string; - _source_exclude?: string | string[]; - _source_include?: string | string[]; stored_fields?: string | string[]; preference?: string; realtime?: boolean; @@ -443,8 +440,6 @@ export interface ExistsSource extends Generic { id: string; index: string; type?: string; - _source_exclude?: string | string[]; - _source_include?: string | string[]; preference?: string; realtime?: boolean; refresh?: boolean; @@ -460,8 +455,6 @@ export interface Explain extends Generic { id: string; index: string; type?: string; - _source_exclude?: string | string[]; - _source_include?: string | string[]; analyze_wildcard?: boolean; analyzer?: string; default_operator?: 'AND' | 'OR'; @@ -490,8 +483,6 @@ export interface Get extends Generic { id: string; index: string; type?: string; - _source_exclude?: string | string[]; - _source_include?: string | string[]; stored_fields?: string | string[]; preference?: string; realtime?: boolean; @@ -513,8 +504,6 @@ export interface GetSource extends Generic { id: string; index: string; type?: string; - _source_exclude?: string | string[]; - _source_include?: string | string[]; preference?: string; realtime?: boolean; refresh?: boolean; @@ -536,7 +525,7 @@ export interface Index extends Generic { routing?: string; timeout?: string; version?: number; - version_type?: 'internal' | 'external' | 'external_gte' | 'force'; + version_type?: 'internal' | 'external' | 'external_gte'; if_seq_no?: number; if_primary_term?: number; pipeline?: string; @@ -935,8 +924,6 @@ export interface IngestSimulate extends Generic { export interface Mget extends Generic { index?: string; type?: string; - _source_exclude?: string | string[]; - _source_include?: string | string[]; stored_fields?: string | string[]; preference?: string; realtime?: boolean; @@ -1086,8 +1073,6 @@ export interface Scroll extends Generic { export interface Search extends Generic { index?: string | string[]; type?: string | string[]; - _source_exclude?: string | string[]; - _source_include?: string | string[]; analyzer?: string; analyze_wildcard?: boolean; ccs_minimize_roundtrips?: boolean; @@ -1276,8 +1261,6 @@ export interface Update extends Generic { id: string; index: string; type?: string; - _source_exclude?: string | string[]; - _source_include?: string | string[]; wait_for_active_shards?: string; _source?: string | string[]; _source_excludes?: string | string[]; @@ -1295,8 +1278,6 @@ export interface Update extends Generic { export interface UpdateByQuery extends Generic { index: string | string[]; type?: string | string[]; - _source_exclude?: string | string[]; - _source_include?: string | string[]; analyzer?: string; analyze_wildcard?: boolean; default_operator?: 'AND' | 'OR'; @@ -1367,6 +1348,10 @@ export interface CcrGetAutoFollowPattern extends Generic { name?: string; } +export interface CcrPauseAutoFollowPattern extends Generic { + name: string; +} + export interface CcrPauseFollow extends Generic { index: string; } @@ -1376,6 +1361,10 @@ export interface CcrPutAutoFollowPattern extends Generic { body: T; } +export interface CcrResumeAutoFollowPattern extends Generic { + name: string; +} + export interface CcrResumeFollow extends Generic { index: string; body?: T; @@ -1388,53 +1377,74 @@ export interface CcrUnfollow extends Generic { index: string; } -export interface DataFrameDeleteDataFrameTransform extends Generic { +export interface DataFrameTransformDeprecatedDeleteTransform extends Generic { transform_id: string; force?: boolean; } -export interface DataFrameGetDataFrameTransform extends Generic { +export interface DataFrameTransformDeprecatedGetTransform extends Generic { transform_id?: string; from?: number; size?: number; allow_no_match?: boolean; } -export interface DataFrameGetDataFrameTransformStats extends Generic { +export interface DataFrameTransformDeprecatedGetTransformStats extends Generic { transform_id: string; from?: number; size?: number; allow_no_match?: boolean; } -export interface DataFramePreviewDataFrameTransform extends Generic { +export interface DataFrameTransformDeprecatedPreviewTransform extends Generic { body: T; } -export interface DataFramePutDataFrameTransform extends Generic { +export interface DataFrameTransformDeprecatedPutTransform extends Generic { transform_id: string; defer_validation?: boolean; body: T; } -export interface DataFrameStartDataFrameTransform extends Generic { +export interface DataFrameTransformDeprecatedStartTransform extends Generic { transform_id: string; timeout?: string; } -export interface DataFrameStopDataFrameTransform extends Generic { +export interface DataFrameTransformDeprecatedStopTransform extends Generic { transform_id: string; wait_for_completion?: boolean; timeout?: string; allow_no_match?: boolean; } -export interface DataFrameUpdateDataFrameTransform extends Generic { +export interface DataFrameTransformDeprecatedUpdateTransform extends Generic { transform_id: string; defer_validation?: boolean; body: T; } +export interface EnrichDeletePolicy extends Generic { + name: string; +} + +export interface EnrichExecutePolicy extends Generic { + name: string; + wait_for_completion?: boolean; +} + +export interface EnrichGetPolicy extends Generic { + name?: string; +} + +export interface EnrichPutPolicy extends Generic { + name: string; + body: T; +} + +export interface EnrichStats extends Generic { +} + export interface GraphExplore extends Generic { index: string | string[]; type?: string | string[]; @@ -1998,6 +2008,7 @@ export interface SecurityGetApiKey extends Generic { name?: string; username?: string; realm_name?: string; + owner?: boolean; } export interface SecurityGetBuiltinPrivileges extends Generic { @@ -2071,8 +2082,14 @@ export interface SlmExecuteLifecycle extends Generic { policy_id: string; } +export interface SlmExecuteRetention extends Generic { +} + export interface SlmGetLifecycle extends Generic { - policy_id?: string; + policy_id?: string | string[]; +} + +export interface SlmGetStats extends Generic { } export interface SlmPutLifecycle extends Generic { @@ -2096,6 +2113,53 @@ export interface SqlTranslate extends Generic { export interface SslCertificates extends Generic { } +export interface TransformDeleteTransform extends Generic { + transform_id: string; + force?: boolean; +} + +export interface TransformGetTransform extends Generic { + transform_id?: string; + from?: number; + size?: number; + allow_no_match?: boolean; +} + +export interface TransformGetTransformStats extends Generic { + transform_id: string; + from?: number; + size?: number; + allow_no_match?: boolean; +} + +export interface TransformPreviewTransform extends Generic { + body: T; +} + +export interface TransformPutTransform extends Generic { + transform_id: string; + defer_validation?: boolean; + body: T; +} + +export interface TransformStartTransform extends Generic { + transform_id: string; + timeout?: string; +} + +export interface TransformStopTransform extends Generic { + transform_id: string; + wait_for_completion?: boolean; + timeout?: string; + allow_no_match?: boolean; +} + +export interface TransformUpdateTransform extends Generic { + transform_id: string; + defer_validation?: boolean; + body: T; +} + export interface WatcherAckWatch extends Generic { watch_id: string; action_id?: string | string[]; diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 6e3eecd48..8e73bea95 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -1,18 +1,12 @@ [[api-reference]] == API Reference -This document contains the entire list of the {es} API supported by the client, -both OSS and commercial. The client is entirely licensed under Apache 2.0. +This document contains the entire list of the Elasticsearch API supported by the client, both OSS and commercial. The client is entirely licensed under Apache 2.0. -{es} exposes an HTTP layer to communicate with, and the client is a library that -helps you do this. Because of this reason, you will see HTTP related parameters, -such as `body` or `headers`. +Elasticsearch exposes an HTTP layer to communicate with, and the client is a library that will help you do this. Because of this reason, you will see HTTP related parameters, such as `body` or `headers`. -Every API can accept two objects, the first contains all the parameters that -will be sent to {es}, while the second includes the request specific parameters, -such as timeouts, headers, and so on. In the first object, every parameter but -the body will be sent via querystring or url parameter, depending on the API, -and every unrecognized parameter will be sent as querystring. +Every API can accept two objects, the first contains all the parameters that will be sent to Elasticsearch, while the second includes the request specific parameters, such as timeouts, headers, and so on. +In the first object, every parameter but the body will be sent via querystring or url parameter, depending on the API, and every unrecognized parameter will be sent as querystring. [source,js] ---- @@ -41,10 +35,7 @@ client.search({ }) ---- -In this document, you will find the reference of every parameter accepted by the -querystring or the url. If you also need to send the body, you can find the -documentation of its format in the reference link that is present along with -every endpoint. +In this document, you will find the reference of every parameter accepted by the querystring or the url. If you also need to send the body, you can find the documentation of its format in the reference link that is present along with every endpoint. //////// @@ -142,7 +133,6 @@ client.cat.aliases({ name: string | string[], format: string, local: boolean, - master_timeout: string, h: string | string[], help: boolean, s: string | string[], @@ -161,9 +151,6 @@ link:{ref}/cat-alias.html[Reference] |`local` |`boolean` - Return local information, do not retrieve the state from master node (default: false) -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - |`h` |`string \| string[]` - Comma-separated list of column names to display @@ -233,8 +220,6 @@ link:{ref}/cat-allocation.html[Reference] client.cat.count({ index: string | string[], format: string, - local: boolean, - master_timeout: string, h: string | string[], help: boolean, s: string | string[], @@ -250,12 +235,6 @@ link:{ref}/cat-count.html[Reference] |`format` |`string` - a short version of the Accept header, e.g. json, yaml -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - |`h` |`string \| string[]` - Comma-separated list of column names to display @@ -278,8 +257,6 @@ client.cat.fielddata({ fields: string | string[], format: string, bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb', - local: boolean, - master_timeout: string, h: string | string[], help: boolean, s: string | string[], @@ -298,12 +275,6 @@ link:{ref}/cat-fielddata.html[Reference] |`bytes` |`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - |`h` |`string \| string[]` - Comma-separated list of column names to display @@ -324,11 +295,10 @@ link:{ref}/cat-fielddata.html[Reference] ---- client.cat.health({ format: string, - local: boolean, - master_timeout: string, h: string | string[], help: boolean, s: string | string[], + time: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)', ts: boolean, v: boolean }) @@ -339,12 +309,6 @@ link:{ref}/cat-health.html[Reference] |`format` |`string` - a short version of the Accept header, e.g. json, yaml -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - |`h` |`string \| string[]` - Comma-separated list of column names to display @@ -354,6 +318,9 @@ link:{ref}/cat-health.html[Reference] |`s` |`string \| string[]` - Comma-separated list of column names or column aliases to sort by +|`time` +|`'d (Days)' \| 'h (Hours)' \| 'm (Minutes)' \| 's (Seconds)' \| 'ms (Milliseconds)' \| 'micros (Microseconds)' \| 'nanos (Nanoseconds)'` - The unit in which to display time values + |`ts` |`boolean` - Set to false to disable timestamping + _Default:_ `true` @@ -398,6 +365,7 @@ client.cat.indices({ help: boolean, pri: boolean, s: string | string[], + time: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)', v: boolean, include_unloaded_segments: boolean }) @@ -435,6 +403,9 @@ link:{ref}/cat-indices.html[Reference] |`s` |`string \| string[]` - Comma-separated list of column names or column aliases to sort by +|`time` +|`'d (Days)' \| 'h (Hours)' \| 'm (Minutes)' \| 's (Seconds)' \| 'ms (Milliseconds)' \| 'micros (Microseconds)' \| 'nanos (Nanoseconds)'` - The unit in which to display time values + |`v` |`boolean` - Verbose mode. Display column headers @@ -528,6 +499,7 @@ link:{ref}/cat-nodeattrs.html[Reference] [source,ts] ---- client.cat.nodes({ + bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb', format: string, full_id: boolean, local: boolean, @@ -535,12 +507,16 @@ client.cat.nodes({ h: string | string[], help: boolean, s: string | string[], + time: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)', v: boolean }) ---- link:{ref}/cat-nodes.html[Reference] [cols=2*] |=== +|`bytes` +|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values + |`format` |`string` - a short version of the Accept header, e.g. json, yaml @@ -562,6 +538,9 @@ link:{ref}/cat-nodes.html[Reference] |`s` |`string \| string[]` - Comma-separated list of column names or column aliases to sort by +|`time` +|`'d (Days)' \| 'h (Hours)' \| 'm (Minutes)' \| 's (Seconds)' \| 'ms (Milliseconds)' \| 'micros (Microseconds)' \| 'nanos (Nanoseconds)'` - The unit in which to display time values + |`v` |`boolean` - Verbose mode. Display column headers @@ -578,6 +557,7 @@ client.cat.pendingTasks({ h: string | string[], help: boolean, s: string | string[], + time: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)', v: boolean }) ---- @@ -602,6 +582,9 @@ link:{ref}/cat-pending-tasks.html[Reference] |`s` |`string \| string[]` - Comma-separated list of column names or column aliases to sort by +|`time` +|`'d (Days)' \| 'h (Hours)' \| 'm (Minutes)' \| 's (Seconds)' \| 'ms (Milliseconds)' \| 'micros (Microseconds)' \| 'nanos (Nanoseconds)'` - The unit in which to display time values + |`v` |`boolean` - Verbose mode. Display column headers @@ -654,11 +637,13 @@ link:{ref}/cat-plugins.html[Reference] client.cat.recovery({ index: string | string[], format: string, + active_only: boolean, bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb', - master_timeout: string, + detailed: boolean, h: string | string[], help: boolean, s: string | string[], + time: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)', v: boolean }) ---- @@ -666,16 +651,19 @@ link:{ref}/cat-recovery.html[Reference] [cols=2*] |=== |`index` -|`string \| string[]` - A comma-separated list of index names to limit the returned information +|`string \| string[]` - Comma-separated list or wildcard expression of index names to limit the returned information |`format` |`string` - a short version of the Accept header, e.g. json, yaml +|`active_only` or `activeOnly` +|`boolean` - If `true`, the response only includes ongoing shard recoveries + |`bytes` |`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node +|`detailed` +|`boolean` - If `true`, the response includes detailed information about shard recoveries |`h` |`string \| string[]` - Comma-separated list of column names to display @@ -686,6 +674,9 @@ link:{ref}/cat-recovery.html[Reference] |`s` |`string \| string[]` - Comma-separated list of column names or column aliases to sort by +|`time` +|`'d (Days)' \| 'h (Hours)' \| 'm (Minutes)' \| 's (Seconds)' \| 'ms (Milliseconds)' \| 'micros (Microseconds)' \| 'nanos (Nanoseconds)'` - The unit in which to display time values + |`v` |`boolean` - Verbose mode. Display column headers @@ -784,6 +775,7 @@ client.cat.shards({ h: string | string[], help: boolean, s: string | string[], + time: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)', v: boolean }) ---- @@ -814,6 +806,9 @@ link:{ref}/cat-shards.html[Reference] |`s` |`string \| string[]` - Comma-separated list of column names or column aliases to sort by +|`time` +|`'d (Days)' \| 'h (Hours)' \| 'm (Minutes)' \| 's (Seconds)' \| 'ms (Milliseconds)' \| 'micros (Microseconds)' \| 'nanos (Nanoseconds)'` - The unit in which to display time values + |`v` |`boolean` - Verbose mode. Display column headers @@ -831,6 +826,7 @@ client.cat.snapshots({ h: string | string[], help: boolean, s: string | string[], + time: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)', v: boolean }) ---- @@ -858,6 +854,9 @@ link:{ref}/cat-snapshots.html[Reference] |`s` |`string \| string[]` - Comma-separated list of column names or column aliases to sort by +|`time` +|`'d (Days)' \| 'h (Hours)' \| 'm (Minutes)' \| 's (Seconds)' \| 'ms (Milliseconds)' \| 'micros (Microseconds)' \| 'nanos (Nanoseconds)'` - The unit in which to display time values + |`v` |`boolean` - Verbose mode. Display column headers @@ -876,6 +875,7 @@ client.cat.tasks({ h: string | string[], help: boolean, s: string | string[], + time: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)', v: boolean }) ---- @@ -906,6 +906,9 @@ link:{ref}/tasks.html[Reference] |`s` |`string \| string[]` - Comma-separated list of column names or column aliases to sort by +|`time` +|`'d (Days)' \| 'h (Hours)' \| 'm (Minutes)' \| 's (Seconds)' \| 'ms (Milliseconds)' \| 'micros (Microseconds)' \| 'nanos (Nanoseconds)'` - The unit in which to display time values + |`v` |`boolean` - Verbose mode. Display column headers @@ -1408,7 +1411,7 @@ client.create({ routing: string, timeout: string, version: number, - version_type: 'internal' | 'external' | 'external_gte' | 'force', + version_type: 'internal' | 'external' | 'external_gte', pipeline: string, body: object }) @@ -1443,7 +1446,7 @@ WARNING: This parameter has been deprecated. |`number` - Explicit version number for concurrency control |`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type +|`'internal' \| 'external' \| 'external_gte'` - Specific version type |`pipeline` |`string` - The pipeline id to preprocess incoming documents with @@ -2119,7 +2122,7 @@ client.index({ routing: string, timeout: string, version: number, - version_type: 'internal' | 'external' | 'external_gte' | 'force', + version_type: 'internal' | 'external' | 'external_gte', if_seq_no: number, if_primary_term: number, pipeline: string, @@ -2144,8 +2147,7 @@ WARNING: This parameter has been deprecated. |`string` - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) |`op_type` or `opType` -|`'index' \| 'create'` - Explicit operation type + -_Default:_ `index` +|`'index' \| 'create'` - Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID |`refresh` |`'true' \| 'false' \| 'wait_for'` - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. @@ -2160,7 +2162,7 @@ _Default:_ `index` |`number` - Explicit version number for concurrency control |`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type +|`'internal' \| 'external' \| 'external_gte'` - Specific version type |`if_seq_no` or `ifSeqNo` |`number` - only perform the index operation if the last operation that has changed the document has the specified sequence number @@ -5507,6 +5509,22 @@ link:{ref}/ccr-get-auto-follow-pattern.html[Reference] |=== +=== ccr.pauseAutoFollowPattern + +[source,ts] +---- +client.ccr.pauseAutoFollowPattern({ + name: string +}) +---- +link:{ref}/ccr-pause-auto-follow-pattern.html[Reference] +[cols=2*] +|=== +|`name` +|`string` - The name of the auto follow pattern that should pause discovering new indices to follow. + +|=== + === ccr.pauseFollow [source,ts] @@ -5543,6 +5561,22 @@ link:{ref}/ccr-put-auto-follow-pattern.html[Reference] |=== +=== ccr.resumeAutoFollowPattern + +[source,ts] +---- +client.ccr.resumeAutoFollowPattern({ + name: string +}) +---- +link:{ref}/ccr-resume-auto-follow-pattern.html[Reference] +[cols=2*] +|=== +|`name` +|`string` - The name of the auto follow pattern to resume discovering new indices to follow. + +|=== + === ccr.resumeFollow [source,ts] @@ -5588,11 +5622,11 @@ link:http://www.elastic.co/guide/en/elasticsearch/reference/current[Reference] |=== -=== dataFrame.deleteDataFrameTransform +=== dataFrameTransformDeprecated.deleteTransform *Stability:* beta [source,ts] ---- -client.dataFrame.deleteDataFrameTransform({ +client.dataFrameTransformDeprecated.deleteTransform({ transform_id: string, force: boolean }) @@ -5608,11 +5642,11 @@ link:{ref}/delete-transform.html[Reference] |=== -=== dataFrame.getDataFrameTransform +=== dataFrameTransformDeprecated.getTransform *Stability:* beta [source,ts] ---- -client.dataFrame.getDataFrameTransform({ +client.dataFrameTransformDeprecated.getTransform({ transform_id: string, from: number, size: number, @@ -5632,15 +5666,15 @@ link:{ref}/get-transform.html[Reference] |`number` - specifies a max number of transforms to get, defaults to 100 |`allow_no_match` or `allowNoMatch` -|`boolean` - Whether to ignore if a wildcard expression matches no data frame transforms. (This includes `_all` string or when no data frame transforms have been specified) +|`boolean` - Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |=== -=== dataFrame.getDataFrameTransformStats +=== dataFrameTransformDeprecated.getTransformStats *Stability:* beta [source,ts] ---- -client.dataFrame.getDataFrameTransformStats({ +client.dataFrameTransformDeprecated.getTransformStats({ transform_id: string, from: number, size: number, @@ -5660,15 +5694,15 @@ link:{ref}/get-transform-stats.html[Reference] |`number` - specifies a max number of transform stats to get, defaults to 100 |`allow_no_match` or `allowNoMatch` -|`boolean` - Whether to ignore if a wildcard expression matches no data frame transforms. (This includes `_all` string or when no data frame transforms have been specified) +|`boolean` - Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |=== -=== dataFrame.previewDataFrameTransform +=== dataFrameTransformDeprecated.previewTransform *Stability:* beta [source,ts] ---- -client.dataFrame.previewDataFrameTransform({ +client.dataFrameTransformDeprecated.previewTransform({ body: object }) ---- @@ -5676,15 +5710,15 @@ link:{ref}/preview-transform.html[Reference] [cols=2*] |=== |`body` -|`object` - The definition for the data_frame transform to preview +|`object` - The definition for the transform to preview |=== -=== dataFrame.putDataFrameTransform +=== dataFrameTransformDeprecated.putTransform *Stability:* beta [source,ts] ---- -client.dataFrame.putDataFrameTransform({ +client.dataFrameTransformDeprecated.putTransform({ transform_id: string, defer_validation: boolean, body: object @@ -5697,18 +5731,18 @@ link:{ref}/put-transform.html[Reference] |`string` - The id of the new transform. |`defer_validation` or `deferValidation` -|`boolean` - If validations should be deferred until data frame transform starts, defaults to false. +|`boolean` - If validations should be deferred until transform starts, defaults to false. |`body` -|`object` - The data frame transform definition +|`object` - The transform definition |=== -=== dataFrame.startDataFrameTransform +=== dataFrameTransformDeprecated.startTransform *Stability:* beta [source,ts] ---- -client.dataFrame.startDataFrameTransform({ +client.dataFrameTransformDeprecated.startTransform({ transform_id: string, timeout: string }) @@ -5724,11 +5758,11 @@ link:{ref}/start-transform.html[Reference] |=== -=== dataFrame.stopDataFrameTransform +=== dataFrameTransformDeprecated.stopTransform *Stability:* beta [source,ts] ---- -client.dataFrame.stopDataFrameTransform({ +client.dataFrameTransformDeprecated.stopTransform({ transform_id: string, wait_for_completion: boolean, timeout: string, @@ -5748,15 +5782,15 @@ link:{ref}/stop-transform.html[Reference] |`string` - Controls the time to wait until the transform has stopped. Default to 30 seconds |`allow_no_match` or `allowNoMatch` -|`boolean` - Whether to ignore if a wildcard expression matches no data frame transforms. (This includes `_all` string or when no data frame transforms have been specified) +|`boolean` - Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |=== -=== dataFrame.updateDataFrameTransform +=== dataFrameTransformDeprecated.updateTransform *Stability:* beta [source,ts] ---- -client.dataFrame.updateDataFrameTransform({ +client.dataFrameTransformDeprecated.updateTransform({ transform_id: string, defer_validation: boolean, body: object @@ -5769,13 +5803,90 @@ link:{ref}/update-transform.html[Reference] |`string` - The id of the transform. |`defer_validation` or `deferValidation` -|`boolean` - If validations should be deferred until data frame transform starts, defaults to false. +|`boolean` - If validations should be deferred until transform starts, defaults to false. + +|`body` +|`object` - The update transform definition + +|=== + +=== enrich.deletePolicy + +[source,ts] +---- +client.enrich.deletePolicy({ + name: string +}) +---- +[cols=2*] +|=== +|`name` +|`string` - The name of the enrich policy + +|=== + +=== enrich.executePolicy + +[source,ts] +---- +client.enrich.executePolicy({ + name: string, + wait_for_completion: boolean +}) +---- +[cols=2*] +|=== +|`name` +|`string` - The name of the enrich policy + +|`wait_for_completion` or `waitForCompletion` +|`boolean` - Should the request should block until the execution is complete. + +_Default:_ `true` + +|=== + +=== enrich.getPolicy + +[source,ts] +---- +client.enrich.getPolicy({ + name: string +}) +---- +[cols=2*] +|=== +|`name` +|`string` - The name of the enrich policy + +|=== + +=== enrich.putPolicy + +[source,ts] +---- +client.enrich.putPolicy({ + name: string, + body: object +}) +---- +[cols=2*] +|=== +|`name` +|`string` - The name of the enrich policy |`body` -|`object` - The update data frame transform definition +|`object` - The enrich policy to register |=== +=== enrich.stats + +[source,ts] +---- +client.enrich.stats() +---- + + === graph.explore [source,ts] @@ -6408,6 +6519,22 @@ link:{ref}/ml-delete-snapshot.html[Reference] |=== +=== ml.estimateMemoryUsage +*Stability:* experimental +[source,ts] +---- +client.ml.estimateMemoryUsage({ + body: object +}) +---- +link:{ref}/estimate-memory-usage-dfanalytics.html[Reference] +[cols=2*] +|=== +|`body` +|`object` - Memory usage estimation definition + +|=== + === ml.evaluateDataFrame *Stability:* experimental [source,ts] @@ -7965,7 +8092,8 @@ client.security.getApiKey({ id: string, name: string, username: string, - realm_name: string + realm_name: string, + owner: boolean }) ---- link:{ref}/security-api-get-api-key.html[Reference] @@ -7983,6 +8111,9 @@ link:{ref}/security-api-get-api-key.html[Reference] |`realm_name` or `realmName` |`string` - realm name of the user who created this API key to be retrieved +|`owner` +|`boolean` - flag to query API keys owned by the currently authenticated user + |=== === security.getBuiltinPrivileges @@ -8263,22 +8394,40 @@ link:{ref}/slm-api-execute.html[Reference] |=== +=== slm.executeRetention + +[source,ts] +---- +client.slm.executeRetention() +---- +link:{ref}/slm-api-execute-retention.html[Reference] + + === slm.getLifecycle [source,ts] ---- client.slm.getLifecycle({ - policy_id: string + policy_id: string | string[] }) ---- link:{ref}/slm-api-get.html[Reference] [cols=2*] |=== |`policy_id` or `policyId` -|`string` - Comma-separated list of snapshot lifecycle policies to retrieve +|`string \| string[]` - Comma-separated list of snapshot lifecycle policies to retrieve |=== +=== slm.getStats + +[source,ts] +---- +client.slm.getStats() +---- +link:{ref}/slm-get-stats.html[Reference] + + === slm.putLifecycle [source,ts] @@ -8360,6 +8509,194 @@ client.ssl.certificates() link:{ref}/security-api-ssl.html[Reference] +=== transform.deleteTransform +*Stability:* beta +[source,ts] +---- +client.transform.deleteTransform({ + transform_id: string, + force: boolean +}) +---- +link:{ref}/delete-transform.html[Reference] +[cols=2*] +|=== +|`transform_id` or `transformId` +|`string` - The id of the transform to delete + +|`force` +|`boolean` - When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted. + +|=== + +=== transform.getTransform +*Stability:* beta +[source,ts] +---- +client.transform.getTransform({ + transform_id: string, + from: number, + size: number, + allow_no_match: boolean +}) +---- +link:{ref}/get-transform.html[Reference] +[cols=2*] +|=== +|`transform_id` or `transformId` +|`string` - The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms + +|`from` +|`number` - skips a number of transform configs, defaults to 0 + +|`size` +|`number` - specifies a max number of transforms to get, defaults to 100 + +|`allow_no_match` or `allowNoMatch` +|`boolean` - Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) + +|=== + +=== transform.getTransformStats +*Stability:* beta +[source,ts] +---- +client.transform.getTransformStats({ + transform_id: string, + from: number, + size: number, + allow_no_match: boolean +}) +---- +link:{ref}/get-transform-stats.html[Reference] +[cols=2*] +|=== +|`transform_id` or `transformId` +|`string` - The id of the transform for which to get stats. '_all' or '*' implies all transforms + +|`from` +|`number` - skips a number of transform stats, defaults to 0 + +|`size` +|`number` - specifies a max number of transform stats to get, defaults to 100 + +|`allow_no_match` or `allowNoMatch` +|`boolean` - Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) + +|=== + +=== transform.previewTransform +*Stability:* beta +[source,ts] +---- +client.transform.previewTransform({ + body: object +}) +---- +link:{ref}/preview-transform.html[Reference] +[cols=2*] +|=== +|`body` +|`object` - The definition for the transform to preview + +|=== + +=== transform.putTransform +*Stability:* beta +[source,ts] +---- +client.transform.putTransform({ + transform_id: string, + defer_validation: boolean, + body: object +}) +---- +link:{ref}/put-transform.html[Reference] +[cols=2*] +|=== +|`transform_id` or `transformId` +|`string` - The id of the new transform. + +|`defer_validation` or `deferValidation` +|`boolean` - If validations should be deferred until transform starts, defaults to false. + +|`body` +|`object` - The transform definition + +|=== + +=== transform.startTransform +*Stability:* beta +[source,ts] +---- +client.transform.startTransform({ + transform_id: string, + timeout: string +}) +---- +link:{ref}/start-transform.html[Reference] +[cols=2*] +|=== +|`transform_id` or `transformId` +|`string` - The id of the transform to start + +|`timeout` +|`string` - Controls the time to wait for the transform to start + +|=== + +=== transform.stopTransform +*Stability:* beta +[source,ts] +---- +client.transform.stopTransform({ + transform_id: string, + wait_for_completion: boolean, + timeout: string, + allow_no_match: boolean +}) +---- +link:{ref}/stop-transform.html[Reference] +[cols=2*] +|=== +|`transform_id` or `transformId` +|`string` - The id of the transform to stop + +|`wait_for_completion` or `waitForCompletion` +|`boolean` - Whether to wait for the transform to fully stop before returning or not. Default to false + +|`timeout` +|`string` - Controls the time to wait until the transform has stopped. Default to 30 seconds + +|`allow_no_match` or `allowNoMatch` +|`boolean` - Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) + +|=== + +=== transform.updateTransform +*Stability:* beta +[source,ts] +---- +client.transform.updateTransform({ + transform_id: string, + defer_validation: boolean, + body: object +}) +---- +link:{ref}/update-transform.html[Reference] +[cols=2*] +|=== +|`transform_id` or `transformId` +|`string` - The id of the transform. + +|`defer_validation` or `deferValidation` +|`boolean` - If validations should be deferred until transform starts, defaults to false. + +|`body` +|`object` - The update transform definition + +|=== + === watcher.ackWatch [source,ts] diff --git a/index.d.ts b/index.d.ts index a23793e36..219bf54e9 100644 --- a/index.d.ts +++ b/index.d.ts @@ -151,10 +151,14 @@ declare class Client extends EventEmitter { forgetFollower: ApiMethod get_auto_follow_pattern: ApiMethod getAutoFollowPattern: ApiMethod + pause_auto_follow_pattern: ApiMethod + pauseAutoFollowPattern: ApiMethod pause_follow: ApiMethod pauseFollow: ApiMethod put_auto_follow_pattern: ApiMethod putAutoFollowPattern: ApiMethod + resume_auto_follow_pattern: ApiMethod + resumeAutoFollowPattern: ApiMethod resume_follow: ApiMethod resumeFollow: ApiMethod stats: ApiMethod @@ -180,41 +184,41 @@ declare class Client extends EventEmitter { } count: ApiMethod create: ApiMethod - data_frame: { - delete_data_frame_transform: ApiMethod - deleteDataFrameTransform: ApiMethod - get_data_frame_transform: ApiMethod - getDataFrameTransform: ApiMethod - get_data_frame_transform_stats: ApiMethod - getDataFrameTransformStats: ApiMethod - preview_data_frame_transform: ApiMethod - previewDataFrameTransform: ApiMethod - put_data_frame_transform: ApiMethod - putDataFrameTransform: ApiMethod - start_data_frame_transform: ApiMethod - startDataFrameTransform: ApiMethod - stop_data_frame_transform: ApiMethod - stopDataFrameTransform: ApiMethod - update_data_frame_transform: ApiMethod - updateDataFrameTransform: ApiMethod + data_frame_transform_deprecated: { + delete_transform: ApiMethod + deleteTransform: ApiMethod + get_transform: ApiMethod + getTransform: ApiMethod + get_transform_stats: ApiMethod + getTransformStats: ApiMethod + preview_transform: ApiMethod + previewTransform: ApiMethod + put_transform: ApiMethod + putTransform: ApiMethod + start_transform: ApiMethod + startTransform: ApiMethod + stop_transform: ApiMethod + stopTransform: ApiMethod + update_transform: ApiMethod + updateTransform: ApiMethod } - dataFrame: { - delete_data_frame_transform: ApiMethod - deleteDataFrameTransform: ApiMethod - get_data_frame_transform: ApiMethod - getDataFrameTransform: ApiMethod - get_data_frame_transform_stats: ApiMethod - getDataFrameTransformStats: ApiMethod - preview_data_frame_transform: ApiMethod - previewDataFrameTransform: ApiMethod - put_data_frame_transform: ApiMethod - putDataFrameTransform: ApiMethod - start_data_frame_transform: ApiMethod - startDataFrameTransform: ApiMethod - stop_data_frame_transform: ApiMethod - stopDataFrameTransform: ApiMethod - update_data_frame_transform: ApiMethod - updateDataFrameTransform: ApiMethod + dataFrameTransformDeprecated: { + delete_transform: ApiMethod + deleteTransform: ApiMethod + get_transform: ApiMethod + getTransform: ApiMethod + get_transform_stats: ApiMethod + getTransformStats: ApiMethod + preview_transform: ApiMethod + previewTransform: ApiMethod + put_transform: ApiMethod + putTransform: ApiMethod + start_transform: ApiMethod + startTransform: ApiMethod + stop_transform: ApiMethod + stopTransform: ApiMethod + update_transform: ApiMethod + updateTransform: ApiMethod } delete: ApiMethod delete_by_query: ApiMethod @@ -223,6 +227,17 @@ declare class Client extends EventEmitter { deleteByQueryRethrottle: ApiMethod delete_script: ApiMethod deleteScript: ApiMethod + enrich: { + delete_policy: ApiMethod + deletePolicy: ApiMethod + execute_policy: ApiMethod + executePolicy: ApiMethod + get_policy: ApiMethod + getPolicy: ApiMethod + put_policy: ApiMethod + putPolicy: ApiMethod + stats: ApiMethod + } exists: ApiMethod exists_source: ApiMethod existsSource: ApiMethod @@ -567,8 +582,12 @@ declare class Client extends EventEmitter { deleteLifecycle: ApiMethod execute_lifecycle: ApiMethod executeLifecycle: ApiMethod + execute_retention: ApiMethod + executeRetention: ApiMethod get_lifecycle: ApiMethod getLifecycle: ApiMethod + get_stats: ApiMethod + getStats: ApiMethod put_lifecycle: ApiMethod putLifecycle: ApiMethod } @@ -604,6 +623,24 @@ declare class Client extends EventEmitter { list: ApiMethod } termvectors: ApiMethod + transform: { + delete_transform: ApiMethod + deleteTransform: ApiMethod + get_transform: ApiMethod + getTransform: ApiMethod + get_transform_stats: ApiMethod + getTransformStats: ApiMethod + preview_transform: ApiMethod + previewTransform: ApiMethod + put_transform: ApiMethod + putTransform: ApiMethod + start_transform: ApiMethod + startTransform: ApiMethod + stop_transform: ApiMethod + stopTransform: ApiMethod + update_transform: ApiMethod + updateTransform: ApiMethod + } update: ApiMethod update_by_query: ApiMethod updateByQuery: ApiMethod From 5ed89b4421988760d20638b6a27c5325d8963b9d Mon Sep 17 00:00:00 2001 From: Tomas Della Vedova Date: Mon, 2 Dec 2019 09:21:03 +0100 Subject: [PATCH 2/8] X-Opaque-Id support (#997) * Added X-Opaque-Id support * Updated type definitions * Updated test * Updated docs --- docs/configuration.asciidoc | 5 +++ docs/observability.asciidoc | 43 +++++++++++++++++++ index.d.ts | 1 + index.js | 6 ++- lib/Transport.d.ts | 3 ++ lib/Transport.js | 7 ++++ test/unit/client.test.js | 84 +++++++++++++++++++++++++++++++++++++ 7 files changed, 147 insertions(+), 2 deletions(-) diff --git a/docs/configuration.asciidoc b/docs/configuration.asciidoc index 12e12685f..630c51142 100644 --- a/docs/configuration.asciidoc +++ b/docs/configuration.asciidoc @@ -181,6 +181,11 @@ function generateRequestId (params, options) { |`string` - The name to identify the client instance in the events. + _Default:_ `elasticsearch-js` +|`opaqueIdPrefix` +|`string` - A string that will be use to prefix any `X-Opaque-Id` header. + +See https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/observability.html#_x-opaque-id_support[`X-Opaque-Id` support] for more details. + +_Default:_ `null` + |`headers` |`object` - A set of custom headers to send in every request. + _Default:_ `{}` diff --git a/docs/observability.asciidoc b/docs/observability.asciidoc index c72c340e1..074654f38 100644 --- a/docs/observability.asciidoc +++ b/docs/observability.asciidoc @@ -248,3 +248,46 @@ child.search({ if (err) console.log(err) }) ---- + +=== X-Opaque-Id support +To improve the overall observability, the client offers an easy way to configure the `X-Opaque-Id` header. If you set the `X-Opaque-Id` in a specific request, this will allow you to discover this identifier in the https://www.elastic.co/guide/en/elasticsearch/reference/master/logging.html#deprecation-logging[deprecation logs], help you with https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-slowlog.html#_identifying_search_slow_log_origin[identifying search slow log origin] as well as https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html#_identifying_running_tasks[identifying running tasks]. + +The `X-Opaque-Id` should be configured in each request, for doing that you can use the `opaqueId` option, as you can see in the following example. + +The resulting header will be `{ 'X-Opaque-Id': 'my-search' }`. + +[source,js] +---- +const { Client } = require('@elastic/elasticsearch') +const client = new Client({ + node: 'http://localhost:9200' +}) + +client.search({ + index: 'my-index', + body: { foo: 'bar' } +}, { + opaqueId: 'my-search' +}, (err, result) => { + if (err) console.log(err) +}) +---- + +Sometimes it may be useful to prefix all the `X-Opaque-Id` headers with a specific string, in case you need to identify a specific client or server. For doing this, the client offers a top-level configuration option: `opaqueIdPrefix`. + +In the following example, the resulting header will be `{ 'X-Opaque-Id': 'proxy-client::my-search' }`. +[source,js] +---- +const { Client } = require('@elastic/elasticsearch') +const client = new Client({ + node: 'http://localhost:9200', + opaqueIdPrefix: 'proxy-client::' +}) + +client.search({ + index: 'my-index', + body: { foo: 'bar' } +}, { + opaqueId: 'my-search' +}, (err, result) => { + if (err) console.log(err) +}) +---- diff --git a/index.d.ts b/index.d.ts index 219bf54e9..f785f2420 100644 --- a/index.d.ts +++ b/index.d.ts @@ -94,6 +94,7 @@ interface ClientOptions { nodeFilter?: nodeFilterFn; nodeSelector?: nodeSelectorFn | string; headers?: anyObject; + opaqueIdPrefix?: string; generateRequestId?: generateRequestIdFn; name?: string; auth?: BasicAuth | ApiKeyAuth; diff --git a/index.js b/index.js index 6fc3e7708..0b3fc17c7 100644 --- a/index.js +++ b/index.js @@ -79,7 +79,8 @@ class Client extends EventEmitter { nodeSelector: 'round-robin', generateRequestId: null, name: 'elasticsearch-js', - auth: null + auth: null, + opaqueIdPrefix: null }, opts) this[kInitialOptions] = options @@ -121,7 +122,8 @@ class Client extends EventEmitter { nodeFilter: options.nodeFilter, nodeSelector: options.nodeSelector, generateRequestId: options.generateRequestId, - name: options.name + name: options.name, + opaqueIdPrefix: options.opaqueIdPrefix }) const apis = buildApi({ diff --git a/lib/Transport.d.ts b/lib/Transport.d.ts index 8099de2ea..f0fdae9d4 100644 --- a/lib/Transport.d.ts +++ b/lib/Transport.d.ts @@ -38,6 +38,7 @@ interface TransportOptions { headers?: anyObject; generateRequestId?: generateRequestIdFn; name: string; + opaqueIdPrefix?: string; } export interface RequestEvent { @@ -90,6 +91,7 @@ export interface TransportRequestOptions { id?: any; context?: any; warnings?: [string]; + opaqueId?: string; } export interface TransportRequestCallback { @@ -121,6 +123,7 @@ export default class Transport { compression: 'gzip' | false; sniffInterval: number; sniffOnConnectionFault: boolean; + opaqueIdPrefix: string | null; sniffEndpoint: string; _sniffEnabled: boolean; _nextSniff: number; diff --git a/lib/Transport.js b/lib/Transport.js index 7e5b83681..d00a2e8bb 100644 --- a/lib/Transport.js +++ b/lib/Transport.js @@ -41,6 +41,7 @@ class Transport { this.sniffEndpoint = opts.sniffEndpoint this.generateRequestId = opts.generateRequestId || generateRequestId() this.name = opts.name + this.opaqueIdPrefix = opts.opaqueIdPrefix this.nodeFilter = opts.nodeFilter || defaultNodeFilter if (typeof opts.nodeSelector === 'function') { @@ -114,6 +115,12 @@ class Transport { // TODO: make this assignment FAST const headers = Object.assign({}, this.headers, options.headers) + if (options.opaqueId !== undefined) { + headers['X-Opaque-Id'] = this.opaqueIdPrefix !== null + ? this.opaqueIdPrefix + options.opaqueId + : options.opaqueId + } + // handle json body if (params.body != null) { if (shouldSerialize(params.body) === true) { diff --git a/test/unit/client.test.js b/test/unit/client.test.js index f6a86a985..ca3649379 100644 --- a/test/unit/client.test.js +++ b/test/unit/client.test.js @@ -851,3 +851,87 @@ test('Elastic cloud config', t => { t.end() }) + +test('Opaque Id support', t => { + t.test('No opaqueId', t => { + t.plan(3) + + function handler (req, res) { + t.strictEqual(req.headers['x-opaque-id'], undefined) + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + } + + buildServer(handler, ({ port }, server) => { + const client = new Client({ + node: `http://localhost:${port}` + }) + + client.search({ + index: 'test', + q: 'foo:bar' + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + server.stop() + }) + }) + }) + + t.test('No prefix', t => { + t.plan(3) + + function handler (req, res) { + t.strictEqual(req.headers['x-opaque-id'], 'bar') + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + } + + buildServer(handler, ({ port }, server) => { + const client = new Client({ + node: `http://localhost:${port}` + }) + + client.search({ + index: 'test', + q: 'foo:bar' + }, { + opaqueId: 'bar' + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + server.stop() + }) + }) + }) + + t.test('With prefix', t => { + t.plan(3) + + function handler (req, res) { + t.strictEqual(req.headers['x-opaque-id'], 'foo-bar') + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + } + + buildServer(handler, ({ port }, server) => { + const client = new Client({ + node: `http://localhost:${port}`, + opaqueIdPrefix: 'foo-' + }) + + client.search({ + index: 'test', + q: 'foo:bar' + }, { + opaqueId: 'bar' + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + server.stop() + }) + }) + }) + + t.end() +}) From ac5d482ec6d982cdff6eca090d8daf55212cf4f4 Mon Sep 17 00:00:00 2001 From: delvedor Date: Tue, 3 Dec 2019 10:14:08 +0100 Subject: [PATCH 3/8] Skip data_frame_transform_deprecated.* apis --- scripts/generate.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/generate.js b/scripts/generate.js index 86c944ffc..e1c23de46 100644 --- a/scripts/generate.js +++ b/scripts/generate.js @@ -48,6 +48,7 @@ function start (opts) { const apiFolderContents = readdirSync(apiFolder) const xPackFolderContents = readdirSync(xPackFolder) + .filter(file => !file.startsWith('data_frame_transform_deprecated')) apiFolderContents.forEach(generateApiFile(apiFolder, log)) xPackFolderContents.forEach(generateApiFile(xPackFolder, log)) From e85a133f3065659b79c876850641b4ae0599aced Mon Sep 17 00:00:00 2001 From: delvedor Date: Tue, 3 Dec 2019 10:14:16 +0100 Subject: [PATCH 4/8] API generation --- api/api/bulk.js | 4 + ...e_transform_deprecated.delete_transform.js | 77 ------- ...rame_transform_deprecated.get_transform.js | 73 ------- ...ransform_deprecated.get_transform_stats.js | 79 -------- ..._transform_deprecated.preview_transform.js | 74 ------- ...rame_transform_deprecated.put_transform.js | 81 -------- ...me_transform_deprecated.start_transform.js | 77 ------- ...ame_transform_deprecated.stop_transform.js | 80 -------- ...e_transform_deprecated.update_transform.js | 81 -------- api/api/delete_by_query.js | 4 + api/api/exists.js | 4 + api/api/exists_source.js | 4 + api/api/explain.js | 4 + api/api/get.js | 4 + api/api/get_source.js | 4 + api/api/indices.delete_alias.js | 4 +- api/api/indices.put_alias.js | 4 +- api/api/mget.js | 4 + api/api/nodes.hot_threads.js | 8 +- api/api/search.js | 4 + api/api/update.js | 4 + api/api/update_by_query.js | 4 + api/index.js | 36 ---- api/requestParams.d.ts | 69 ++----- docs/reference.asciidoc | 188 ------------------ index.d.ts | 36 ---- 26 files changed, 74 insertions(+), 937 deletions(-) delete mode 100644 api/api/data_frame_transform_deprecated.delete_transform.js delete mode 100644 api/api/data_frame_transform_deprecated.get_transform.js delete mode 100644 api/api/data_frame_transform_deprecated.get_transform_stats.js delete mode 100644 api/api/data_frame_transform_deprecated.preview_transform.js delete mode 100644 api/api/data_frame_transform_deprecated.put_transform.js delete mode 100644 api/api/data_frame_transform_deprecated.start_transform.js delete mode 100644 api/api/data_frame_transform_deprecated.stop_transform.js delete mode 100644 api/api/data_frame_transform_deprecated.update_transform.js diff --git a/api/api/bulk.js b/api/api/bulk.js index 361dd22b1..683c50310 100644 --- a/api/api/bulk.js +++ b/api/api/bulk.js @@ -19,7 +19,9 @@ function buildBulk (opts) { 'type', '_source', '_source_excludes', + '_source_exclude', '_source_includes', + '_source_include', 'pipeline', 'pretty', 'human', @@ -31,7 +33,9 @@ function buildBulk (opts) { const snakeCase = { waitForActiveShards: 'wait_for_active_shards', _sourceExcludes: '_source_excludes', + _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', + _sourceInclude: '_source_include', errorTrace: 'error_trace', filterPath: 'filter_path' } diff --git a/api/api/data_frame_transform_deprecated.delete_transform.js b/api/api/data_frame_transform_deprecated.delete_transform.js deleted file mode 100644 index beaf9a387..000000000 --- a/api/api/data_frame_transform_deprecated.delete_transform.js +++ /dev/null @@ -1,77 +0,0 @@ -// 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 buildDataFrameTransformDeprecatedDeleteTransform (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'force' - ] - - const snakeCase = { - - } - - /** - * Perform a data_frame_transform_deprecated.delete_transform request - * https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html - */ - return function dataFrameTransformDeprecatedDeleteTransform (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['transform_id'] == null && params['transformId'] == null) { - const err = new ConfigurationError('Missing required parameter: transform_id or transformId') - 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, transformId, transform_id, ...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 = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildDataFrameTransformDeprecatedDeleteTransform diff --git a/api/api/data_frame_transform_deprecated.get_transform.js b/api/api/data_frame_transform_deprecated.get_transform.js deleted file mode 100644 index a2eb48f66..000000000 --- a/api/api/data_frame_transform_deprecated.get_transform.js +++ /dev/null @@ -1,73 +0,0 @@ -// 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 buildDataFrameTransformDeprecatedGetTransform (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'from', - 'size', - 'allow_no_match' - ] - - const snakeCase = { - allowNoMatch: 'allow_no_match' - } - - /** - * Perform a data_frame_transform_deprecated.get_transform request - * https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html - */ - return function dataFrameTransformDeprecatedGetTransform (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, transformId, transform_id, ...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 = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildDataFrameTransformDeprecatedGetTransform diff --git a/api/api/data_frame_transform_deprecated.get_transform_stats.js b/api/api/data_frame_transform_deprecated.get_transform_stats.js deleted file mode 100644 index fa23121a3..000000000 --- a/api/api/data_frame_transform_deprecated.get_transform_stats.js +++ /dev/null @@ -1,79 +0,0 @@ -// 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 buildDataFrameTransformDeprecatedGetTransformStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'from', - 'size', - 'allow_no_match' - ] - - const snakeCase = { - allowNoMatch: 'allow_no_match' - } - - /** - * Perform a data_frame_transform_deprecated.get_transform_stats request - * https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html - */ - return function dataFrameTransformDeprecatedGetTransformStats (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['transform_id'] == null && params['transformId'] == null) { - const err = new ConfigurationError('Missing required parameter: transform_id or transformId') - 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, transformId, transform_id, ...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 = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_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 = buildDataFrameTransformDeprecatedGetTransformStats diff --git a/api/api/data_frame_transform_deprecated.preview_transform.js b/api/api/data_frame_transform_deprecated.preview_transform.js deleted file mode 100644 index 24c26c166..000000000 --- a/api/api/data_frame_transform_deprecated.preview_transform.js +++ /dev/null @@ -1,74 +0,0 @@ -// 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 buildDataFrameTransformDeprecatedPreviewTransform (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a data_frame_transform_deprecated.preview_transform request - * https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html - */ - return function dataFrameTransformDeprecatedPreviewTransform (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['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - 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, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildDataFrameTransformDeprecatedPreviewTransform diff --git a/api/api/data_frame_transform_deprecated.put_transform.js b/api/api/data_frame_transform_deprecated.put_transform.js deleted file mode 100644 index e57e8f04e..000000000 --- a/api/api/data_frame_transform_deprecated.put_transform.js +++ /dev/null @@ -1,81 +0,0 @@ -// 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 buildDataFrameTransformDeprecatedPutTransform (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'defer_validation' - ] - - const snakeCase = { - deferValidation: 'defer_validation' - } - - /** - * Perform a data_frame_transform_deprecated.put_transform request - * https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html - */ - return function dataFrameTransformDeprecatedPutTransform (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['transform_id'] == null && params['transformId'] == null) { - const err = new ConfigurationError('Missing required parameter: transform_id or transformId') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - 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, transformId, transform_id, ...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 = 'PUT' - path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildDataFrameTransformDeprecatedPutTransform diff --git a/api/api/data_frame_transform_deprecated.start_transform.js b/api/api/data_frame_transform_deprecated.start_transform.js deleted file mode 100644 index 933e2bc28..000000000 --- a/api/api/data_frame_transform_deprecated.start_transform.js +++ /dev/null @@ -1,77 +0,0 @@ -// 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 buildDataFrameTransformDeprecatedStartTransform (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'timeout' - ] - - const snakeCase = { - - } - - /** - * Perform a data_frame_transform_deprecated.start_transform request - * https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html - */ - return function dataFrameTransformDeprecatedStartTransform (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['transform_id'] == null && params['transformId'] == null) { - const err = new ConfigurationError('Missing required parameter: transform_id or transformId') - 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, transformId, transform_id, ...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 = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_start' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildDataFrameTransformDeprecatedStartTransform diff --git a/api/api/data_frame_transform_deprecated.stop_transform.js b/api/api/data_frame_transform_deprecated.stop_transform.js deleted file mode 100644 index fcc8a0140..000000000 --- a/api/api/data_frame_transform_deprecated.stop_transform.js +++ /dev/null @@ -1,80 +0,0 @@ -// 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 buildDataFrameTransformDeprecatedStopTransform (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'wait_for_completion', - 'timeout', - 'allow_no_match' - ] - - const snakeCase = { - waitForCompletion: 'wait_for_completion', - allowNoMatch: 'allow_no_match' - } - - /** - * Perform a data_frame_transform_deprecated.stop_transform request - * https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html - */ - return function dataFrameTransformDeprecatedStopTransform (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['transform_id'] == null && params['transformId'] == null) { - const err = new ConfigurationError('Missing required parameter: transform_id or transformId') - 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, transformId, transform_id, ...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 = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stop' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildDataFrameTransformDeprecatedStopTransform diff --git a/api/api/data_frame_transform_deprecated.update_transform.js b/api/api/data_frame_transform_deprecated.update_transform.js deleted file mode 100644 index 3c276c974..000000000 --- a/api/api/data_frame_transform_deprecated.update_transform.js +++ /dev/null @@ -1,81 +0,0 @@ -// 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 buildDataFrameTransformDeprecatedUpdateTransform (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'defer_validation' - ] - - const snakeCase = { - deferValidation: 'defer_validation' - } - - /** - * Perform a data_frame_transform_deprecated.update_transform request - * https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html - */ - return function dataFrameTransformDeprecatedUpdateTransform (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['transform_id'] == null && params['transformId'] == null) { - const err = new ConfigurationError('Missing required parameter: transform_id or transformId') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - 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, transformId, transform_id, ...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 = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_update' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildDataFrameTransformDeprecatedUpdateTransform diff --git a/api/api/delete_by_query.js b/api/api/delete_by_query.js index 75bee3817..a9ad61615 100644 --- a/api/api/delete_by_query.js +++ b/api/api/delete_by_query.js @@ -32,7 +32,9 @@ function buildDeleteByQuery (opts) { 'sort', '_source', '_source_excludes', + '_source_exclude', '_source_includes', + '_source_include', 'terminate_after', 'stats', 'version', @@ -61,7 +63,9 @@ function buildDeleteByQuery (opts) { searchTimeout: 'search_timeout', maxDocs: 'max_docs', _sourceExcludes: '_source_excludes', + _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', + _sourceInclude: '_source_include', terminateAfter: 'terminate_after', requestCache: 'request_cache', waitForActiveShards: 'wait_for_active_shards', diff --git a/api/api/exists.js b/api/api/exists.js index 7659a0907..c48a5299b 100644 --- a/api/api/exists.js +++ b/api/api/exists.js @@ -19,7 +19,9 @@ function buildExists (opts) { 'routing', '_source', '_source_excludes', + '_source_exclude', '_source_includes', + '_source_include', 'version', 'version_type', 'pretty', @@ -32,7 +34,9 @@ function buildExists (opts) { const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', + _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', + _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' diff --git a/api/api/exists_source.js b/api/api/exists_source.js index 059ed1de5..fab3f6d85 100644 --- a/api/api/exists_source.js +++ b/api/api/exists_source.js @@ -18,7 +18,9 @@ function buildExistsSource (opts) { 'routing', '_source', '_source_excludes', + '_source_exclude', '_source_includes', + '_source_include', 'version', 'version_type', 'pretty', @@ -30,7 +32,9 @@ function buildExistsSource (opts) { const snakeCase = { _sourceExcludes: '_source_excludes', + _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', + _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' diff --git a/api/api/explain.js b/api/api/explain.js index cf513bdcb..71aab5acf 100644 --- a/api/api/explain.js +++ b/api/api/explain.js @@ -23,7 +23,9 @@ function buildExplain (opts) { 'routing', '_source', '_source_excludes', + '_source_exclude', '_source_includes', + '_source_include', 'pretty', 'human', 'error_trace', @@ -36,7 +38,9 @@ function buildExplain (opts) { defaultOperator: 'default_operator', storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', + _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', + _sourceInclude: '_source_include', errorTrace: 'error_trace', filterPath: 'filter_path' } diff --git a/api/api/get.js b/api/api/get.js index ee5aeeee7..87b127cab 100644 --- a/api/api/get.js +++ b/api/api/get.js @@ -19,7 +19,9 @@ function buildGet (opts) { 'routing', '_source', '_source_excludes', + '_source_exclude', '_source_includes', + '_source_include', 'version', 'version_type', 'pretty', @@ -32,7 +34,9 @@ function buildGet (opts) { const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', + _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', + _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' diff --git a/api/api/get_source.js b/api/api/get_source.js index 08543b96a..70bd3deff 100644 --- a/api/api/get_source.js +++ b/api/api/get_source.js @@ -18,7 +18,9 @@ function buildGetSource (opts) { 'routing', '_source', '_source_excludes', + '_source_exclude', '_source_includes', + '_source_include', 'version', 'version_type', 'pretty', @@ -30,7 +32,9 @@ function buildGetSource (opts) { const snakeCase = { _sourceExcludes: '_source_excludes', + _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', + _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' diff --git a/api/api/indices.delete_alias.js b/api/api/indices.delete_alias.js index f10bb25d5..7f5da226b 100644 --- a/api/api/indices.delete_alias.js +++ b/api/api/indices.delete_alias.js @@ -79,10 +79,10 @@ function buildIndicesDeleteAlias (opts) { if ((index) != null && (name) != null) { if (method == null) method = 'DELETE' - path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name) + path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name) } else { if (method == null) method = 'DELETE' - path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name) + path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name) } // build request object diff --git a/api/api/indices.put_alias.js b/api/api/indices.put_alias.js index bb32f3098..4e72de0d6 100644 --- a/api/api/indices.put_alias.js +++ b/api/api/indices.put_alias.js @@ -79,10 +79,10 @@ function buildIndicesPutAlias (opts) { if ((index) != null && (name) != null) { if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name) + path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name) } else { if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name) + path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name) } // build request object diff --git a/api/api/mget.js b/api/api/mget.js index 2e6093e5e..fbf6f03f4 100644 --- a/api/api/mget.js +++ b/api/api/mget.js @@ -19,7 +19,9 @@ function buildMget (opts) { 'routing', '_source', '_source_excludes', + '_source_exclude', '_source_includes', + '_source_include', 'pretty', 'human', 'error_trace', @@ -30,7 +32,9 @@ function buildMget (opts) { const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', + _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', + _sourceInclude: '_source_include', errorTrace: 'error_trace', filterPath: 'filter_path' } diff --git a/api/api/nodes.hot_threads.js b/api/api/nodes.hot_threads.js index be4fcaa5a..6e2a44d4b 100644 --- a/api/api/nodes.hot_threads.js +++ b/api/api/nodes.hot_threads.js @@ -67,16 +67,16 @@ function buildNodesHotThreads (opts) { if ((node_id || nodeId) != null) { if (method == null) method = 'GET' - path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads' + path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads' } else if ((node_id || nodeId) != null) { if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads' + path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads' } else if ((node_id || nodeId) != null) { if (method == null) method = 'GET' - path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads' + path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads' } else if ((node_id || nodeId) != null) { if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads' + path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads' } else { if (method == null) method = 'GET' path = '/' + '_nodes' + '/' + 'hot_threads' diff --git a/api/api/search.js b/api/api/search.js index c17ccd295..8e058048f 100644 --- a/api/api/search.js +++ b/api/api/search.js @@ -35,7 +35,9 @@ function buildSearch (opts) { 'sort', '_source', '_source_excludes', + '_source_exclude', '_source_includes', + '_source_include', 'terminate_after', 'stats', 'suggest_field', @@ -73,7 +75,9 @@ function buildSearch (opts) { expandWildcards: 'expand_wildcards', searchType: 'search_type', _sourceExcludes: '_source_excludes', + _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', + _sourceInclude: '_source_include', terminateAfter: 'terminate_after', suggestField: 'suggest_field', suggestMode: 'suggest_mode', diff --git a/api/api/update.js b/api/api/update.js index e45c32c38..bd5744bba 100644 --- a/api/api/update.js +++ b/api/api/update.js @@ -15,7 +15,9 @@ function buildUpdate (opts) { 'wait_for_active_shards', '_source', '_source_excludes', + '_source_exclude', '_source_includes', + '_source_include', 'lang', 'refresh', 'retry_on_conflict', @@ -33,7 +35,9 @@ function buildUpdate (opts) { const snakeCase = { waitForActiveShards: 'wait_for_active_shards', _sourceExcludes: '_source_excludes', + _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', + _sourceInclude: '_source_include', retryOnConflict: 'retry_on_conflict', ifSeqNo: 'if_seq_no', ifPrimaryTerm: 'if_primary_term', diff --git a/api/api/update_by_query.js b/api/api/update_by_query.js index 2ba13c742..682e44ddd 100644 --- a/api/api/update_by_query.js +++ b/api/api/update_by_query.js @@ -34,7 +34,9 @@ function buildUpdateByQuery (opts) { 'sort', '_source', '_source_excludes', + '_source_exclude', '_source_includes', + '_source_include', 'terminate_after', 'stats', 'version', @@ -64,7 +66,9 @@ function buildUpdateByQuery (opts) { searchTimeout: 'search_timeout', maxDocs: 'max_docs', _sourceExcludes: '_source_excludes', + _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', + _sourceInclude: '_source_include', terminateAfter: 'terminate_after', versionType: 'version_type', requestCache: 'request_cache', diff --git a/api/index.js b/api/index.js index 9dc5951ee..79f9519f6 100644 --- a/api/index.js +++ b/api/index.js @@ -86,42 +86,6 @@ function ESAPI (opts) { }, count: lazyLoad('count', opts), create: lazyLoad('create', opts), - data_frame_transform_deprecated: { - delete_transform: lazyLoad('data_frame_transform_deprecated.delete_transform', opts), - deleteTransform: lazyLoad('data_frame_transform_deprecated.delete_transform', opts), - get_transform: lazyLoad('data_frame_transform_deprecated.get_transform', opts), - getTransform: lazyLoad('data_frame_transform_deprecated.get_transform', opts), - get_transform_stats: lazyLoad('data_frame_transform_deprecated.get_transform_stats', opts), - getTransformStats: lazyLoad('data_frame_transform_deprecated.get_transform_stats', opts), - preview_transform: lazyLoad('data_frame_transform_deprecated.preview_transform', opts), - previewTransform: lazyLoad('data_frame_transform_deprecated.preview_transform', opts), - put_transform: lazyLoad('data_frame_transform_deprecated.put_transform', opts), - putTransform: lazyLoad('data_frame_transform_deprecated.put_transform', opts), - start_transform: lazyLoad('data_frame_transform_deprecated.start_transform', opts), - startTransform: lazyLoad('data_frame_transform_deprecated.start_transform', opts), - stop_transform: lazyLoad('data_frame_transform_deprecated.stop_transform', opts), - stopTransform: lazyLoad('data_frame_transform_deprecated.stop_transform', opts), - update_transform: lazyLoad('data_frame_transform_deprecated.update_transform', opts), - updateTransform: lazyLoad('data_frame_transform_deprecated.update_transform', opts) - }, - dataFrameTransformDeprecated: { - delete_transform: lazyLoad('data_frame_transform_deprecated.delete_transform', opts), - deleteTransform: lazyLoad('data_frame_transform_deprecated.delete_transform', opts), - get_transform: lazyLoad('data_frame_transform_deprecated.get_transform', opts), - getTransform: lazyLoad('data_frame_transform_deprecated.get_transform', opts), - get_transform_stats: lazyLoad('data_frame_transform_deprecated.get_transform_stats', opts), - getTransformStats: lazyLoad('data_frame_transform_deprecated.get_transform_stats', opts), - preview_transform: lazyLoad('data_frame_transform_deprecated.preview_transform', opts), - previewTransform: lazyLoad('data_frame_transform_deprecated.preview_transform', opts), - put_transform: lazyLoad('data_frame_transform_deprecated.put_transform', opts), - putTransform: lazyLoad('data_frame_transform_deprecated.put_transform', opts), - start_transform: lazyLoad('data_frame_transform_deprecated.start_transform', opts), - startTransform: lazyLoad('data_frame_transform_deprecated.start_transform', opts), - stop_transform: lazyLoad('data_frame_transform_deprecated.stop_transform', opts), - stopTransform: lazyLoad('data_frame_transform_deprecated.stop_transform', opts), - update_transform: lazyLoad('data_frame_transform_deprecated.update_transform', opts), - updateTransform: lazyLoad('data_frame_transform_deprecated.update_transform', opts) - }, delete: lazyLoad('delete', opts), delete_by_query: lazyLoad('delete_by_query', opts), deleteByQuery: lazyLoad('delete_by_query', opts), diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts index 7924733e2..9883f9d50 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -15,6 +15,8 @@ export interface Generic { export interface Bulk extends Generic { index?: string; type?: string; + _source_exclude?: string | string[]; + _source_include?: string | string[]; wait_for_active_shards?: string; refresh?: 'true' | 'false' | 'wait_for'; routing?: string; @@ -374,6 +376,8 @@ export interface Delete extends Generic { export interface DeleteByQuery extends Generic { index: string | string[]; type?: string | string[]; + _source_exclude?: string | string[]; + _source_include?: string | string[]; analyze_wildcard?: boolean; default_operator?: 'AND' | 'OR'; df?: string; @@ -424,6 +428,8 @@ export interface Exists extends Generic { id: string; index: string; type?: string; + _source_exclude?: string | string[]; + _source_include?: string | string[]; stored_fields?: string | string[]; preference?: string; realtime?: boolean; @@ -440,6 +446,8 @@ export interface ExistsSource extends Generic { id: string; index: string; type?: string; + _source_exclude?: string | string[]; + _source_include?: string | string[]; preference?: string; realtime?: boolean; refresh?: boolean; @@ -455,6 +463,8 @@ export interface Explain extends Generic { id: string; index: string; type?: string; + _source_exclude?: string | string[]; + _source_include?: string | string[]; analyze_wildcard?: boolean; analyzer?: string; default_operator?: 'AND' | 'OR'; @@ -483,6 +493,8 @@ export interface Get extends Generic { id: string; index: string; type?: string; + _source_exclude?: string | string[]; + _source_include?: string | string[]; stored_fields?: string | string[]; preference?: string; realtime?: boolean; @@ -504,6 +516,8 @@ export interface GetSource extends Generic { id: string; index: string; type?: string; + _source_exclude?: string | string[]; + _source_include?: string | string[]; preference?: string; realtime?: boolean; refresh?: boolean; @@ -924,6 +938,8 @@ export interface IngestSimulate extends Generic { export interface Mget extends Generic { index?: string; type?: string; + _source_exclude?: string | string[]; + _source_include?: string | string[]; stored_fields?: string | string[]; preference?: string; realtime?: boolean; @@ -1073,6 +1089,8 @@ export interface Scroll extends Generic { export interface Search extends Generic { index?: string | string[]; type?: string | string[]; + _source_exclude?: string | string[]; + _source_include?: string | string[]; analyzer?: string; analyze_wildcard?: boolean; ccs_minimize_roundtrips?: boolean; @@ -1261,6 +1279,8 @@ export interface Update extends Generic { id: string; index: string; type?: string; + _source_exclude?: string | string[]; + _source_include?: string | string[]; wait_for_active_shards?: string; _source?: string | string[]; _source_excludes?: string | string[]; @@ -1278,6 +1298,8 @@ export interface Update extends Generic { export interface UpdateByQuery extends Generic { index: string | string[]; type?: string | string[]; + _source_exclude?: string | string[]; + _source_include?: string | string[]; analyzer?: string; analyze_wildcard?: boolean; default_operator?: 'AND' | 'OR'; @@ -1377,53 +1399,6 @@ export interface CcrUnfollow extends Generic { index: string; } -export interface DataFrameTransformDeprecatedDeleteTransform extends Generic { - transform_id: string; - force?: boolean; -} - -export interface DataFrameTransformDeprecatedGetTransform extends Generic { - transform_id?: string; - from?: number; - size?: number; - allow_no_match?: boolean; -} - -export interface DataFrameTransformDeprecatedGetTransformStats extends Generic { - transform_id: string; - from?: number; - size?: number; - allow_no_match?: boolean; -} - -export interface DataFrameTransformDeprecatedPreviewTransform extends Generic { - body: T; -} - -export interface DataFrameTransformDeprecatedPutTransform extends Generic { - transform_id: string; - defer_validation?: boolean; - body: T; -} - -export interface DataFrameTransformDeprecatedStartTransform extends Generic { - transform_id: string; - timeout?: string; -} - -export interface DataFrameTransformDeprecatedStopTransform extends Generic { - transform_id: string; - wait_for_completion?: boolean; - timeout?: string; - allow_no_match?: boolean; -} - -export interface DataFrameTransformDeprecatedUpdateTransform extends Generic { - transform_id: string; - defer_validation?: boolean; - body: T; -} - export interface EnrichDeletePolicy extends Generic { name: string; } diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 8e73bea95..5f0a86ed5 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -5622,194 +5622,6 @@ link:http://www.elastic.co/guide/en/elasticsearch/reference/current[Reference] |=== -=== dataFrameTransformDeprecated.deleteTransform -*Stability:* beta -[source,ts] ----- -client.dataFrameTransformDeprecated.deleteTransform({ - transform_id: string, - force: boolean -}) ----- -link:{ref}/delete-transform.html[Reference] -[cols=2*] -|=== -|`transform_id` or `transformId` -|`string` - The id of the transform to delete - -|`force` -|`boolean` - When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted. - -|=== - -=== dataFrameTransformDeprecated.getTransform -*Stability:* beta -[source,ts] ----- -client.dataFrameTransformDeprecated.getTransform({ - transform_id: string, - from: number, - size: number, - allow_no_match: boolean -}) ----- -link:{ref}/get-transform.html[Reference] -[cols=2*] -|=== -|`transform_id` or `transformId` -|`string` - The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms - -|`from` -|`number` - skips a number of transform configs, defaults to 0 - -|`size` -|`number` - specifies a max number of transforms to get, defaults to 100 - -|`allow_no_match` or `allowNoMatch` -|`boolean` - Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) - -|=== - -=== dataFrameTransformDeprecated.getTransformStats -*Stability:* beta -[source,ts] ----- -client.dataFrameTransformDeprecated.getTransformStats({ - transform_id: string, - from: number, - size: number, - allow_no_match: boolean -}) ----- -link:{ref}/get-transform-stats.html[Reference] -[cols=2*] -|=== -|`transform_id` or `transformId` -|`string` - The id of the transform for which to get stats. '_all' or '*' implies all transforms - -|`from` -|`number` - skips a number of transform stats, defaults to 0 - -|`size` -|`number` - specifies a max number of transform stats to get, defaults to 100 - -|`allow_no_match` or `allowNoMatch` -|`boolean` - Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) - -|=== - -=== dataFrameTransformDeprecated.previewTransform -*Stability:* beta -[source,ts] ----- -client.dataFrameTransformDeprecated.previewTransform({ - body: object -}) ----- -link:{ref}/preview-transform.html[Reference] -[cols=2*] -|=== -|`body` -|`object` - The definition for the transform to preview - -|=== - -=== dataFrameTransformDeprecated.putTransform -*Stability:* beta -[source,ts] ----- -client.dataFrameTransformDeprecated.putTransform({ - transform_id: string, - defer_validation: boolean, - body: object -}) ----- -link:{ref}/put-transform.html[Reference] -[cols=2*] -|=== -|`transform_id` or `transformId` -|`string` - The id of the new transform. - -|`defer_validation` or `deferValidation` -|`boolean` - If validations should be deferred until transform starts, defaults to false. - -|`body` -|`object` - The transform definition - -|=== - -=== dataFrameTransformDeprecated.startTransform -*Stability:* beta -[source,ts] ----- -client.dataFrameTransformDeprecated.startTransform({ - transform_id: string, - timeout: string -}) ----- -link:{ref}/start-transform.html[Reference] -[cols=2*] -|=== -|`transform_id` or `transformId` -|`string` - The id of the transform to start - -|`timeout` -|`string` - Controls the time to wait for the transform to start - -|=== - -=== dataFrameTransformDeprecated.stopTransform -*Stability:* beta -[source,ts] ----- -client.dataFrameTransformDeprecated.stopTransform({ - transform_id: string, - wait_for_completion: boolean, - timeout: string, - allow_no_match: boolean -}) ----- -link:{ref}/stop-transform.html[Reference] -[cols=2*] -|=== -|`transform_id` or `transformId` -|`string` - The id of the transform to stop - -|`wait_for_completion` or `waitForCompletion` -|`boolean` - Whether to wait for the transform to fully stop before returning or not. Default to false - -|`timeout` -|`string` - Controls the time to wait until the transform has stopped. Default to 30 seconds - -|`allow_no_match` or `allowNoMatch` -|`boolean` - Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) - -|=== - -=== dataFrameTransformDeprecated.updateTransform -*Stability:* beta -[source,ts] ----- -client.dataFrameTransformDeprecated.updateTransform({ - transform_id: string, - defer_validation: boolean, - body: object -}) ----- -link:{ref}/update-transform.html[Reference] -[cols=2*] -|=== -|`transform_id` or `transformId` -|`string` - The id of the transform. - -|`defer_validation` or `deferValidation` -|`boolean` - If validations should be deferred until transform starts, defaults to false. - -|`body` -|`object` - The update transform definition - -|=== - === enrich.deletePolicy [source,ts] diff --git a/index.d.ts b/index.d.ts index f785f2420..f0879b818 100644 --- a/index.d.ts +++ b/index.d.ts @@ -185,42 +185,6 @@ declare class Client extends EventEmitter { } count: ApiMethod create: ApiMethod - data_frame_transform_deprecated: { - delete_transform: ApiMethod - deleteTransform: ApiMethod - get_transform: ApiMethod - getTransform: ApiMethod - get_transform_stats: ApiMethod - getTransformStats: ApiMethod - preview_transform: ApiMethod - previewTransform: ApiMethod - put_transform: ApiMethod - putTransform: ApiMethod - start_transform: ApiMethod - startTransform: ApiMethod - stop_transform: ApiMethod - stopTransform: ApiMethod - update_transform: ApiMethod - updateTransform: ApiMethod - } - dataFrameTransformDeprecated: { - delete_transform: ApiMethod - deleteTransform: ApiMethod - get_transform: ApiMethod - getTransform: ApiMethod - get_transform_stats: ApiMethod - getTransformStats: ApiMethod - preview_transform: ApiMethod - previewTransform: ApiMethod - put_transform: ApiMethod - putTransform: ApiMethod - start_transform: ApiMethod - startTransform: ApiMethod - stop_transform: ApiMethod - stopTransform: ApiMethod - update_transform: ApiMethod - updateTransform: ApiMethod - } delete: ApiMethod delete_by_query: ApiMethod deleteByQuery: ApiMethod From b045482808ae8cbba35021d14c2af1eec23c8f12 Mon Sep 17 00:00:00 2001 From: delvedor Date: Tue, 3 Dec 2019 10:39:43 +0100 Subject: [PATCH 5/8] Fix docs link --- docs/reference.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 5f0a86ed5..4620e362d 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -6339,7 +6339,7 @@ client.ml.estimateMemoryUsage({ body: object }) ---- -link:{ref}/estimate-memory-usage-dfanalytics.html[Reference] +https://www.elastic.co/guide/en/elasticsearch/reference/current/estimate-memory-usage-dfanalytics.html[Reference] [cols=2*] |=== |`body` From 27a3ed123bf28be9782fcd08db2e7047bfef5a4c Mon Sep 17 00:00:00 2001 From: delvedor Date: Tue, 3 Dec 2019 11:42:22 +0100 Subject: [PATCH 6/8] Fix CI configuration --- .ci/test-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/test-matrix.yml b/.ci/test-matrix.yml index ef562122a..a5fdd3107 100644 --- a/.ci/test-matrix.yml +++ b/.ci/test-matrix.yml @@ -1,6 +1,6 @@ --- ELASTICSEARCH_VERSION: - - 7.4.0 + - 7.5.0 NODE_JS_VERSION: - 12 From 2968edd52b2dab25c2ff5fca7e60ae0102be907b Mon Sep 17 00:00:00 2001 From: delvedor Date: Tue, 3 Dec 2019 12:02:34 +0100 Subject: [PATCH 7/8] Added enrich_user to default roles --- test/integration/helper.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/integration/helper.js b/test/integration/helper.js index b8b0a7dfa..124bab5b2 100644 --- a/test/integration/helper.js +++ b/test/integration/helper.js @@ -13,6 +13,7 @@ const esDefaultRoles = [ 'code_user', 'data_frame_transforms_admin', 'data_frame_transforms_user', + 'enrich_user', 'ingest_admin', 'kibana_dashboard_only_user', 'kibana_system', From 841fc8551492485ee3a97d6bd2620c9ac238273f Mon Sep 17 00:00:00 2001 From: delvedor Date: Tue, 3 Dec 2019 12:43:47 +0100 Subject: [PATCH 8/8] Added transform_admin ad transform_user to default roles --- test/integration/helper.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/integration/helper.js b/test/integration/helper.js index 124bab5b2..f9d0d8eec 100644 --- a/test/integration/helper.js +++ b/test/integration/helper.js @@ -30,6 +30,8 @@ const esDefaultRoles = [ 'rollup_user', 'snapshot_user', 'superuser', + 'transform_admin', + 'transform_user', 'transport_client', 'watcher_admin', 'watcher_user'