API generation

This commit is contained in:
delvedor
2019-07-01 12:41:44 +02:00
parent ca50f580f4
commit 2186396570
17 changed files with 982 additions and 55 deletions

View File

@ -31,15 +31,17 @@ function buildDataFrameGetDataFrameTransform (opts) {
* @param {string} transform_id - The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms
* @param {int} from - skips a number of transform configs, defaults to 0
* @param {int} size - specifies a max number of transforms to get, defaults to 100
* @param {boolean} allow_no_match - 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)
*/
const acceptedQuerystring = [
'from',
'size'
'size',
'allow_no_match'
]
const snakeCase = {
allowNoMatch: 'allow_no_match'
}
return function dataFrameGetDataFrameTransform (params, options, callback) {

View File

@ -31,15 +31,17 @@ function buildDataFrameGetDataFrameTransformStats (opts) {
* @param {string} transform_id - The id of the transform for which to get stats. '_all' or '*' implies all transforms
* @param {number} from - skips a number of transform stats, defaults to 0
* @param {number} size - specifies a max number of transform stats to get, defaults to 100
* @param {boolean} allow_no_match - 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)
*/
const acceptedQuerystring = [
'from',
'size'
'size',
'allow_no_match'
]
const snakeCase = {
allowNoMatch: 'allow_no_match'
}
return function dataFrameGetDataFrameTransformStats (params, options, callback) {

View File

@ -31,16 +31,18 @@ function buildDataFrameStopDataFrameTransform (opts) {
* @param {string} transform_id - The id of the transform to stop
* @param {boolean} wait_for_completion - Whether to wait for the transform to fully stop before returning or not. Default to false
* @param {time} timeout - Controls the time to wait until the transform has stopped. Default to 30 seconds
* @param {boolean} allow_no_match - 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)
*/
const acceptedQuerystring = [
'wait_for_completion',
'timeout'
'timeout',
'allow_no_match'
]
const snakeCase = {
waitForCompletion: 'wait_for_completion'
waitForCompletion: 'wait_for_completion',
allowNoMatch: 'allow_no_match'
}
return function dataFrameStopDataFrameTransform (params, options, callback) {

View File

@ -45,7 +45,6 @@ function buildDeleteByQuery (opts) {
* @param {time} scroll - Specify how long a consistent view of the index should be maintained for scrolled search
* @param {enum} search_type - Search operation type
* @param {time} search_timeout - Explicit timeout for each search request. Defaults to no timeout.
* @param {number} size - Deprecated, please use `max_docs` instead
* @param {number} max_docs - Maximum number of documents to process (default: all documents)
* @param {list} sort - A comma-separated list of <field>:<direction> pairs
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
@ -82,7 +81,6 @@ function buildDeleteByQuery (opts) {
'scroll',
'search_type',
'search_timeout',
'size',
'max_docs',
'sort',
'_source',

View File

@ -0,0 +1,103 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildIndicesReloadSearchAnalyzers (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [indices.reload_search_analyzers](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-reload-analyzers.html) request
*
* @param {list} index - A comma-separated list of index names to reload analyzers for
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
*/
const acceptedQuerystring = [
'ignore_unavailable',
'allow_no_indices',
'expand_wildcards'
]
const snakeCase = {
ignoreUnavailable: 'ignore_unavailable',
allowNoIndices: 'allow_no_indices',
expandWildcards: 'expand_wildcards'
}
return function indicesReloadSearchAnalyzers (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('This API does not require a 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, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
if (method == null) {
method = body == null ? 'GET' : 'POST'
}
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
path = '/' + encodeURIComponent(index) + '/' + '_reload_search_analyzers'
// build request object
const request = {
method,
path,
body: '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildIndicesReloadSearchAnalyzers

View File

@ -0,0 +1,100 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlDeleteDataFrameAnalytics (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.delete_data_frame_analytics](undefined) request
*
* @param {string} id - The ID of the data frame analytics to delete
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function mlDeleteDataFrameAnalytics (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['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
if (params.body != null) {
const err = new ConfigurationError('This API does not require a 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, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
if (method == null) {
method = 'DELETE'
}
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildMlDeleteDataFrameAnalytics

View File

@ -22,30 +22,24 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildScriptsPainlessContext (opts) {
function buildMlEvaluateDataFrame (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [scripts_painless_context](undefined) request
* Perform a [ml.evaluate_data_frame](undefined) request
*
* @param {string} context - Select a specific context to retrieve API information about
* @param {object} body - The evaluation definition
*/
const acceptedQuerystring = [
'context',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function scriptsPainlessContext (params, options, callback) {
return function mlEvaluateDataFrame (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -57,6 +51,12 @@ function buildScriptsPainlessContext (opts) {
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}`)
@ -68,7 +68,7 @@ function buildScriptsPainlessContext (opts) {
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
if (method == null) {
method = 'GET'
method = 'POST'
}
var ignore = options.ignore
@ -78,13 +78,13 @@ function buildScriptsPainlessContext (opts) {
var path = ''
path = '/' + '_scripts' + '/' + 'painless' + '/' + '_context'
path = '/' + '_ml' + '/' + 'data_frame' + '/' + '_evaluate'
// build request object
const request = {
method,
path,
body: null,
body: body || '',
querystring
}
@ -93,4 +93,4 @@ function buildScriptsPainlessContext (opts) {
}
}
module.exports = buildScriptsPainlessContext
module.exports = buildMlEvaluateDataFrame

View File

@ -0,0 +1,106 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlGetDataFrameAnalytics (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.get_data_frame_analytics](undefined) request
*
* @param {string} id - The ID of the data frame analytics to fetch
* @param {boolean} allow_no_match - Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified)
* @param {int} from - skips a number of analytics
* @param {int} size - specifies a max number of analytics to get
*/
const acceptedQuerystring = [
'allow_no_match',
'from',
'size'
]
const snakeCase = {
allowNoMatch: 'allow_no_match'
}
return function mlGetDataFrameAnalytics (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('This API does not require a 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, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
if (method == null) {
method = 'GET'
}
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((id) != null) {
path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id)
} else {
path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildMlGetDataFrameAnalytics

View File

@ -0,0 +1,106 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlGetDataFrameAnalyticsStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.get_data_frame_analytics_stats](undefined) request
*
* @param {string} id - The ID of the data frame analytics stats to fetch
* @param {boolean} allow_no_match - Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified)
* @param {int} from - skips a number of analytics
* @param {int} size - specifies a max number of analytics to get
*/
const acceptedQuerystring = [
'allow_no_match',
'from',
'size'
]
const snakeCase = {
allowNoMatch: 'allow_no_match'
}
return function mlGetDataFrameAnalyticsStats (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('This API does not require a 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, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
if (method == null) {
method = 'GET'
}
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((id) != null) {
path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id) + '/' + '_stats'
} else {
path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + '_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 = buildMlGetDataFrameAnalyticsStats

View File

@ -0,0 +1,101 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlPutDataFrameAnalytics (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.put_data_frame_analytics](undefined) request
*
* @param {string} id - The ID of the data frame analytics to create
* @param {object} body - The data frame analytics configuration
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function mlPutDataFrameAnalytics (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['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
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, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
if (method == null) {
method = 'PUT'
}
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildMlPutDataFrameAnalytics

View File

@ -0,0 +1,98 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlStartDataFrameAnalytics (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.start_data_frame_analytics](undefined) request
*
* @param {string} id - The ID of the data frame analytics to start
* @param {time} timeout - Controls the time to wait until the task has started. Defaults to 20 seconds
* @param {object} body - The start data frame analytics parameters
*/
const acceptedQuerystring = [
'timeout'
]
const snakeCase = {
}
return function mlStartDataFrameAnalytics (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['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
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, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
if (method == null) {
method = 'POST'
}
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id) + '/' + '_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 = buildMlStartDataFrameAnalytics

View File

@ -0,0 +1,101 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlStopDataFrameAnalytics (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.stop_data_frame_analytics](undefined) request
*
* @param {string} id - The ID of the data frame analytics to stop
* @param {boolean} allow_no_match - Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified)
* @param {time} timeout - Controls the time to wait until the task has stopped. Defaults to 20 seconds
* @param {object} body - The stop data frame analytics parameters
*/
const acceptedQuerystring = [
'allow_no_match',
'timeout'
]
const snakeCase = {
allowNoMatch: 'allow_no_match'
}
return function mlStopDataFrameAnalytics (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['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
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, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
if (method == null) {
method = 'POST'
}
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id) + '/' + '_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 = buildMlStopDataFrameAnalytics

View File

@ -46,7 +46,6 @@ function buildUpdateByQuery (opts) {
* @param {time} scroll - Specify how long a consistent view of the index should be maintained for scrolled search
* @param {enum} search_type - Search operation type
* @param {time} search_timeout - Explicit timeout for each search request. Defaults to no timeout.
* @param {number} size - Deprecated, please use `max_docs` instead
* @param {number} max_docs - Maximum number of documents to process (default: all documents)
* @param {list} sort - A comma-separated list of <field>:<direction> pairs
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
@ -85,7 +84,6 @@ function buildUpdateByQuery (opts) {
'scroll',
'search_type',
'search_timeout',
'size',
'max_docs',
'sort',
'_source',

View File

@ -217,6 +217,8 @@ function ESAPI (opts) {
putTemplate: lazyLoad('indices.put_template', opts),
recovery: lazyLoad('indices.recovery', opts),
refresh: lazyLoad('indices.refresh', opts),
reload_search_analyzers: lazyLoad('indices.reload_search_analyzers', opts),
reloadSearchAnalyzers: lazyLoad('indices.reload_search_analyzers', opts),
rollover: lazyLoad('indices.rollover', opts),
segments: lazyLoad('indices.segments', opts),
shard_stores: lazyLoad('indices.shard_stores', opts),
@ -269,6 +271,8 @@ function ESAPI (opts) {
deleteCalendarEvent: lazyLoad('ml.delete_calendar_event', opts),
delete_calendar_job: lazyLoad('ml.delete_calendar_job', opts),
deleteCalendarJob: lazyLoad('ml.delete_calendar_job', opts),
delete_data_frame_analytics: lazyLoad('ml.delete_data_frame_analytics', opts),
deleteDataFrameAnalytics: lazyLoad('ml.delete_data_frame_analytics', opts),
delete_datafeed: lazyLoad('ml.delete_datafeed', opts),
deleteDatafeed: lazyLoad('ml.delete_datafeed', opts),
delete_expired_data: lazyLoad('ml.delete_expired_data', opts),
@ -281,6 +285,8 @@ function ESAPI (opts) {
deleteJob: lazyLoad('ml.delete_job', opts),
delete_model_snapshot: lazyLoad('ml.delete_model_snapshot', opts),
deleteModelSnapshot: lazyLoad('ml.delete_model_snapshot', opts),
evaluate_data_frame: lazyLoad('ml.evaluate_data_frame', opts),
evaluateDataFrame: lazyLoad('ml.evaluate_data_frame', opts),
find_file_structure: lazyLoad('ml.find_file_structure', opts),
findFileStructure: lazyLoad('ml.find_file_structure', opts),
flush_job: lazyLoad('ml.flush_job', opts),
@ -294,6 +300,10 @@ function ESAPI (opts) {
getCalendars: lazyLoad('ml.get_calendars', opts),
get_categories: lazyLoad('ml.get_categories', opts),
getCategories: lazyLoad('ml.get_categories', opts),
get_data_frame_analytics: lazyLoad('ml.get_data_frame_analytics', opts),
getDataFrameAnalytics: lazyLoad('ml.get_data_frame_analytics', opts),
get_data_frame_analytics_stats: lazyLoad('ml.get_data_frame_analytics_stats', opts),
getDataFrameAnalyticsStats: lazyLoad('ml.get_data_frame_analytics_stats', opts),
get_datafeed_stats: lazyLoad('ml.get_datafeed_stats', opts),
getDatafeedStats: lazyLoad('ml.get_datafeed_stats', opts),
get_datafeeds: lazyLoad('ml.get_datafeeds', opts),
@ -325,6 +335,8 @@ function ESAPI (opts) {
putCalendar: lazyLoad('ml.put_calendar', opts),
put_calendar_job: lazyLoad('ml.put_calendar_job', opts),
putCalendarJob: lazyLoad('ml.put_calendar_job', opts),
put_data_frame_analytics: lazyLoad('ml.put_data_frame_analytics', opts),
putDataFrameAnalytics: lazyLoad('ml.put_data_frame_analytics', opts),
put_datafeed: lazyLoad('ml.put_datafeed', opts),
putDatafeed: lazyLoad('ml.put_datafeed', opts),
put_filter: lazyLoad('ml.put_filter', opts),
@ -335,8 +347,12 @@ function ESAPI (opts) {
revertModelSnapshot: lazyLoad('ml.revert_model_snapshot', opts),
set_upgrade_mode: lazyLoad('ml.set_upgrade_mode', opts),
setUpgradeMode: lazyLoad('ml.set_upgrade_mode', opts),
start_data_frame_analytics: lazyLoad('ml.start_data_frame_analytics', opts),
startDataFrameAnalytics: lazyLoad('ml.start_data_frame_analytics', opts),
start_datafeed: lazyLoad('ml.start_datafeed', opts),
startDatafeed: lazyLoad('ml.start_datafeed', opts),
stop_data_frame_analytics: lazyLoad('ml.stop_data_frame_analytics', opts),
stopDataFrameAnalytics: lazyLoad('ml.stop_data_frame_analytics', opts),
stop_datafeed: lazyLoad('ml.stop_datafeed', opts),
stopDatafeed: lazyLoad('ml.stop_datafeed', opts),
update_datafeed: lazyLoad('ml.update_datafeed', opts),
@ -395,8 +411,6 @@ function ESAPI (opts) {
stop_job: lazyLoad('rollup.stop_job', opts),
stopJob: lazyLoad('rollup.stop_job', opts)
},
scripts_painless_context: lazyLoad('scripts_painless_context', opts),
scriptsPainlessContext: lazyLoad('scripts_painless_context', opts),
scripts_painless_execute: lazyLoad('scripts_painless_execute', opts),
scriptsPainlessExecute: lazyLoad('scripts_painless_execute', opts),
scroll: lazyLoad('scroll', opts),

View File

@ -405,7 +405,6 @@ export interface DeleteByQuery<T = any> extends Generic {
scroll?: string;
search_type?: 'query_then_fetch' | 'dfs_query_then_fetch';
search_timeout?: string;
size?: number;
max_docs?: number;
sort?: string | string[];
_source?: string | string[];
@ -1074,10 +1073,6 @@ export interface RenderSearchTemplate<T = any> extends Generic {
body?: T;
}
export interface ScriptsPainlessContext extends Generic {
context?: string;
}
export interface ScriptsPainlessExecute<T = any> extends Generic {
body?: T;
}
@ -1310,7 +1305,6 @@ export interface UpdateByQuery<T = any> extends Generic {
scroll?: string;
search_type?: 'query_then_fetch' | 'dfs_query_then_fetch';
search_timeout?: string;
size?: number;
max_docs?: number;
sort?: string | string[];
_source?: string | string[];
@ -1392,12 +1386,14 @@ 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<T = any> extends Generic {
@ -1418,6 +1414,7 @@ export interface DataFrameStopDataFrameTransform extends Generic {
transform_id: string;
wait_for_completion?: boolean;
timeout?: string;
allow_no_match?: boolean;
}
export interface GraphExplore<T = any> extends Generic {
@ -1477,6 +1474,13 @@ export interface IndicesFreeze extends Generic {
wait_for_active_shards?: string;
}
export interface IndicesReloadSearchAnalyzers extends Generic {
index?: string | string[];
ignore_unavailable?: boolean;
allow_no_indices?: boolean;
expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
}
export interface IndicesUnfreeze extends Generic {
index: string;
timeout?: string;
@ -1540,6 +1544,10 @@ export interface MlDeleteCalendarJob extends Generic {
job_id: string;
}
export interface MlDeleteDataFrameAnalytics extends Generic {
id: string;
}
export interface MlDeleteDatafeed extends Generic {
datafeed_id: string;
force?: boolean;
@ -1570,6 +1578,10 @@ export interface MlDeleteModelSnapshot extends Generic {
snapshot_id: string;
}
export interface MlEvaluateDataFrame<T = any> extends Generic {
body: T;
}
export interface MlFindFileStructure<T = any> extends Generic {
lines_to_sample?: number;
line_merge_size_limit?: number;
@ -1643,6 +1655,20 @@ export interface MlGetCategories<T = any> extends Generic {
body?: T;
}
export interface MlGetDataFrameAnalytics extends Generic {
id?: string;
allow_no_match?: boolean;
from?: number;
size?: number;
}
export interface MlGetDataFrameAnalyticsStats extends Generic {
id?: string;
allow_no_match?: boolean;
from?: number;
size?: number;
}
export interface MlGetDatafeedStats extends Generic {
datafeed_id?: string;
allow_no_datafeeds?: boolean;
@ -1754,6 +1780,11 @@ export interface MlPutCalendarJob extends Generic {
job_id: string;
}
export interface MlPutDataFrameAnalytics<T = any> extends Generic {
id: string;
body: T;
}
export interface MlPutDatafeed<T = any> extends Generic {
datafeed_id: string;
body: T;
@ -1781,6 +1812,12 @@ export interface MlSetUpgradeMode extends Generic {
timeout?: string;
}
export interface MlStartDataFrameAnalytics<T = any> extends Generic {
id: string;
timeout?: string;
body?: T;
}
export interface MlStartDatafeed<T = any> extends Generic {
datafeed_id: string;
start?: string;
@ -1789,6 +1826,13 @@ export interface MlStartDatafeed<T = any> extends Generic {
body?: T;
}
export interface MlStopDataFrameAnalytics<T = any> extends Generic {
id: string;
allow_no_match?: boolean;
timeout?: string;
body?: T;
}
export interface MlStopDatafeed extends Generic {
datafeed_id: string;
allow_no_datafeeds?: boolean;

View File

@ -1205,9 +1205,6 @@ _Default:_ `open`
|`search_timeout` or `searchTimeout`
|`string` - Explicit timeout for each search request. Defaults to no timeout.
|`size`
|`number` - Deprecated, please use `max_docs` instead
|`max_docs` or `maxDocs`
|`number` - Maximum number of documents to process (default: all documents)
@ -3290,18 +3287,6 @@ link:{ref}/search-template.html[Reference]
|===
=== scriptsPainlessContext
[source,js]
----
client.scriptsPainlessContext([params] [, options] [, callback])
----
[cols=2*]
|===
|`context`
|`string` - Select a specific context to retrieve API information about
|===
=== scriptsPainlessExecute
[source,js]
----
@ -4026,9 +4011,6 @@ _Default:_ `open`
|`search_timeout` or `searchTimeout`
|`string` - Explicit timeout for each search request. Defaults to no timeout.
|`size`
|`number` - Deprecated, please use `max_docs` instead
|`max_docs` or `maxDocs`
|`number` - Maximum number of documents to process (default: all documents)
@ -4288,6 +4270,9 @@ link:{ref}/get-data-frame-transform.html[Reference]
|`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
@ -4307,6 +4292,9 @@ link:{ref}/get-data-frame-transform-stats.html[Reference]
|`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
@ -4371,6 +4359,9 @@ link:{ref}/stop-data-frame-transform.html[Reference]
|`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)
|===
=== graph.explore
@ -4551,6 +4542,29 @@ _Default:_ `closed`
|===
=== indices.reloadSearchAnalyzers
[source,js]
----
client.indices.reloadSearchAnalyzers([params] [, options] [, callback])
----
link:{ref}/indices-reload-analyzers.html[Reference]
[cols=2*]
|===
|`index`
|`string, string[]` - A comma-separated list of index names to reload analyzers for
|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|`expand_wildcards` or `expandWildcards`
|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`
|===
=== indices.unfreeze
[source,js]
----
@ -4745,6 +4759,18 @@ client.ml.deleteCalendarJob([params] [, options] [, callback])
|===
=== ml.deleteDataFrameAnalytics
[source,js]
----
client.ml.deleteDataFrameAnalytics([params] [, options] [, callback])
----
[cols=2*]
|===
|`id`
|`string` - The ID of the data frame analytics to delete
|===
=== ml.deleteDatafeed
[source,js]
----
@ -4838,6 +4864,18 @@ link:{ref}/ml-delete-snapshot.html[Reference]
|===
=== ml.evaluateDataFrame
[source,js]
----
client.ml.evaluateDataFrame([params] [, options] [, callback])
----
[cols=2*]
|===
|`body`
|`object` - The evaluation definition
|===
=== ml.findFileStructure
[source,js]
----
@ -5064,6 +5102,52 @@ link:{ref}/ml-get-category.html[Reference]
|===
=== ml.getDataFrameAnalytics
[source,js]
----
client.ml.getDataFrameAnalytics([params] [, options] [, callback])
----
[cols=2*]
|===
|`id`
|`string` - The ID of the data frame analytics to fetch
|`allow_no_match` or `allowNoMatch`
|`boolean` - Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified) +
_Default:_ `true`
|`from`
|`number` - skips a number of analytics
|`size`
|`number` - specifies a max number of analytics to get +
_Default:_ `100`
|===
=== ml.getDataFrameAnalyticsStats
[source,js]
----
client.ml.getDataFrameAnalyticsStats([params] [, options] [, callback])
----
[cols=2*]
|===
|`id`
|`string` - The ID of the data frame analytics stats to fetch
|`allow_no_match` or `allowNoMatch`
|`boolean` - Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified) +
_Default:_ `true`
|`from`
|`number` - skips a number of analytics
|`size`
|`number` - specifies a max number of analytics to get +
_Default:_ `100`
|===
=== ml.getDatafeedStats
[source,js]
----
@ -5406,6 +5490,21 @@ client.ml.putCalendarJob([params] [, options] [, callback])
|===
=== ml.putDataFrameAnalytics
[source,js]
----
client.ml.putDataFrameAnalytics([params] [, options] [, callback])
----
[cols=2*]
|===
|`id`
|`string` - The ID of the data frame analytics to create
|`body`
|`object` - The data frame analytics configuration
|===
=== ml.putDatafeed
[source,js]
----
@ -5491,6 +5590,24 @@ link:{ref}/ml-set-upgrade-mode.html[Reference]
|===
=== ml.startDataFrameAnalytics
[source,js]
----
client.ml.startDataFrameAnalytics([params] [, options] [, callback])
----
[cols=2*]
|===
|`id`
|`string` - The ID of the data frame analytics to start
|`timeout`
|`string` - Controls the time to wait until the task has started. Defaults to 20 seconds
|`body`
|`object` - The start data frame analytics parameters
|===
=== ml.startDatafeed
[source,js]
----
@ -5516,6 +5633,27 @@ link:{ref}/ml-start-datafeed.html[Reference]
|===
=== ml.stopDataFrameAnalytics
[source,js]
----
client.ml.stopDataFrameAnalytics([params] [, options] [, callback])
----
[cols=2*]
|===
|`id`
|`string` - The ID of the data frame analytics to stop
|`allow_no_match` or `allowNoMatch`
|`boolean` - Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified)
|`timeout`
|`string` - Controls the time to wait until the task has stopped. Defaults to 20 seconds
|`body`
|`object` - The stop data frame analytics parameters
|===
=== ml.stopDatafeed
[source,js]
----

18
index.d.ts vendored
View File

@ -312,6 +312,8 @@ declare class Client extends EventEmitter {
putTemplate: ApiMethod<RequestParams.IndicesPutTemplate>
recovery: ApiMethod<RequestParams.IndicesRecovery>
refresh: ApiMethod<RequestParams.IndicesRefresh>
reload_search_analyzers: ApiMethod<RequestParams.IndicesReloadSearchAnalyzers>
reloadSearchAnalyzers: ApiMethod<RequestParams.IndicesReloadSearchAnalyzers>
rollover: ApiMethod<RequestParams.IndicesRollover>
segments: ApiMethod<RequestParams.IndicesSegments>
shard_stores: ApiMethod<RequestParams.IndicesShardStores>
@ -364,6 +366,8 @@ declare class Client extends EventEmitter {
deleteCalendarEvent: ApiMethod<RequestParams.MlDeleteCalendarEvent>
delete_calendar_job: ApiMethod<RequestParams.MlDeleteCalendarJob>
deleteCalendarJob: ApiMethod<RequestParams.MlDeleteCalendarJob>
delete_data_frame_analytics: ApiMethod<RequestParams.MlDeleteDataFrameAnalytics>
deleteDataFrameAnalytics: ApiMethod<RequestParams.MlDeleteDataFrameAnalytics>
delete_datafeed: ApiMethod<RequestParams.MlDeleteDatafeed>
deleteDatafeed: ApiMethod<RequestParams.MlDeleteDatafeed>
delete_expired_data: ApiMethod<RequestParams.MlDeleteExpiredData>
@ -376,6 +380,8 @@ declare class Client extends EventEmitter {
deleteJob: ApiMethod<RequestParams.MlDeleteJob>
delete_model_snapshot: ApiMethod<RequestParams.MlDeleteModelSnapshot>
deleteModelSnapshot: ApiMethod<RequestParams.MlDeleteModelSnapshot>
evaluate_data_frame: ApiMethod<RequestParams.MlEvaluateDataFrame>
evaluateDataFrame: ApiMethod<RequestParams.MlEvaluateDataFrame>
find_file_structure: ApiMethod<RequestParams.MlFindFileStructure>
findFileStructure: ApiMethod<RequestParams.MlFindFileStructure>
flush_job: ApiMethod<RequestParams.MlFlushJob>
@ -389,6 +395,10 @@ declare class Client extends EventEmitter {
getCalendars: ApiMethod<RequestParams.MlGetCalendars>
get_categories: ApiMethod<RequestParams.MlGetCategories>
getCategories: ApiMethod<RequestParams.MlGetCategories>
get_data_frame_analytics: ApiMethod<RequestParams.MlGetDataFrameAnalytics>
getDataFrameAnalytics: ApiMethod<RequestParams.MlGetDataFrameAnalytics>
get_data_frame_analytics_stats: ApiMethod<RequestParams.MlGetDataFrameAnalyticsStats>
getDataFrameAnalyticsStats: ApiMethod<RequestParams.MlGetDataFrameAnalyticsStats>
get_datafeed_stats: ApiMethod<RequestParams.MlGetDatafeedStats>
getDatafeedStats: ApiMethod<RequestParams.MlGetDatafeedStats>
get_datafeeds: ApiMethod<RequestParams.MlGetDatafeeds>
@ -420,6 +430,8 @@ declare class Client extends EventEmitter {
putCalendar: ApiMethod<RequestParams.MlPutCalendar>
put_calendar_job: ApiMethod<RequestParams.MlPutCalendarJob>
putCalendarJob: ApiMethod<RequestParams.MlPutCalendarJob>
put_data_frame_analytics: ApiMethod<RequestParams.MlPutDataFrameAnalytics>
putDataFrameAnalytics: ApiMethod<RequestParams.MlPutDataFrameAnalytics>
put_datafeed: ApiMethod<RequestParams.MlPutDatafeed>
putDatafeed: ApiMethod<RequestParams.MlPutDatafeed>
put_filter: ApiMethod<RequestParams.MlPutFilter>
@ -430,8 +442,12 @@ declare class Client extends EventEmitter {
revertModelSnapshot: ApiMethod<RequestParams.MlRevertModelSnapshot>
set_upgrade_mode: ApiMethod<RequestParams.MlSetUpgradeMode>
setUpgradeMode: ApiMethod<RequestParams.MlSetUpgradeMode>
start_data_frame_analytics: ApiMethod<RequestParams.MlStartDataFrameAnalytics>
startDataFrameAnalytics: ApiMethod<RequestParams.MlStartDataFrameAnalytics>
start_datafeed: ApiMethod<RequestParams.MlStartDatafeed>
startDatafeed: ApiMethod<RequestParams.MlStartDatafeed>
stop_data_frame_analytics: ApiMethod<RequestParams.MlStopDataFrameAnalytics>
stopDataFrameAnalytics: ApiMethod<RequestParams.MlStopDataFrameAnalytics>
stop_datafeed: ApiMethod<RequestParams.MlStopDatafeed>
stopDatafeed: ApiMethod<RequestParams.MlStopDatafeed>
update_datafeed: ApiMethod<RequestParams.MlUpdateDatafeed>
@ -490,8 +506,6 @@ declare class Client extends EventEmitter {
stop_job: ApiMethod<RequestParams.RollupStopJob>
stopJob: ApiMethod<RequestParams.RollupStopJob>
}
scripts_painless_context: ApiMethod<RequestParams.ScriptsPainlessContext>
scriptsPainlessContext: ApiMethod<RequestParams.ScriptsPainlessContext>
scripts_painless_execute: ApiMethod<RequestParams.ScriptsPainlessExecute>
scriptsPainlessExecute: ApiMethod<RequestParams.ScriptsPainlessExecute>
scroll: ApiMethod<RequestParams.Scroll>