Master should use the latest version of ES (#780)

The `master` branch should work with the latest snapshot of Elasticsearch.

- Use `8.0.0-SNAPSHOT`
- Code generation
- Updated scripts and CI conf
This commit is contained in:
Tomas Della Vedova
2019-03-28 09:05:00 +01:00
committed by GitHub
parent f260549a4f
commit fb73b4b08d
68 changed files with 2044 additions and 901 deletions

View File

@ -39,6 +39,7 @@ function buildCatIndices (opts) {
* @param {boolean} pri - Set to true to return stats only for primary shards
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
* @param {boolean} include_unloaded_segments - If set to true segment stats will include stats for segments that are not currently loaded into memory
*/
const acceptedQuerystring = [
@ -52,6 +53,7 @@ function buildCatIndices (opts) {
'pri',
's',
'v',
'include_unloaded_segments',
'pretty',
'human',
'error_trace',
@ -61,6 +63,7 @@ function buildCatIndices (opts) {
const snakeCase = {
masterTimeout: 'master_timeout',
includeUnloadedSegments: 'include_unloaded_segments',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}

View File

@ -51,6 +51,12 @@ function buildCcrFollowStats (opts) {
options = {}
}
// check required parameters
if (params['index'] == null) {
const err = new ConfigurationError('Missing required parameter: 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}`)

View File

@ -22,25 +22,25 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMigrationUpgrade (opts) {
function buildCcrForgetFollower (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.migration.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-upgrade.html) request
* Perform a [ccr.forget_follower](http://www.elastic.co/guide/en/elasticsearch/reference/current) request
*
* @param {string} index - The name of the index
* @param {boolean} wait_for_completion - Should the request block until the upgrade operation is completed
* @param {string} index - the name of the leader index for which specified follower retention leases should be removed
* @param {object} body - the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index
*/
const acceptedQuerystring = [
'wait_for_completion'
]
const snakeCase = {
waitForCompletion: 'wait_for_completion'
}
return function xpackMigrationUpgrade (params, options, callback) {
return function ccrForgetFollower (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -57,6 +57,10 @@ function buildXpackMigrationUpgrade (opts) {
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)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
@ -79,7 +83,7 @@ function buildXpackMigrationUpgrade (opts) {
var path = ''
path = '/' + '_migration' + '/' + 'upgrade' + '/' + encodeURIComponent(index)
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'forget_follower'
// build request object
const request = {
@ -120,4 +124,4 @@ function buildXpackMigrationUpgrade (opts) {
}
}
module.exports = buildXpackMigrationUpgrade
module.exports = buildCcrForgetFollower

View File

@ -29,6 +29,7 @@ function buildClusterHealth (opts) {
* Perform a [cluster.health](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html) request
*
* @param {list} index - Limit the information returned to a specific index
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {enum} level - Specify the level of detail for returned information
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {time} master_timeout - Explicit operation timeout for connection to master node
@ -42,6 +43,7 @@ function buildClusterHealth (opts) {
*/
const acceptedQuerystring = [
'expand_wildcards',
'level',
'local',
'master_timeout',
@ -60,6 +62,7 @@ function buildClusterHealth (opts) {
]
const snakeCase = {
expandWildcards: 'expand_wildcards',
masterTimeout: 'master_timeout',
waitForActiveShards: 'wait_for_active_shards',
waitForNodes: 'wait_for_nodes',

View File

@ -0,0 +1,126 @@
/*
* 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 buildDataFrameDeleteDataFrameTransform (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [data_frame.delete_data_frame_transform](https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-data-frame-transform.html) request
*
* @param {string} transform_id - The id of the transform to delete
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function dataFrameDeleteDataFrameTransform (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['transform_id'] == null && params['transformId'] == null) {
const err = new ConfigurationError('Missing required parameter: transform_id or transformId')
return handleError(err, callback)
}
if (params.body != null) {
const err = new ConfigurationError('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 = null
var { method, body, transformId, transform_id } = params
var querystring = semicopy(params, ['method', 'body', 'transformId', 'transform_id'])
if (method == null) {
method = 'DELETE'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId)
// build request object
const request = {
method,
path,
body: '',
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildDataFrameDeleteDataFrameTransform

View File

@ -0,0 +1,129 @@
/*
* 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 buildDataFrameGetDataFrameTransform (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [data_frame.get_data_frame_transform](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html) request
*
* @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
*/
const acceptedQuerystring = [
'from',
'size'
]
const snakeCase = {
}
return function dataFrameGetDataFrameTransform (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 = null
var { method, body, transformId, transform_id } = params
var querystring = semicopy(params, ['method', 'body', 'transformId', 'transform_id'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
if ((transform_id || transformId) != null) {
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId)
} else {
path = '/' + '_data_frame' + '/' + 'transforms'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildDataFrameGetDataFrameTransform

View File

@ -0,0 +1,122 @@
/*
* 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 buildDataFrameGetDataFrameTransformStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [data_frame.get_data_frame_transform_stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html) request
*
* @param {string} transform_id - The id of the transform for which to get stats. '_all' or '*' implies all transforms
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function dataFrameGetDataFrameTransformStats (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 = null
var { method, body, transformId, transform_id } = params
var querystring = semicopy(params, ['method', 'body', 'transformId', 'transform_id'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stats'
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildDataFrameGetDataFrameTransformStats

View File

@ -0,0 +1,122 @@
/*
* 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 buildDataFramePreviewDataFrameTransform (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [data_frame.preview_data_frame_transform](https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html) request
*
* @param {object} body - The definition for the data_frame transform to preview
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function dataFramePreviewDataFrameTransform (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['body'] == null) {
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null
var { method, body } = params
var querystring = semicopy(params, ['method', 'body'])
if (method == null) {
method = 'POST'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + '_preview'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildDataFramePreviewDataFrameTransform

View File

@ -0,0 +1,127 @@
/*
* 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 buildDataFramePutDataFrameTransform (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [data_frame.put_data_frame_transform](https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html) request
*
* @param {string} transform_id - The id of the new transform.
* @param {object} body - The data frame transform definition
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function dataFramePutDataFrameTransform (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['transform_id'] == null && params['transformId'] == null) {
const err = new ConfigurationError('Missing required parameter: transform_id or transformId')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null
var { method, body, transformId, transform_id } = params
var querystring = semicopy(params, ['method', 'body', 'transformId', 'transform_id'])
if (method == null) {
method = 'PUT'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildDataFramePutDataFrameTransform

View File

@ -0,0 +1,127 @@
/*
* 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 buildDataFrameStartDataFrameTransform (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [data_frame.start_data_frame_transform](https://www.elastic.co/guide/en/elasticsearch/reference/current/start-data-frame-transform.html) request
*
* @param {string} transform_id - The id of the transform to start
* @param {time} timeout - Controls the time to wait for the transform to start
*/
const acceptedQuerystring = [
'timeout'
]
const snakeCase = {
}
return function dataFrameStartDataFrameTransform (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['transform_id'] == null && params['transformId'] == null) {
const err = new ConfigurationError('Missing required parameter: transform_id or transformId')
return handleError(err, callback)
}
if (params.body != null) {
const err = new ConfigurationError('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 = null
var { method, body, transformId, transform_id } = params
var querystring = semicopy(params, ['method', 'body', 'transformId', 'transform_id'])
if (method == null) {
method = 'POST'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_start'
// build request object
const request = {
method,
path,
body: '',
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildDataFrameStartDataFrameTransform

View File

@ -0,0 +1,130 @@
/*
* 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 buildDataFrameStopDataFrameTransform (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [data_frame.stop_data_frame_transform](https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html) request
*
* @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
*/
const acceptedQuerystring = [
'wait_for_completion',
'timeout'
]
const snakeCase = {
waitForCompletion: 'wait_for_completion'
}
return function dataFrameStopDataFrameTransform (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['transform_id'] == null && params['transformId'] == null) {
const err = new ConfigurationError('Missing required parameter: transform_id or transformId')
return handleError(err, callback)
}
if (params.body != null) {
const err = new ConfigurationError('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 = null
var { method, body, transformId, transform_id } = params
var querystring = semicopy(params, ['method', 'body', 'transformId', 'transform_id'])
if (method == null) {
method = 'POST'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stop'
// build request object
const request = {
method,
path,
body: '',
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildDataFrameStopDataFrameTransform

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackGraphExplore (opts) {
function buildGraphExplore (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.graph.explore](https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html) request
* Perform a [graph.explore](https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html) request
*
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
* @param {list} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
@ -44,7 +44,7 @@ function buildXpackGraphExplore (opts) {
}
return function xpackGraphExplore (params, options, callback) {
return function graphExplore (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -128,4 +128,4 @@ function buildXpackGraphExplore (opts) {
}
}
module.exports = buildXpackGraphExplore
module.exports = buildGraphExplore

View File

@ -29,11 +29,10 @@ function buildIlmExplainLifecycle (opts) {
* Perform a [ilm.explain_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html) request
*
* @param {string} index - The name of the index to explain
* @param {boolean} human - Return data such as dates in a human readable format
*/
const acceptedQuerystring = [
'human'
]
const snakeCase = {

View File

@ -34,6 +34,7 @@ function buildIndicesClose (opts) {
* @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.
* @param {string} wait_for_active_shards - Sets the number of active shards to wait for before the operation returns.
*/
const acceptedQuerystring = [
@ -42,6 +43,7 @@ function buildIndicesClose (opts) {
'ignore_unavailable',
'allow_no_indices',
'expand_wildcards',
'wait_for_active_shards',
'pretty',
'human',
'error_trace',
@ -54,6 +56,7 @@ function buildIndicesClose (opts) {
ignoreUnavailable: 'ignore_unavailable',
allowNoIndices: 'allow_no_indices',
expandWildcards: 'expand_wildcards',
waitForActiveShards: 'wait_for_active_shards',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}

View File

@ -30,7 +30,6 @@ function buildIndicesShrink (opts) {
*
* @param {string} index - The name of the source index to shrink
* @param {string} target - The name of the target index to shrink into
* @param {boolean} copy_settings - whether or not to copy settings from the source index (defaults to false)
* @param {time} timeout - Explicit operation timeout
* @param {time} master_timeout - Specify timeout for connection to master
* @param {string} wait_for_active_shards - Set the number of active shards to wait for on the shrunken index before the operation returns.
@ -38,7 +37,6 @@ function buildIndicesShrink (opts) {
*/
const acceptedQuerystring = [
'copy_settings',
'timeout',
'master_timeout',
'wait_for_active_shards',
@ -50,7 +48,6 @@ function buildIndicesShrink (opts) {
]
const snakeCase = {
copySettings: 'copy_settings',
masterTimeout: 'master_timeout',
waitForActiveShards: 'wait_for_active_shards',
errorTrace: 'error_trace',

View File

@ -30,7 +30,6 @@ function buildIndicesSplit (opts) {
*
* @param {string} index - The name of the source index to split
* @param {string} target - The name of the target index to split into
* @param {boolean} copy_settings - whether or not to copy settings from the source index (defaults to false)
* @param {time} timeout - Explicit operation timeout
* @param {time} master_timeout - Specify timeout for connection to master
* @param {string} wait_for_active_shards - Set the number of active shards to wait for on the shrunken index before the operation returns.
@ -38,7 +37,6 @@ function buildIndicesSplit (opts) {
*/
const acceptedQuerystring = [
'copy_settings',
'timeout',
'master_timeout',
'wait_for_active_shards',
@ -50,7 +48,6 @@ function buildIndicesSplit (opts) {
]
const snakeCase = {
copySettings: 'copy_settings',
masterTimeout: 'master_timeout',
waitForActiveShards: 'wait_for_active_shards',
errorTrace: 'error_trace',

View File

@ -37,6 +37,9 @@ function buildIndicesStats (opts) {
* @param {enum} level - Return stats aggregated at cluster, index or shard level
* @param {list} types - A comma-separated list of document types for the `indexing` index metric
* @param {boolean} include_segment_file_sizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)
* @param {boolean} include_unloaded_segments - If set to true segment stats will include stats for segments that are not currently loaded into memory
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {boolean} forbid_closed_indices - If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices
*/
const acceptedQuerystring = [
@ -47,6 +50,9 @@ function buildIndicesStats (opts) {
'level',
'types',
'include_segment_file_sizes',
'include_unloaded_segments',
'expand_wildcards',
'forbid_closed_indices',
'pretty',
'human',
'error_trace',
@ -58,6 +64,9 @@ function buildIndicesStats (opts) {
completionFields: 'completion_fields',
fielddataFields: 'fielddata_fields',
includeSegmentFileSizes: 'include_segment_file_sizes',
includeUnloadedSegments: 'include_unloaded_segments',
expandWildcards: 'expand_wildcards',
forbidClosedIndices: 'forbid_closed_indices',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackLicenseDelete (opts) {
function buildLicenseDelete (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.license.delete](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
* Perform a [license.delete](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
*
*/
@ -38,7 +38,7 @@ function buildXpackLicenseDelete (opts) {
}
return function xpackLicenseDelete (params, options, callback) {
return function licenseDelete (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -118,4 +118,4 @@ function buildXpackLicenseDelete (opts) {
}
}
module.exports = buildXpackLicenseDelete
module.exports = buildLicenseDelete

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackLicenseGet (opts) {
function buildLicenseGet (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.license.get](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
* Perform a [license.get](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
*
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
*/
@ -39,7 +39,7 @@ function buildXpackLicenseGet (opts) {
}
return function xpackLicenseGet (params, options, callback) {
return function licenseGet (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -119,4 +119,4 @@ function buildXpackLicenseGet (opts) {
}
}
module.exports = buildXpackLicenseGet
module.exports = buildLicenseGet

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackLicenseGetBasicStatus (opts) {
function buildLicenseGetBasicStatus (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.license.get_basic_status](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
* Perform a [license.get_basic_status](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
*
*/
@ -38,7 +38,7 @@ function buildXpackLicenseGetBasicStatus (opts) {
}
return function xpackLicenseGetBasicStatus (params, options, callback) {
return function licenseGetBasicStatus (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -118,4 +118,4 @@ function buildXpackLicenseGetBasicStatus (opts) {
}
}
module.exports = buildXpackLicenseGetBasicStatus
module.exports = buildLicenseGetBasicStatus

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackLicenseGetTrialStatus (opts) {
function buildLicenseGetTrialStatus (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.license.get_trial_status](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
* Perform a [license.get_trial_status](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
*
*/
@ -38,7 +38,7 @@ function buildXpackLicenseGetTrialStatus (opts) {
}
return function xpackLicenseGetTrialStatus (params, options, callback) {
return function licenseGetTrialStatus (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -118,4 +118,4 @@ function buildXpackLicenseGetTrialStatus (opts) {
}
}
module.exports = buildXpackLicenseGetTrialStatus
module.exports = buildLicenseGetTrialStatus

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackLicensePost (opts) {
function buildLicensePost (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.license.post](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
* Perform a [license.post](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
*
* @param {boolean} acknowledge - whether the user has acknowledged acknowledge messages (default: false)
* @param {object} body - licenses to be installed
@ -40,7 +40,7 @@ function buildXpackLicensePost (opts) {
}
return function xpackLicensePost (params, options, callback) {
return function licensePost (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -114,4 +114,4 @@ function buildXpackLicensePost (opts) {
}
}
module.exports = buildXpackLicensePost
module.exports = buildLicensePost

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackLicensePostStartBasic (opts) {
function buildLicensePostStartBasic (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.license.post_start_basic](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
* Perform a [license.post_start_basic](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
*
* @param {boolean} acknowledge - whether the user has acknowledged acknowledge messages (default: false)
*/
@ -39,7 +39,7 @@ function buildXpackLicensePostStartBasic (opts) {
}
return function xpackLicensePostStartBasic (params, options, callback) {
return function licensePostStartBasic (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -119,4 +119,4 @@ function buildXpackLicensePostStartBasic (opts) {
}
}
module.exports = buildXpackLicensePostStartBasic
module.exports = buildLicensePostStartBasic

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackLicensePostStartTrial (opts) {
function buildLicensePostStartTrial (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.license.post_start_trial](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
* Perform a [license.post_start_trial](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
*
* @param {string} type - The type of trial license to generate (default: "trial")
* @param {boolean} acknowledge - whether the user has acknowledged acknowledge messages (default: false)
@ -41,7 +41,7 @@ function buildXpackLicensePostStartTrial (opts) {
}
return function xpackLicensePostStartTrial (params, options, callback) {
return function licensePostStartTrial (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -121,4 +121,4 @@ function buildXpackLicensePostStartTrial (opts) {
}
}
module.exports = buildXpackLicensePostStartTrial
module.exports = buildLicensePostStartTrial

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMigrationDeprecations (opts) {
function buildMigrationDeprecations (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.migration.deprecations](http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html) request
* Perform a [migration.deprecations](http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html) request
*
* @param {string} index - Index pattern
*/
@ -39,7 +39,7 @@ function buildXpackMigrationDeprecations (opts) {
}
return function xpackMigrationDeprecations (params, options, callback) {
return function migrationDeprecations (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -123,4 +123,4 @@ function buildXpackMigrationDeprecations (opts) {
}
}
module.exports = buildXpackMigrationDeprecations
module.exports = buildMigrationDeprecations

View File

@ -31,6 +31,7 @@ function buildMlGetCalendars (opts) {
* @param {string} calendar_id - The ID of the calendar to fetch
* @param {int} from - skips a number of calendars
* @param {int} size - specifies a max number of calendars to get
* @param {object} body - The from and size parameters optionally sent in the body
*/
const acceptedQuerystring = [
@ -54,12 +55,6 @@ function buildMlGetCalendars (opts) {
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}`)
@ -91,7 +86,7 @@ function buildMlGetCalendars (opts) {
const request = {
method,
path,
body: '',
body: body || '',
querystring
}

View File

@ -33,6 +33,7 @@ function buildReindex (opts) {
* @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
* @param {boolean} wait_for_completion - Should the request should block until the reindex is complete.
* @param {number} requests_per_second - The throttle to set on this request in sub-requests per second. -1 means no throttle.
* @param {time} scroll - Control how long to keep the search context alive
* @param {number} slices - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks.
* @param {object} body - The search definition using the Query DSL and the prototype for the index request.
*/
@ -43,6 +44,7 @@ function buildReindex (opts) {
'wait_for_active_shards',
'wait_for_completion',
'requests_per_second',
'scroll',
'slices',
'pretty',
'human',

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackRollupDeleteJob (opts) {
function buildRollupDeleteJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.rollup.delete_job]() request
* Perform a [rollup.delete_job]() request
*
* @param {string} id - The ID of the job to delete
*/
@ -39,7 +39,7 @@ function buildXpackRollupDeleteJob (opts) {
}
return function xpackRollupDeleteJob (params, options, callback) {
return function rollupDeleteJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -119,4 +119,4 @@ function buildXpackRollupDeleteJob (opts) {
}
}
module.exports = buildXpackRollupDeleteJob
module.exports = buildRollupDeleteJob

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackRollupGetJobs (opts) {
function buildRollupGetJobs (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.rollup.get_jobs]() request
* Perform a [rollup.get_jobs]() request
*
* @param {string} id - The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs
*/
@ -39,7 +39,7 @@ function buildXpackRollupGetJobs (opts) {
}
return function xpackRollupGetJobs (params, options, callback) {
return function rollupGetJobs (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -117,4 +117,4 @@ function buildXpackRollupGetJobs (opts) {
}
}
module.exports = buildXpackRollupGetJobs
module.exports = buildRollupGetJobs

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackRollupGetRollupCaps (opts) {
function buildRollupGetRollupCaps (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.rollup.get_rollup_caps]() request
* Perform a [rollup.get_rollup_caps]() request
*
* @param {string} id - The ID of the index to check rollup capabilities on, or left blank for all jobs
*/
@ -39,7 +39,7 @@ function buildXpackRollupGetRollupCaps (opts) {
}
return function xpackRollupGetRollupCaps (params, options, callback) {
return function rollupGetRollupCaps (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -117,4 +117,4 @@ function buildXpackRollupGetRollupCaps (opts) {
}
}
module.exports = buildXpackRollupGetRollupCaps
module.exports = buildRollupGetRollupCaps

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackRollupGetRollupIndexCaps (opts) {
function buildRollupGetRollupIndexCaps (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.rollup.get_rollup_index_caps]() request
* Perform a [rollup.get_rollup_index_caps]() request
*
* @param {string} index - The rollup index or index pattern to obtain rollup capabilities from.
*/
@ -39,7 +39,7 @@ function buildXpackRollupGetRollupIndexCaps (opts) {
}
return function xpackRollupGetRollupIndexCaps (params, options, callback) {
return function rollupGetRollupIndexCaps (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -119,4 +119,4 @@ function buildXpackRollupGetRollupIndexCaps (opts) {
}
}
module.exports = buildXpackRollupGetRollupIndexCaps
module.exports = buildRollupGetRollupIndexCaps

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackRollupPutJob (opts) {
function buildRollupPutJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.rollup.put_job]() request
* Perform a [rollup.put_job]() request
*
* @param {string} id - The ID of the job to create
* @param {object} body - The job configuration
@ -40,7 +40,7 @@ function buildXpackRollupPutJob (opts) {
}
return function xpackRollupPutJob (params, options, callback) {
return function rollupPutJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -124,4 +124,4 @@ function buildXpackRollupPutJob (opts) {
}
}
module.exports = buildXpackRollupPutJob
module.exports = buildRollupPutJob

View File

@ -22,13 +22,13 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackRollupRollupSearch (opts) {
function buildRollupRollupSearch (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.rollup.rollup_search]() request
* Perform a [rollup.rollup_search]() request
*
* @param {string} index - The index or index-pattern (containing rollup or regular data) that should be searched
* @param {list} index - The indices or index-pattern(s) (containing rollup or regular data) that should be searched
* @param {string} type - The doc type inside the index
* @param {boolean} typed_keys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
* @param {boolean} rest_total_hits_as_int - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
@ -45,7 +45,7 @@ function buildXpackRollupRollupSearch (opts) {
restTotalHitsAsInt: 'rest_total_hits_as_int'
}
return function xpackRollupRollupSearch (params, options, callback) {
return function rollupRollupSearch (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -139,4 +139,4 @@ function buildXpackRollupRollupSearch (opts) {
}
}
module.exports = buildXpackRollupRollupSearch
module.exports = buildRollupRollupSearch

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackRollupStartJob (opts) {
function buildRollupStartJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.rollup.start_job]() request
* Perform a [rollup.start_job]() request
*
* @param {string} id - The ID of the job to start
*/
@ -39,7 +39,7 @@ function buildXpackRollupStartJob (opts) {
}
return function xpackRollupStartJob (params, options, callback) {
return function rollupStartJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -119,4 +119,4 @@ function buildXpackRollupStartJob (opts) {
}
}
module.exports = buildXpackRollupStartJob
module.exports = buildRollupStartJob

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackRollupStopJob (opts) {
function buildRollupStopJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.rollup.stop_job]() request
* Perform a [rollup.stop_job]() request
*
* @param {string} id - The ID of the job to stop
* @param {boolean} wait_for_completion - True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false.
@ -43,7 +43,7 @@ function buildXpackRollupStopJob (opts) {
}
return function xpackRollupStopJob (params, options, callback) {
return function rollupStopJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -123,4 +123,4 @@ function buildXpackRollupStopJob (opts) {
}
}
module.exports = buildXpackRollupStopJob
module.exports = buildRollupStopJob

View File

@ -0,0 +1,122 @@
/*
* 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 buildScriptsPainlessContext (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [scripts_painless_context](undefined) request
*
* @param {string} context - Select a specific context to retrieve API information about
*/
const acceptedQuerystring = [
'context',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function scriptsPainlessContext (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null
var { method, body } = params
var querystring = semicopy(params, ['method', 'body'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_scripts' + '/' + 'painless' + '/' + '_context'
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildScriptsPainlessContext

View File

@ -53,6 +53,10 @@ function buildSecurityDisableUser (opts) {
}
// check required parameters
if (params['username'] == null) {
const err = new ConfigurationError('Missing required parameter: username')
return handleError(err, callback)
}
if (params.body != null) {
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)

View File

@ -53,6 +53,10 @@ function buildSecurityEnableUser (opts) {
}
// check required parameters
if (params['username'] == null) {
const err = new ConfigurationError('Missing required parameter: username')
return handleError(err, callback)
}
if (params.body != null) {
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)

View File

@ -85,9 +85,9 @@ function buildSecurityGetPrivileges (opts) {
var path = ''
if (application && name) {
if ((application) != null && (name) != null) {
path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application) + '/' + encodeURIComponent(name)
} else if (application) {
} else if ((application) != null) {
path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application)
} else {
path = '/' + '_security' + '/' + 'privilege'

View File

@ -30,7 +30,7 @@ function buildSecurityPutRoleMapping (opts) {
*
* @param {string} name - Role-mapping name
* @param {enum} refresh - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
* @param {object} body - The role to add
* @param {object} body - The role mapping to add
*/
const acceptedQuerystring = [

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackSqlClearCursor (opts) {
function buildSqlClearCursor (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.sql.clear_cursor](Clear SQL cursor) request
* Perform a [sql.clear_cursor](Clear SQL cursor) request
*
* @param {object} body - Specify the cursor value in the `cursor` element to clean the cursor.
*/
@ -39,7 +39,7 @@ function buildXpackSqlClearCursor (opts) {
}
return function xpackSqlClearCursor (params, options, callback) {
return function sqlClearCursor (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -119,4 +119,4 @@ function buildXpackSqlClearCursor (opts) {
}
}
module.exports = buildXpackSqlClearCursor
module.exports = buildSqlClearCursor

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackSqlQuery (opts) {
function buildSqlQuery (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.sql.query](Execute SQL) request
* Perform a [sql.query](Execute SQL) request
*
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {object} body - Use the `query` element to start a query. Use the `cursor` element to continue a query.
@ -40,7 +40,7 @@ function buildXpackSqlQuery (opts) {
}
return function xpackSqlQuery (params, options, callback) {
return function sqlQuery (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -120,4 +120,4 @@ function buildXpackSqlQuery (opts) {
}
}
module.exports = buildXpackSqlQuery
module.exports = buildSqlQuery

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackSqlTranslate (opts) {
function buildSqlTranslate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.sql.translate](Translate SQL into Elasticsearch queries) request
* Perform a [sql.translate](Translate SQL into Elasticsearch queries) request
*
* @param {object} body - Specify the query in the `query` element.
*/
@ -39,7 +39,7 @@ function buildXpackSqlTranslate (opts) {
}
return function xpackSqlTranslate (params, options, callback) {
return function sqlTranslate (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -119,4 +119,4 @@ function buildXpackSqlTranslate (opts) {
}
}
module.exports = buildXpackSqlTranslate
module.exports = buildSqlTranslate

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackWatcherAckWatch (opts) {
function buildWatcherAckWatch (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.watcher.ack_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html) request
* Perform a [watcher.ack_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html) request
*
* @param {string} watch_id - Watch ID
* @param {list} action_id - A comma-separated list of the action ids to be acked
@ -40,7 +40,7 @@ function buildXpackWatcherAckWatch (opts) {
}
return function xpackWatcherAckWatch (params, options, callback) {
return function watcherAckWatch (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -134,4 +134,4 @@ function buildXpackWatcherAckWatch (opts) {
}
}
module.exports = buildXpackWatcherAckWatch
module.exports = buildWatcherAckWatch

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackWatcherActivateWatch (opts) {
function buildWatcherActivateWatch (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.watcher.activate_watch](https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html) request
* Perform a [watcher.activate_watch](https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html) request
*
* @param {string} watch_id - Watch ID
*/
@ -39,7 +39,7 @@ function buildXpackWatcherActivateWatch (opts) {
}
return function xpackWatcherActivateWatch (params, options, callback) {
return function watcherActivateWatch (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -123,4 +123,4 @@ function buildXpackWatcherActivateWatch (opts) {
}
}
module.exports = buildXpackWatcherActivateWatch
module.exports = buildWatcherActivateWatch

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackWatcherDeactivateWatch (opts) {
function buildWatcherDeactivateWatch (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.watcher.deactivate_watch](https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html) request
* Perform a [watcher.deactivate_watch](https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html) request
*
* @param {string} watch_id - Watch ID
*/
@ -39,7 +39,7 @@ function buildXpackWatcherDeactivateWatch (opts) {
}
return function xpackWatcherDeactivateWatch (params, options, callback) {
return function watcherDeactivateWatch (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -123,4 +123,4 @@ function buildXpackWatcherDeactivateWatch (opts) {
}
}
module.exports = buildXpackWatcherDeactivateWatch
module.exports = buildWatcherDeactivateWatch

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackWatcherDeleteWatch (opts) {
function buildWatcherDeleteWatch (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.watcher.delete_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html) request
* Perform a [watcher.delete_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html) request
*
* @param {string} id - Watch ID
*/
@ -39,7 +39,7 @@ function buildXpackWatcherDeleteWatch (opts) {
}
return function xpackWatcherDeleteWatch (params, options, callback) {
return function watcherDeleteWatch (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -123,4 +123,4 @@ function buildXpackWatcherDeleteWatch (opts) {
}
}
module.exports = buildXpackWatcherDeleteWatch
module.exports = buildWatcherDeleteWatch

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackWatcherExecuteWatch (opts) {
function buildWatcherExecuteWatch (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.watcher.execute_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html) request
* Perform a [watcher.execute_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html) request
*
* @param {string} id - Watch ID
* @param {boolean} debug - indicates whether the watch should execute in debug mode
@ -41,7 +41,7 @@ function buildXpackWatcherExecuteWatch (opts) {
}
return function xpackWatcherExecuteWatch (params, options, callback) {
return function watcherExecuteWatch (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -119,4 +119,4 @@ function buildXpackWatcherExecuteWatch (opts) {
}
}
module.exports = buildXpackWatcherExecuteWatch
module.exports = buildWatcherExecuteWatch

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackWatcherGetWatch (opts) {
function buildWatcherGetWatch (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.watcher.get_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html) request
* Perform a [watcher.get_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html) request
*
* @param {string} id - Watch ID
*/
@ -39,7 +39,7 @@ function buildXpackWatcherGetWatch (opts) {
}
return function xpackWatcherGetWatch (params, options, callback) {
return function watcherGetWatch (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -123,4 +123,4 @@ function buildXpackWatcherGetWatch (opts) {
}
}
module.exports = buildXpackWatcherGetWatch
module.exports = buildWatcherGetWatch

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackWatcherPutWatch (opts) {
function buildWatcherPutWatch (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.watcher.put_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html) request
* Perform a [watcher.put_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html) request
*
* @param {string} id - Watch ID
* @param {boolean} active - Specify whether the watch is in/active by default
@ -48,7 +48,7 @@ function buildXpackWatcherPutWatch (opts) {
ifPrimaryTerm: 'if_primary_term'
}
return function xpackWatcherPutWatch (params, options, callback) {
return function watcherPutWatch (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -128,4 +128,4 @@ function buildXpackWatcherPutWatch (opts) {
}
}
module.exports = buildXpackWatcherPutWatch
module.exports = buildWatcherPutWatch

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackWatcherStart (opts) {
function buildWatcherStart (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.watcher.start](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html) request
* Perform a [watcher.start](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html) request
*
*/
@ -38,7 +38,7 @@ function buildXpackWatcherStart (opts) {
}
return function xpackWatcherStart (params, options, callback) {
return function watcherStart (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -118,4 +118,4 @@ function buildXpackWatcherStart (opts) {
}
}
module.exports = buildXpackWatcherStart
module.exports = buildWatcherStart

View File

@ -22,14 +22,14 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackWatcherStats (opts) {
function buildWatcherStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.watcher.stats](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html) request
* Perform a [watcher.stats](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html) request
*
* @param {enum} metric - Controls what additional stat metrics should be include in the response
* @param {enum} metric - Controls what additional stat metrics should be include in the response
* @param {list} metric - Controls what additional stat metrics should be include in the response
* @param {list} metric - Controls what additional stat metrics should be include in the response
* @param {boolean} emit_stacktraces - Emits stack traces of currently running watches
*/
@ -42,7 +42,7 @@ function buildXpackWatcherStats (opts) {
emitStacktraces: 'emit_stacktraces'
}
return function xpackWatcherStats (params, options, callback) {
return function watcherStats (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -126,4 +126,4 @@ function buildXpackWatcherStats (opts) {
}
}
module.exports = buildXpackWatcherStats
module.exports = buildWatcherStats

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackWatcherStop (opts) {
function buildWatcherStop (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.watcher.stop](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html) request
* Perform a [watcher.stop](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html) request
*
*/
@ -38,7 +38,7 @@ function buildXpackWatcherStop (opts) {
}
return function xpackWatcherStop (params, options, callback) {
return function watcherStop (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -118,4 +118,4 @@ function buildXpackWatcherStop (opts) {
}
}
module.exports = buildXpackWatcherStop
module.exports = buildWatcherStop

View File

@ -1,127 +0,0 @@
/*
* 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 buildXpackMigrationGetAssistance (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [xpack.migration.get_assistance](https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.html) request
*
* @param {list} index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
* @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.
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
*/
const acceptedQuerystring = [
'allow_no_indices',
'expand_wildcards',
'ignore_unavailable'
]
const snakeCase = {
allowNoIndices: 'allow_no_indices',
expandWildcards: 'expand_wildcards',
ignoreUnavailable: 'ignore_unavailable'
}
return function xpackMigrationGetAssistance (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null
var { method, body, index } = params
var querystring = semicopy(params, ['method', 'body', 'index'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
if ((index) != null) {
path = '/' + '_migration' + '/' + 'assistance' + '/' + encodeURIComponent(index)
} else {
path = '/' + '_migration' + '/' + 'assistance'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildXpackMigrationGetAssistance

View File

@ -63,6 +63,8 @@ function ESAPI (opts) {
followInfo: lazyLoad('ccr.follow_info', opts),
follow_stats: lazyLoad('ccr.follow_stats', opts),
followStats: lazyLoad('ccr.follow_stats', opts),
forget_follower: lazyLoad('ccr.forget_follower', opts),
forgetFollower: lazyLoad('ccr.forget_follower', opts),
get_auto_follow_pattern: lazyLoad('ccr.get_auto_follow_pattern', opts),
getAutoFollowPattern: lazyLoad('ccr.get_auto_follow_pattern', opts),
pause_follow: lazyLoad('ccr.pause_follow', opts),
@ -94,6 +96,38 @@ 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)
},
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)
},
delete: lazyLoad('delete', opts),
delete_by_query: lazyLoad('delete_by_query', opts),
deleteByQuery: lazyLoad('delete_by_query', opts),
@ -112,6 +146,9 @@ function ESAPI (opts) {
getScript: lazyLoad('get_script', opts),
get_source: lazyLoad('get_source', opts),
getSource: lazyLoad('get_source', opts),
graph: {
explore: lazyLoad('graph.explore', opts)
},
ilm: {
delete_lifecycle: lazyLoad('ilm.delete_lifecycle', opts),
deleteLifecycle: lazyLoad('ilm.delete_lifecycle', opts),
@ -205,7 +242,23 @@ function ESAPI (opts) {
putPipeline: lazyLoad('ingest.put_pipeline', opts),
simulate: lazyLoad('ingest.simulate', opts)
},
license: {
delete: lazyLoad('license.delete', opts),
get: lazyLoad('license.get', opts),
get_basic_status: lazyLoad('license.get_basic_status', opts),
getBasicStatus: lazyLoad('license.get_basic_status', opts),
get_trial_status: lazyLoad('license.get_trial_status', opts),
getTrialStatus: lazyLoad('license.get_trial_status', opts),
post: lazyLoad('license.post', opts),
post_start_basic: lazyLoad('license.post_start_basic', opts),
postStartBasic: lazyLoad('license.post_start_basic', opts),
post_start_trial: lazyLoad('license.post_start_trial', opts),
postStartTrial: lazyLoad('license.post_start_trial', opts)
},
mget: lazyLoad('mget', opts),
migration: {
deprecations: lazyLoad('migration.deprecations', opts)
},
ml: {
close_job: lazyLoad('ml.close_job', opts),
closeJob: lazyLoad('ml.close_job', opts),
@ -323,6 +376,26 @@ function ESAPI (opts) {
reindexRethrottle: lazyLoad('reindex_rethrottle', opts),
render_search_template: lazyLoad('render_search_template', opts),
renderSearchTemplate: lazyLoad('render_search_template', opts),
rollup: {
delete_job: lazyLoad('rollup.delete_job', opts),
deleteJob: lazyLoad('rollup.delete_job', opts),
get_jobs: lazyLoad('rollup.get_jobs', opts),
getJobs: lazyLoad('rollup.get_jobs', opts),
get_rollup_caps: lazyLoad('rollup.get_rollup_caps', opts),
getRollupCaps: lazyLoad('rollup.get_rollup_caps', opts),
get_rollup_index_caps: lazyLoad('rollup.get_rollup_index_caps', opts),
getRollupIndexCaps: lazyLoad('rollup.get_rollup_index_caps', opts),
put_job: lazyLoad('rollup.put_job', opts),
putJob: lazyLoad('rollup.put_job', opts),
rollup_search: lazyLoad('rollup.rollup_search', opts),
rollupSearch: lazyLoad('rollup.rollup_search', opts),
start_job: lazyLoad('rollup.start_job', opts),
startJob: lazyLoad('rollup.start_job', 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),
@ -397,6 +470,12 @@ function ESAPI (opts) {
verify_repository: lazyLoad('snapshot.verify_repository', opts),
verifyRepository: lazyLoad('snapshot.verify_repository', opts)
},
sql: {
clear_cursor: lazyLoad('sql.clear_cursor', opts),
clearCursor: lazyLoad('sql.clear_cursor', opts),
query: lazyLoad('sql.query', opts),
translate: lazyLoad('sql.translate', opts)
},
ssl: {
certificates: lazyLoad('ssl.certificates', opts)
},
@ -411,74 +490,28 @@ function ESAPI (opts) {
updateByQuery: lazyLoad('update_by_query', opts),
update_by_query_rethrottle: lazyLoad('update_by_query_rethrottle', opts),
updateByQueryRethrottle: lazyLoad('update_by_query_rethrottle', opts),
watcher: {
ack_watch: lazyLoad('watcher.ack_watch', opts),
ackWatch: lazyLoad('watcher.ack_watch', opts),
activate_watch: lazyLoad('watcher.activate_watch', opts),
activateWatch: lazyLoad('watcher.activate_watch', opts),
deactivate_watch: lazyLoad('watcher.deactivate_watch', opts),
deactivateWatch: lazyLoad('watcher.deactivate_watch', opts),
delete_watch: lazyLoad('watcher.delete_watch', opts),
deleteWatch: lazyLoad('watcher.delete_watch', opts),
execute_watch: lazyLoad('watcher.execute_watch', opts),
executeWatch: lazyLoad('watcher.execute_watch', opts),
get_watch: lazyLoad('watcher.get_watch', opts),
getWatch: lazyLoad('watcher.get_watch', opts),
put_watch: lazyLoad('watcher.put_watch', opts),
putWatch: lazyLoad('watcher.put_watch', opts),
start: lazyLoad('watcher.start', opts),
stats: lazyLoad('watcher.stats', opts),
stop: lazyLoad('watcher.stop', opts)
},
xpack: {
graph: {
explore: lazyLoad('xpack.graph.explore', opts)
},
info: lazyLoad('xpack.info', opts),
license: {
delete: lazyLoad('xpack.license.delete', opts),
get: lazyLoad('xpack.license.get', opts),
get_basic_status: lazyLoad('xpack.license.get_basic_status', opts),
getBasicStatus: lazyLoad('xpack.license.get_basic_status', opts),
get_trial_status: lazyLoad('xpack.license.get_trial_status', opts),
getTrialStatus: lazyLoad('xpack.license.get_trial_status', opts),
post: lazyLoad('xpack.license.post', opts),
post_start_basic: lazyLoad('xpack.license.post_start_basic', opts),
postStartBasic: lazyLoad('xpack.license.post_start_basic', opts),
post_start_trial: lazyLoad('xpack.license.post_start_trial', opts),
postStartTrial: lazyLoad('xpack.license.post_start_trial', opts)
},
migration: {
deprecations: lazyLoad('xpack.migration.deprecations', opts),
get_assistance: lazyLoad('xpack.migration.get_assistance', opts),
getAssistance: lazyLoad('xpack.migration.get_assistance', opts),
upgrade: lazyLoad('xpack.migration.upgrade', opts)
},
rollup: {
delete_job: lazyLoad('xpack.rollup.delete_job', opts),
deleteJob: lazyLoad('xpack.rollup.delete_job', opts),
get_jobs: lazyLoad('xpack.rollup.get_jobs', opts),
getJobs: lazyLoad('xpack.rollup.get_jobs', opts),
get_rollup_caps: lazyLoad('xpack.rollup.get_rollup_caps', opts),
getRollupCaps: lazyLoad('xpack.rollup.get_rollup_caps', opts),
get_rollup_index_caps: lazyLoad('xpack.rollup.get_rollup_index_caps', opts),
getRollupIndexCaps: lazyLoad('xpack.rollup.get_rollup_index_caps', opts),
put_job: lazyLoad('xpack.rollup.put_job', opts),
putJob: lazyLoad('xpack.rollup.put_job', opts),
rollup_search: lazyLoad('xpack.rollup.rollup_search', opts),
rollupSearch: lazyLoad('xpack.rollup.rollup_search', opts),
start_job: lazyLoad('xpack.rollup.start_job', opts),
startJob: lazyLoad('xpack.rollup.start_job', opts),
stop_job: lazyLoad('xpack.rollup.stop_job', opts),
stopJob: lazyLoad('xpack.rollup.stop_job', opts)
},
sql: {
clear_cursor: lazyLoad('xpack.sql.clear_cursor', opts),
clearCursor: lazyLoad('xpack.sql.clear_cursor', opts),
query: lazyLoad('xpack.sql.query', opts),
translate: lazyLoad('xpack.sql.translate', opts)
},
usage: lazyLoad('xpack.usage', opts),
watcher: {
ack_watch: lazyLoad('xpack.watcher.ack_watch', opts),
ackWatch: lazyLoad('xpack.watcher.ack_watch', opts),
activate_watch: lazyLoad('xpack.watcher.activate_watch', opts),
activateWatch: lazyLoad('xpack.watcher.activate_watch', opts),
deactivate_watch: lazyLoad('xpack.watcher.deactivate_watch', opts),
deactivateWatch: lazyLoad('xpack.watcher.deactivate_watch', opts),
delete_watch: lazyLoad('xpack.watcher.delete_watch', opts),
deleteWatch: lazyLoad('xpack.watcher.delete_watch', opts),
execute_watch: lazyLoad('xpack.watcher.execute_watch', opts),
executeWatch: lazyLoad('xpack.watcher.execute_watch', opts),
get_watch: lazyLoad('xpack.watcher.get_watch', opts),
getWatch: lazyLoad('xpack.watcher.get_watch', opts),
put_watch: lazyLoad('xpack.watcher.put_watch', opts),
putWatch: lazyLoad('xpack.watcher.put_watch', opts),
start: lazyLoad('xpack.watcher.start', opts),
stats: lazyLoad('xpack.watcher.stats', opts),
stop: lazyLoad('xpack.watcher.stop', opts)
}
usage: lazyLoad('xpack.usage', opts)
}
}

274
api/requestParams.d.ts vendored
View File

@ -115,6 +115,7 @@ export interface CatIndices extends Generic {
pri?: boolean;
s?: string | string[];
v?: boolean;
include_unloaded_segments?: boolean;
}
export interface CatMaster extends Generic {
@ -277,6 +278,7 @@ export interface ClusterGetSettings extends Generic {
export interface ClusterHealth extends Generic {
index?: string | string[];
expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
level?: 'cluster' | 'indices' | 'shards';
local?: boolean;
master_timeout?: string;
@ -574,6 +576,7 @@ export interface IndicesClose extends Generic {
ignore_unavailable?: boolean;
allow_no_indices?: boolean;
expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
wait_for_active_shards?: string;
}
export interface IndicesCreate extends Generic {
@ -835,7 +838,6 @@ export interface IndicesShardStores extends Generic {
export interface IndicesShrink extends Generic {
index: string;
target: string;
copy_settings?: boolean;
timeout?: string;
master_timeout?: string;
wait_for_active_shards?: string;
@ -845,7 +847,6 @@ export interface IndicesShrink extends Generic {
export interface IndicesSplit extends Generic {
index: string;
target: string;
copy_settings?: boolean;
timeout?: string;
master_timeout?: string;
wait_for_active_shards?: string;
@ -862,6 +863,9 @@ export interface IndicesStats extends Generic {
level?: 'cluster' | 'indices' | 'shards';
types?: string | string[];
include_segment_file_sizes?: boolean;
include_unloaded_segments?: boolean;
expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
forbid_closed_indices?: boolean;
}
export interface IndicesUpdateAliases extends Generic {
@ -1051,6 +1055,7 @@ export interface Reindex extends Generic {
wait_for_active_shards?: string;
wait_for_completion?: boolean;
requests_per_second?: number;
scroll?: string;
slices?: number;
body: any;
}
@ -1065,6 +1070,10 @@ export interface RenderSearchTemplate extends Generic {
body?: any;
}
export interface ScriptsPainlessContext extends Generic {
context?: string;
}
export interface ScriptsPainlessExecute extends Generic {
body?: any;
}
@ -1337,7 +1346,12 @@ export interface CcrFollowInfo extends Generic {
}
export interface CcrFollowStats extends Generic {
index?: string | string[];
index: string | string[];
}
export interface CcrForgetFollower extends Generic {
index: string;
body: any;
}
export interface CcrGetAutoFollowPattern extends Generic {
@ -1365,13 +1379,54 @@ export interface CcrUnfollow extends Generic {
index: string;
}
export interface DataFrameDeleteDataFrameTransform extends Generic {
transform_id: string;
}
export interface DataFrameGetDataFrameTransform extends Generic {
transform_id?: string;
from?: number;
size?: number;
}
export interface DataFrameGetDataFrameTransformStats extends Generic {
transform_id?: string;
}
export interface DataFramePreviewDataFrameTransform extends Generic {
body: any;
}
export interface DataFramePutDataFrameTransform extends Generic {
transform_id: string;
body: any;
}
export interface DataFrameStartDataFrameTransform extends Generic {
transform_id: string;
timeout?: string;
}
export interface DataFrameStopDataFrameTransform extends Generic {
transform_id: string;
wait_for_completion?: boolean;
timeout?: string;
}
export interface GraphExplore extends Generic {
index?: string | string[];
type?: string | string[];
routing?: string;
timeout?: string;
body?: any;
}
export interface IlmDeleteLifecycle extends Generic {
policy?: string;
}
export interface IlmExplainLifecycle extends Generic {
index?: string;
human?: boolean;
}
export interface IlmGetLifecycle extends Generic {
@ -1425,6 +1480,37 @@ export interface IndicesUnfreeze extends Generic {
wait_for_active_shards?: string;
}
export interface LicenseDelete extends Generic {
}
export interface LicenseGet extends Generic {
local?: boolean;
}
export interface LicenseGetBasicStatus extends Generic {
}
export interface LicenseGetTrialStatus extends Generic {
}
export interface LicensePost extends Generic {
acknowledge?: boolean;
body?: any;
}
export interface LicensePostStartBasic extends Generic {
acknowledge?: boolean;
}
export interface LicensePostStartTrial extends Generic {
type?: string;
acknowledge?: boolean;
}
export interface MigrationDeprecations extends Generic {
index?: string;
}
export interface MlCloseJob extends Generic {
job_id: string;
allow_no_jobs?: boolean;
@ -1538,6 +1624,7 @@ export interface MlGetCalendars extends Generic {
calendar_id?: string;
from?: number;
size?: number;
body?: any;
}
export interface MlGetCategories extends Generic {
@ -1738,6 +1825,45 @@ export interface MonitoringBulk extends Generic {
body: any;
}
export interface RollupDeleteJob extends Generic {
id: string;
}
export interface RollupGetJobs extends Generic {
id?: string;
}
export interface RollupGetRollupCaps extends Generic {
id?: string;
}
export interface RollupGetRollupIndexCaps extends Generic {
index: string;
}
export interface RollupPutJob extends Generic {
id: string;
body: any;
}
export interface RollupRollupSearch extends Generic {
index: string | string[];
type?: string;
typed_keys?: boolean;
rest_total_hits_as_int?: boolean;
body: any;
}
export interface RollupStartJob extends Generic {
id: string;
}
export interface RollupStopJob extends Generic {
id: string;
wait_for_completion?: boolean;
timeout?: string;
}
export interface SecurityAuthenticate extends Generic {
}
@ -1783,12 +1909,12 @@ export interface SecurityDeleteUser extends Generic {
}
export interface SecurityDisableUser extends Generic {
username?: string;
username: string;
refresh?: 'true' | 'false' | 'wait_for';
}
export interface SecurityEnableUser extends Generic {
username?: string;
username: string;
refresh?: 'true' | 'false' | 'wait_for';
}
@ -1859,148 +1985,50 @@ export interface SecurityPutUser extends Generic {
body: any;
}
export interface SslCertificates extends Generic {
}
export interface XpackGraphExplore extends Generic {
index?: string | string[];
type?: string | string[];
routing?: string;
timeout?: string;
body?: any;
}
export interface XpackInfo extends Generic {
categories?: string | string[];
}
export interface XpackLicenseDelete extends Generic {
}
export interface XpackLicenseGet extends Generic {
local?: boolean;
}
export interface XpackLicenseGetBasicStatus extends Generic {
}
export interface XpackLicenseGetTrialStatus extends Generic {
}
export interface XpackLicensePost extends Generic {
acknowledge?: boolean;
body?: any;
}
export interface XpackLicensePostStartBasic extends Generic {
acknowledge?: boolean;
}
export interface XpackLicensePostStartTrial extends Generic {
type?: string;
acknowledge?: boolean;
}
export interface XpackMigrationDeprecations extends Generic {
index?: string;
}
export interface XpackMigrationGetAssistance extends Generic {
index?: string | string[];
allow_no_indices?: boolean;
expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
ignore_unavailable?: boolean;
}
export interface XpackMigrationUpgrade extends Generic {
index: string;
wait_for_completion?: boolean;
}
export interface XpackRollupDeleteJob extends Generic {
id: string;
}
export interface XpackRollupGetJobs extends Generic {
id?: string;
}
export interface XpackRollupGetRollupCaps extends Generic {
id?: string;
}
export interface XpackRollupGetRollupIndexCaps extends Generic {
index: string;
}
export interface XpackRollupPutJob extends Generic {
id: string;
export interface SqlClearCursor extends Generic {
body: any;
}
export interface XpackRollupRollupSearch extends Generic {
index: string;
type?: string;
typed_keys?: boolean;
rest_total_hits_as_int?: boolean;
body: any;
}
export interface XpackRollupStartJob extends Generic {
id: string;
}
export interface XpackRollupStopJob extends Generic {
id: string;
wait_for_completion?: boolean;
timeout?: string;
}
export interface XpackSqlClearCursor extends Generic {
body: any;
}
export interface XpackSqlQuery extends Generic {
export interface SqlQuery extends Generic {
format?: string;
body: any;
}
export interface XpackSqlTranslate extends Generic {
export interface SqlTranslate extends Generic {
body: any;
}
export interface XpackUsage extends Generic {
master_timeout?: string;
export interface SslCertificates extends Generic {
}
export interface XpackWatcherAckWatch extends Generic {
export interface WatcherAckWatch extends Generic {
watch_id: string;
action_id?: string | string[];
}
export interface XpackWatcherActivateWatch extends Generic {
export interface WatcherActivateWatch extends Generic {
watch_id: string;
}
export interface XpackWatcherDeactivateWatch extends Generic {
export interface WatcherDeactivateWatch extends Generic {
watch_id: string;
}
export interface XpackWatcherDeleteWatch extends Generic {
export interface WatcherDeleteWatch extends Generic {
id: string;
}
export interface XpackWatcherExecuteWatch extends Generic {
export interface WatcherExecuteWatch extends Generic {
id?: string;
debug?: boolean;
body?: any;
}
export interface XpackWatcherGetWatch extends Generic {
export interface WatcherGetWatch extends Generic {
id: string;
}
export interface XpackWatcherPutWatch extends Generic {
export interface WatcherPutWatch extends Generic {
id: string;
active?: boolean;
version?: number;
@ -2009,13 +2037,21 @@ export interface XpackWatcherPutWatch extends Generic {
body?: any;
}
export interface XpackWatcherStart extends Generic {
export interface WatcherStart extends Generic {
}
export interface XpackWatcherStats extends Generic {
metric?: '_all' | 'queued_watches' | 'current_watches' | 'pending_watches';
export interface WatcherStats extends Generic {
metric?: string | string[];
emit_stacktraces?: boolean;
}
export interface XpackWatcherStop extends Generic {
export interface WatcherStop extends Generic {
}
export interface XpackInfo extends Generic {
categories?: string | string[];
}
export interface XpackUsage extends Generic {
master_timeout?: string;
}