diff --git a/api/api/cat.recovery.js b/api/api/cat.recovery.js index 05b2c0f65..85c779024 100644 --- a/api/api/cat.recovery.js +++ b/api/api/cat.recovery.js @@ -13,10 +13,13 @@ function buildCatRecovery (opts) { const acceptedQuerystring = [ 'format', + 'active_only', 'bytes', + 'detailed', 'master_timeout', 'h', 'help', + 'index', 's', 'v', 'pretty', @@ -27,6 +30,7 @@ function buildCatRecovery (opts) { ] const snakeCase = { + activeOnly: 'active_only', masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' diff --git a/api/api/exists.js b/api/api/exists.js index c48a5299b..7f24bef7e 100644 --- a/api/api/exists.js +++ b/api/api/exists.js @@ -76,7 +76,7 @@ function buildExists (opts) { } var warnings = [] - var { method, body, id, index, type, ...querystring } = params + var { method, body, id, index, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) var ignore = options.ignore @@ -86,13 +86,8 @@ function buildExists (opts) { var path = '' - if ((index) != null && (type) != null && (id) != null) { - if (method == null) method = 'HEAD' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) - } else { - if (method == null) method = 'HEAD' - path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) - } + if (method == null) method = 'HEAD' + path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) // build request object const request = { diff --git a/api/api/explain.js b/api/api/explain.js index 71aab5acf..108a3fa25 100644 --- a/api/api/explain.js +++ b/api/api/explain.js @@ -79,7 +79,7 @@ function buildExplain (opts) { } var warnings = [] - var { method, body, id, index, type, ...querystring } = params + var { method, body, id, index, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) var ignore = options.ignore @@ -89,13 +89,8 @@ function buildExplain (opts) { var path = '' - if ((index) != null && (type) != null && (id) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id) - } + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id) // build request object const request = { diff --git a/api/api/get.js b/api/api/get.js index 87b127cab..58e76212b 100644 --- a/api/api/get.js +++ b/api/api/get.js @@ -76,7 +76,7 @@ function buildGet (opts) { } var warnings = [] - var { method, body, id, index, type, ...querystring } = params + var { method, body, id, index, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) var ignore = options.ignore @@ -86,13 +86,8 @@ function buildGet (opts) { var path = '' - if ((index) != null && (type) != null && (id) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) - } else { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) - } + if (method == null) method = 'GET' + path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) // build request object const request = { diff --git a/api/api/get_source.js b/api/api/get_source.js index 70bd3deff..8712667cb 100644 --- a/api/api/get_source.js +++ b/api/api/get_source.js @@ -74,7 +74,7 @@ function buildGetSource (opts) { } var warnings = [] - var { method, body, id, index, type, ...querystring } = params + var { method, body, id, index, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) var ignore = options.ignore @@ -84,13 +84,8 @@ function buildGetSource (opts) { var path = '' - if ((index) != null && (type) != null && (id) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source' - } else { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id) - } + if (method == null) method = 'GET' + path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id) // build request object const request = { diff --git a/api/api/graph.explore.js b/api/api/graph.explore.js index d6ae754be..b4a662a29 100644 --- a/api/api/graph.explore.js +++ b/api/api/graph.explore.js @@ -42,12 +42,6 @@ function buildGraphExplore (opts) { return handleError(err, callback) } - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - 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}`) @@ -55,7 +49,7 @@ function buildGraphExplore (opts) { } var warnings = [] - var { method, body, index, type, ...querystring } = params + var { method, body, index, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) var ignore = options.ignore @@ -65,13 +59,8 @@ function buildGraphExplore (opts) { var path = '' - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_graph' + '/' + 'explore' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_graph' + '/' + 'explore' - } + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + '_graph' + '/' + 'explore' // build request object const request = { 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/indices.get_field_mapping.js b/api/api/indices.get_field_mapping.js index 0ebae652b..5d555cb29 100644 --- a/api/api/indices.get_field_mapping.js +++ b/api/api/indices.get_field_mapping.js @@ -65,7 +65,7 @@ function buildIndicesGetFieldMapping (opts) { } var warnings = [] - var { method, body, fields, index, type, ...querystring } = params + var { method, body, fields, index, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) var ignore = options.ignore @@ -75,15 +75,9 @@ function buildIndicesGetFieldMapping (opts) { var path = '' - if ((index) != null && (type) != null && (fields) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields) - } else if ((index) != null && (fields) != null) { + if ((index) != null && (fields) != null) { if (method == null) method = 'GET' path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields) - } else if ((type) != null && (fields) != null) { - if (method == null) method = 'GET' - path = '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields) } else { if (method == null) method = 'GET' path = '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields) diff --git a/api/api/indices.get_mapping.js b/api/api/indices.get_mapping.js index 21e1125ce..8c03a7485 100644 --- a/api/api/indices.get_mapping.js +++ b/api/api/indices.get_mapping.js @@ -12,7 +12,6 @@ function buildIndicesGetMapping (opts) { const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts const acceptedQuerystring = [ - 'include_type_name', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', @@ -26,7 +25,6 @@ function buildIndicesGetMapping (opts) { ] const snakeCase = { - includeTypeName: 'include_type_name', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', @@ -59,7 +57,7 @@ function buildIndicesGetMapping (opts) { } var warnings = [] - var { method, body, index, type, ...querystring } = params + var { method, body, index, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) var ignore = options.ignore @@ -69,15 +67,9 @@ function buildIndicesGetMapping (opts) { var path = '' - if ((index) != null && (type) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) - } else if ((index) != null) { + if ((index) != null) { if (method == null) method = 'GET' path = '/' + encodeURIComponent(index) + '/' + '_mapping' - } else if ((type) != null) { - if (method == null) method = 'GET' - path = '/' + '_mapping' + '/' + encodeURIComponent(type) } else { if (method == null) method = 'GET' path = '/' + '_mapping' diff --git a/api/api/indices.put_mapping.js b/api/api/indices.put_mapping.js index 7335604cb..5f162e5df 100644 --- a/api/api/indices.put_mapping.js +++ b/api/api/indices.put_mapping.js @@ -12,7 +12,6 @@ function buildIndicesPutMapping (opts) { const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts const acceptedQuerystring = [ - 'include_type_name', 'timeout', 'master_timeout', 'ignore_unavailable', @@ -26,7 +25,6 @@ function buildIndicesPutMapping (opts) { ] const snakeCase = { - includeTypeName: 'include_type_name', masterTimeout: 'master_timeout', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', @@ -53,6 +51,10 @@ function buildIndicesPutMapping (opts) { } // check required parameters + if (params['index'] == null) { + const err = new ConfigurationError('Missing required parameter: index') + return handleError(err, callback) + } if (params['body'] == null) { const err = new ConfigurationError('Missing required parameter: body') return handleError(err, callback) @@ -65,7 +67,7 @@ function buildIndicesPutMapping (opts) { } var warnings = [] - var { method, body, index, type, ...querystring } = params + var { method, body, index, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) var ignore = options.ignore @@ -75,31 +77,8 @@ function buildIndicesPutMapping (opts) { var path = '' - if ((index) != null && (type) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mapping' - } else if ((index) != null && (type) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) - } else if ((index) != null && (type) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mappings' - } else if ((index) != null && (type) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_mappings' + '/' + encodeURIComponent(type) - } else if ((index) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' - } else if ((type) != null) { - if (method == null) method = 'PUT' - path = '/' + '_mappings' + '/' + encodeURIComponent(type) - } else if ((index) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_mappings' - } else { - if (method == null) method = 'PUT' - path = '/' + '_mapping' + '/' + encodeURIComponent(type) - } + if (method == null) method = 'PUT' + path = '/' + encodeURIComponent(index) + '/' + '_mapping' // build request object const request = { diff --git a/api/api/mget.js b/api/api/mget.js index fbf6f03f4..bd5512cc6 100644 --- a/api/api/mget.js +++ b/api/api/mget.js @@ -62,12 +62,6 @@ function buildMget (opts) { return handleError(err, callback) } - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - 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}`) @@ -75,7 +69,7 @@ function buildMget (opts) { } var warnings = [] - var { method, body, index, type, ...querystring } = params + var { method, body, index, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) var ignore = options.ignore @@ -85,10 +79,7 @@ function buildMget (opts) { var path = '' - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mget' - } else if ((index) != null) { + if ((index) != null) { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_mget' } else { diff --git a/api/api/data_frame.delete_data_frame_transform.js b/api/api/transform.delete_transform.js similarity index 87% rename from api/api/data_frame.delete_data_frame_transform.js rename to api/api/transform.delete_transform.js index d7844d5cb..2942bd76c 100644 --- a/api/api/data_frame.delete_data_frame_transform.js +++ b/api/api/transform.delete_transform.js @@ -7,7 +7,7 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ -function buildDataFrameDeleteDataFrameTransform (opts) { +function buildTransformDeleteTransform (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 - * https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-data-frame-transform.html + * Perform a transform.delete_transform request + * https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html */ - return function dataFrameDeleteDataFrameTransform (params, options, callback) { + return function transformDeleteTransform (params, options, callback) { options = options || {} if (typeof options === 'function') { callback = options @@ -74,4 +74,4 @@ function buildDataFrameDeleteDataFrameTransform (opts) { } } -module.exports = buildDataFrameDeleteDataFrameTransform +module.exports = buildTransformDeleteTransform diff --git a/api/api/data_frame.get_data_frame_transform.js b/api/api/transform.get_transform.js similarity index 87% rename from api/api/data_frame.get_data_frame_transform.js rename to api/api/transform.get_transform.js index 9d9541004..b701dc9b7 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 - * https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html + * 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 @@ -75,4 +75,4 @@ function buildDataFrameGetDataFrameTransform (opts) { } } -module.exports = buildDataFrameGetDataFrameTransform +module.exports = buildTransformGetTransform diff --git a/api/api/data_frame.get_data_frame_transform_stats.js b/api/api/transform.get_transform_stats.js similarity index 87% rename from api/api/data_frame.get_data_frame_transform_stats.js rename to api/api/transform.get_transform_stats.js index 27619ac76..b5d278ece 100644 --- a/api/api/data_frame.get_data_frame_transform_stats.js +++ b/api/api/transform.get_transform_stats.js @@ -7,7 +7,7 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ -function buildDataFrameGetDataFrameTransformStats (opts) { +function buildTransformGetTransformStats (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 - * https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html + * Perform a transform.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 transformGetTransformStats (params, options, callback) { options = options || {} if (typeof options === 'function') { callback = options @@ -76,4 +76,4 @@ function buildDataFrameGetDataFrameTransformStats (opts) { } } -module.exports = buildDataFrameGetDataFrameTransformStats +module.exports = buildTransformGetTransformStats diff --git a/api/api/data_frame.preview_data_frame_transform.js b/api/api/transform.preview_transform.js similarity index 86% rename from api/api/data_frame.preview_data_frame_transform.js rename to api/api/transform.preview_transform.js index aaa315577..5d3692784 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 - * https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html + * 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 @@ -74,4 +74,4 @@ function buildDataFramePreviewDataFrameTransform (opts) { } } -module.exports = buildDataFramePreviewDataFrameTransform +module.exports = buildTransformPreviewTransform diff --git a/api/api/data_frame.put_data_frame_transform.js b/api/api/transform.put_transform.js similarity index 88% rename from api/api/data_frame.put_data_frame_transform.js rename to api/api/transform.put_transform.js index 700b596ac..53069e4e9 100644 --- a/api/api/data_frame.put_data_frame_transform.js +++ b/api/api/transform.put_transform.js @@ -7,7 +7,7 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ -function buildDataFramePutDataFrameTransform (opts) { +function buildTransformPutTransform (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 - * https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html + * Perform a transform.put_transform request + * https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html */ - return function dataFramePutDataFrameTransform (params, options, callback) { + return function transformPutTransform (params, options, callback) { options = options || {} if (typeof options === 'function') { callback = options @@ -78,4 +78,4 @@ function buildDataFramePutDataFrameTransform (opts) { } } -module.exports = buildDataFramePutDataFrameTransform +module.exports = buildTransformPutTransform diff --git a/api/api/data_frame.start_data_frame_transform.js b/api/api/transform.start_transform.js similarity index 87% rename from api/api/data_frame.start_data_frame_transform.js rename to api/api/transform.start_transform.js index 95e65881c..08e2f4826 100644 --- a/api/api/data_frame.start_data_frame_transform.js +++ b/api/api/transform.start_transform.js @@ -7,7 +7,7 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ -function buildDataFrameStartDataFrameTransform (opts) { +function buildTransformStartTransform (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 - * https://www.elastic.co/guide/en/elasticsearch/reference/current/start-data-frame-transform.html + * Perform a transform.start_transform request + * https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html */ - return function dataFrameStartDataFrameTransform (params, options, callback) { + return function transformStartTransform (params, options, callback) { options = options || {} if (typeof options === 'function') { callback = options @@ -74,4 +74,4 @@ function buildDataFrameStartDataFrameTransform (opts) { } } -module.exports = buildDataFrameStartDataFrameTransform +module.exports = buildTransformStartTransform diff --git a/api/api/data_frame.stop_data_frame_transform.js b/api/api/transform.stop_transform.js similarity index 88% rename from api/api/data_frame.stop_data_frame_transform.js rename to api/api/transform.stop_transform.js index b99f40474..41b3fe706 100644 --- a/api/api/data_frame.stop_data_frame_transform.js +++ b/api/api/transform.stop_transform.js @@ -7,7 +7,7 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ -function buildDataFrameStopDataFrameTransform (opts) { +function buildTransformStopTransform (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 - * https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html + * Perform a transform.stop_transform request + * https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html */ - return function dataFrameStopDataFrameTransform (params, options, callback) { + return function transformStopTransform (params, options, callback) { options = options || {} if (typeof options === 'function') { callback = options @@ -77,4 +77,4 @@ function buildDataFrameStopDataFrameTransform (opts) { } } -module.exports = buildDataFrameStopDataFrameTransform +module.exports = buildTransformStopTransform diff --git a/api/api/data_frame.update_data_frame_transform.js b/api/api/transform.update_transform.js similarity index 88% rename from api/api/data_frame.update_data_frame_transform.js rename to api/api/transform.update_transform.js index e1d980bde..caeab7f51 100644 --- a/api/api/data_frame.update_data_frame_transform.js +++ b/api/api/transform.update_transform.js @@ -7,7 +7,7 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ -function buildDataFrameUpdateDataFrameTransform (opts) { +function buildTransformUpdateTransform (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 - * https://www.elastic.co/guide/en/elasticsearch/reference/current/update-data-frame-transform.html + * Perform a transform.update_transform request + * https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html */ - return function dataFrameUpdateDataFrameTransform (params, options, callback) { + return function transformUpdateTransform (params, options, callback) { options = options || {} if (typeof options === 'function') { callback = options @@ -78,4 +78,4 @@ function buildDataFrameUpdateDataFrameTransform (opts) { } } -module.exports = buildDataFrameUpdateDataFrameTransform +module.exports = buildTransformUpdateTransform diff --git a/api/index.js b/api/index.js index 74e211cf8..b1329cfca 100644 --- a/api/index.js +++ b/api/index.js @@ -82,42 +82,6 @@ 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) - }, - 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) - }, delete: lazyLoad('delete', opts), delete_by_query: lazyLoad('delete_by_query', opts), deleteByQuery: lazyLoad('delete_by_query', opts), @@ -508,6 +472,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 549596b72..a24b2ded7 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -159,7 +159,9 @@ 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'; + detailed?: boolean; master_timeout?: string; h?: string | string[]; help?: boolean; @@ -422,7 +424,6 @@ export interface DeleteScript extends Generic { export interface Exists extends Generic { id: string; index: string; - type?: string; _source_exclude?: string | string[]; _source_include?: string | string[]; stored_fields?: string | string[]; @@ -457,7 +458,6 @@ export interface ExistsSource extends Generic { export interface Explain extends Generic { id: string; index: string; - type?: string; _source_exclude?: string | string[]; _source_include?: string | string[]; analyze_wildcard?: boolean; @@ -487,7 +487,6 @@ export interface FieldCaps extends Generic { export interface Get extends Generic { id: string; index: string; - type?: string; _source_exclude?: string | string[]; _source_include?: string | string[]; stored_fields?: string | string[]; @@ -510,7 +509,6 @@ export interface GetScript extends Generic { export interface GetSource extends Generic { id: string; index: string; - type?: string; _source_exclude?: string | string[]; _source_include?: string | string[]; preference?: string; @@ -692,7 +690,6 @@ export interface IndicesGetAlias extends Generic { export interface IndicesGetFieldMapping extends Generic { fields: string | string[]; index?: string | string[]; - type?: string | string[]; include_type_name?: boolean; include_defaults?: boolean; ignore_unavailable?: boolean; @@ -703,8 +700,6 @@ export interface IndicesGetFieldMapping extends Generic { export interface IndicesGetMapping extends Generic { index?: string | string[]; - type?: string | string[]; - include_type_name?: boolean; ignore_unavailable?: boolean; allow_no_indices?: boolean; expand_wildcards?: 'open' | 'closed' | 'none' | 'all'; @@ -758,9 +753,7 @@ export interface IndicesPutAlias extends Generic { } export interface IndicesPutMapping extends Generic { - index?: string | string[]; - type?: string; - include_type_name?: boolean; + index: string | string[]; timeout?: string; master_timeout?: string; ignore_unavailable?: boolean; @@ -930,7 +923,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[]; @@ -1378,56 +1370,8 @@ export interface CcrUnfollow extends Generic { index: string; } -export interface DataFrameDeleteDataFrameTransform extends Generic { - transform_id: string; - force?: boolean; -} - -export interface DataFrameGetDataFrameTransform extends Generic { - transform_id?: string; - from?: number; - size?: number; - allow_no_match?: boolean; -} - -export interface DataFrameGetDataFrameTransformStats extends Generic { - transform_id: string; - from?: number; - size?: number; - allow_no_match?: boolean; -} - -export interface DataFramePreviewDataFrameTransform extends Generic { - body: T; -} - -export interface DataFramePutDataFrameTransform extends Generic { - transform_id: string; - defer_validation?: boolean; - body: T; -} - -export interface DataFrameStartDataFrameTransform extends Generic { - transform_id: string; - timeout?: string; -} - -export interface DataFrameStopDataFrameTransform extends Generic { - transform_id: string; - wait_for_completion?: boolean; - timeout?: string; - allow_no_match?: boolean; -} - -export interface DataFrameUpdateDataFrameTransform extends Generic { - transform_id: string; - defer_validation?: boolean; - body: T; -} - export interface GraphExplore extends Generic { index: string | string[]; - type?: string | string[]; routing?: string; timeout?: string; body?: T; @@ -2089,6 +2033,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 fd2a82f56..bf16778f1 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -645,7 +645,9 @@ 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', + detailed: boolean, master_timeout: string, h: string | string[], help: boolean, @@ -657,14 +659,20 @@ 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 +|`detailed` +|`boolean` - If `true`, the response includes detailed information about shard recoveries + |`master_timeout` or `masterTimeout` |`string` - Explicit operation timeout for connection to master node @@ -1703,7 +1711,6 @@ link:{ref}/modules-scripting.html[Reference] client.exists({ id: string, index: string, - type: string, stored_fields: string | string[], preference: string, realtime: boolean, @@ -1725,11 +1732,6 @@ link:{ref}/docs-get.html[Reference] |`index` |`string` - The name of the index -|`type` -|`string` - The type of the document (use `_all` to fetch the first document matching the ID across all types) + - -WARNING: This parameter has been deprecated. - |`stored_fields` or `storedFields` |`string \| string[]` - A comma-separated list of stored fields to return in the response @@ -1831,7 +1833,6 @@ WARNING: This parameter has been deprecated. client.explain({ id: string, index: string, - type: string, analyze_wildcard: boolean, analyzer: string, default_operator: 'AND' | 'OR', @@ -1856,11 +1857,6 @@ link:{ref}/search-explain.html[Reference] |`index` |`string` - The name of the index -|`type` -|`string` - The type of the document + - -WARNING: This parameter has been deprecated. - |`analyze_wildcard` or `analyzeWildcard` |`boolean` - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) @@ -1947,7 +1943,6 @@ _Default:_ `open` client.get({ id: string, index: string, - type: string, stored_fields: string | string[], preference: string, realtime: boolean, @@ -1969,11 +1964,6 @@ link:{ref}/docs-get.html[Reference] |`index` |`string` - The name of the index -|`type` -|`string` - The type of the document (use `_all` to fetch the first document matching the ID across all types) + - -WARNING: This parameter has been deprecated. - |`stored_fields` or `storedFields` |`string \| string[]` - A comma-separated list of stored fields to return in the response @@ -2033,7 +2023,6 @@ link:{ref}/modules-scripting.html[Reference] client.getSource({ id: string, index: string, - type: string, preference: string, realtime: boolean, refresh: boolean, @@ -2054,11 +2043,6 @@ link:{ref}/docs-get.html[Reference] |`index` |`string` - The name of the index -|`type` -|`string` - The type of the document; deprecated and optional starting with 7.0 + - -WARNING: This parameter has been deprecated. - |`preference` |`string` - Specify the node or shard the operation should be performed on (default: random) @@ -2769,7 +2753,6 @@ _Default:_ `all` client.indices.getFieldMapping({ fields: string | string[], index: string | string[], - type: string | string[], include_type_name: boolean, include_defaults: boolean, ignore_unavailable: boolean, @@ -2787,11 +2770,6 @@ link:{ref}/indices-get-field-mapping.html[Reference] |`index` |`string \| string[]` - A comma-separated list of index names -|`type` -|`string \| string[]` - A comma-separated list of document types + - -WARNING: This parameter has been deprecated. - |`include_type_name` or `includeTypeName` |`boolean` - Whether a type should be returned in the body of the mappings. @@ -2819,8 +2797,6 @@ _Default:_ `open` ---- client.indices.getMapping({ index: string | string[], - type: string | string[], - include_type_name: boolean, ignore_unavailable: boolean, allow_no_indices: boolean, expand_wildcards: 'open' | 'closed' | 'none' | 'all', @@ -2834,14 +2810,6 @@ link:{ref}/indices-get-mapping.html[Reference] |`index` |`string \| string[]` - A comma-separated list of index names -|`type` -|`string \| string[]` - A comma-separated list of document types + - -WARNING: This parameter has been deprecated. - -|`include_type_name` or `includeTypeName` -|`boolean` - Whether to add the type name to the response (default: false) - |`ignore_unavailable` or `ignoreUnavailable` |`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3049,8 +3017,6 @@ link:{ref}/indices-aliases.html[Reference] ---- client.indices.putMapping({ index: string | string[], - type: string, - include_type_name: boolean, timeout: string, master_timeout: string, ignore_unavailable: boolean, @@ -3065,14 +3031,6 @@ link:{ref}/indices-put-mapping.html[Reference] |`index` |`string \| string[]` - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. -|`type` -|`string` - The name of the document type + - -WARNING: This parameter has been deprecated. - -|`include_type_name` or `includeTypeName` -|`boolean` - Whether a type should be expected in the body of the mappings. - |`timeout` |`string` - Explicit operation timeout @@ -3742,7 +3700,6 @@ link:{ref}/simulate-pipeline-api.html[Reference] ---- client.mget({ index: string, - type: string, stored_fields: string | string[], preference: string, realtime: boolean, @@ -3760,11 +3717,6 @@ link:{ref}/docs-multi-get.html[Reference] |`index` |`string` - The name of the index -|`type` -|`string` - The type of the document + - -WARNING: This parameter has been deprecated. - |`stored_fields` or `storedFields` |`string \| string[]` - A comma-separated list of stored fields to return in the response @@ -3790,7 +3742,7 @@ WARNING: This parameter has been deprecated. |`string \| string[]` - A list of fields to extract and return from the _source field |`body` -|`object` - Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL. +|`object` - Document identifiers; can be either `docs` (containing full document information) or `ids` (when index is provided in the URL. |=== @@ -5541,201 +5493,12 @@ link:http://www.elastic.co/guide/en/elasticsearch/reference/current[Reference] |=== -=== dataFrame.deleteDataFrameTransform -*Stability:* beta -[source,ts] ----- -client.dataFrame.deleteDataFrameTransform({ - transform_id: string, - force: boolean -}) ----- -link:{ref}/delete-data-frame-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. - -|=== - -=== dataFrame.getDataFrameTransform -*Stability:* beta -[source,ts] ----- -client.dataFrame.getDataFrameTransform({ - transform_id: string, - from: number, - size: number, - allow_no_match: boolean -}) ----- -link:{ref}/get-data-frame-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 data frame transforms. (This includes `_all` string or when no data frame transforms have been specified) - -|=== - -=== dataFrame.getDataFrameTransformStats -*Stability:* beta -[source,ts] ----- -client.dataFrame.getDataFrameTransformStats({ - transform_id: string, - from: number, - size: number, - allow_no_match: boolean -}) ----- -link:{ref}/get-data-frame-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 data frame transforms. (This includes `_all` string or when no data frame transforms have been specified) - -|=== - -=== dataFrame.previewDataFrameTransform -*Stability:* beta -[source,ts] ----- -client.dataFrame.previewDataFrameTransform({ - body: object -}) ----- -link:{ref}/preview-data-frame-transform.html[Reference] -[cols=2*] -|=== -|`body` -|`object` - The definition for the data_frame transform to preview - -|=== - -=== dataFrame.putDataFrameTransform -*Stability:* beta -[source,ts] ----- -client.dataFrame.putDataFrameTransform({ - transform_id: string, - defer_validation: boolean, - body: object -}) ----- -link:{ref}/put-data-frame-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 data frame transform starts, defaults to false. - -|`body` -|`object` - The data frame transform definition - -|=== - -=== dataFrame.startDataFrameTransform -*Stability:* beta -[source,ts] ----- -client.dataFrame.startDataFrameTransform({ - transform_id: string, - timeout: string -}) ----- -link:{ref}/start-data-frame-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 - -|=== - -=== dataFrame.stopDataFrameTransform -*Stability:* beta -[source,ts] ----- -client.dataFrame.stopDataFrameTransform({ - transform_id: string, - wait_for_completion: boolean, - timeout: string, - allow_no_match: boolean -}) ----- -link:{ref}/stop-data-frame-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 data frame transforms. (This includes `_all` string or when no data frame transforms have been specified) - -|=== - -=== dataFrame.updateDataFrameTransform -*Stability:* beta -[source,ts] ----- -client.dataFrame.updateDataFrameTransform({ - transform_id: string, - defer_validation: boolean, - body: object -}) ----- -link:{ref}/update-data-frame-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 data frame transform starts, defaults to false. - -|`body` -|`object` - The update data frame transform definition - -|=== - === graph.explore [source,ts] ---- client.graph.explore({ index: string | string[], - type: string | string[], routing: string, timeout: string, body: object @@ -5747,11 +5510,6 @@ link:{ref}/graph-explore-api.html[Reference] |`index` |`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -|`type` -|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types + - -WARNING: This parameter has been deprecated. - |`routing` |`string` - Specific routing value @@ -8338,6 +8096,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 1357bb2ae..cafbae25b 100644 --- a/index.d.ts +++ b/index.d.ts @@ -180,38 +180,6 @@ 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 - } - 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 - } delete: ApiMethod delete_by_query: ApiMethod deleteByQuery: ApiMethod @@ -257,6 +225,7 @@ declare class Client extends EventEmitter { analyze: ApiMethod clear_cache: ApiMethod clearCache: ApiMethod + clone: ApiMethod close: ApiMethod create: ApiMethod delete: ApiMethod @@ -368,6 +337,8 @@ declare class Client extends EventEmitter { deleteJob: ApiMethod delete_model_snapshot: ApiMethod deleteModelSnapshot: ApiMethod + estimate_memory_usage: ApiMethod + estimateMemoryUsage: ApiMethod evaluate_data_frame: ApiMethod evaluateDataFrame: ApiMethod find_file_structure: ApiMethod @@ -562,10 +533,14 @@ declare class Client extends EventEmitter { executeLifecycle: ApiMethod get_lifecycle: ApiMethod getLifecycle: ApiMethod + get_stats: ApiMethod + getStats: ApiMethod put_lifecycle: ApiMethod putLifecycle: ApiMethod } snapshot: { + cleanup_repository: ApiMethod + cleanupRepository: ApiMethod create: ApiMethod create_repository: ApiMethod createRepository: ApiMethod @@ -595,6 +570,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