Support for Elasticsearch 7.5 (#1015)

* API generation

* X-Opaque-Id support (#997)

* Added X-Opaque-Id support

* Updated type definitions

* Updated test

* Updated docs

* Skip data_frame_transform_deprecated.* apis

* API generation

* Fix docs link

* Fix CI configuration

* Added enrich_user to default roles

* Added transform_admin ad transform_user to default roles
This commit is contained in:
Tomas Della Vedova
2019-12-03 14:31:59 +01:00
committed by GitHub
parent da7220ad8a
commit c0000aa207
46 changed files with 1416 additions and 402 deletions

View File

@ -1,6 +1,6 @@
---
ELASTICSEARCH_VERSION:
- 7.4.0
- 7.5.0
NODE_JS_VERSION:
- 12

View File

@ -14,7 +14,6 @@ function buildCatAliases (opts) {
const acceptedQuerystring = [
'format',
'local',
'master_timeout',
'h',
'help',
's',
@ -27,7 +26,6 @@ function buildCatAliases (opts) {
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}

View File

@ -13,8 +13,6 @@ function buildCatCount (opts) {
const acceptedQuerystring = [
'format',
'local',
'master_timeout',
'h',
'help',
's',
@ -27,7 +25,6 @@ function buildCatCount (opts) {
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}

View File

@ -14,8 +14,6 @@ function buildCatFielddata (opts) {
const acceptedQuerystring = [
'format',
'bytes',
'local',
'master_timeout',
'h',
'help',
's',
@ -29,7 +27,6 @@ function buildCatFielddata (opts) {
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}

View File

@ -13,11 +13,10 @@ function buildCatHealth (opts) {
const acceptedQuerystring = [
'format',
'local',
'master_timeout',
'h',
'help',
's',
'time',
'ts',
'v',
'pretty',
@ -28,7 +27,6 @@ function buildCatHealth (opts) {
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}

View File

@ -21,6 +21,7 @@ function buildCatIndices (opts) {
'help',
'pri',
's',
'time',
'v',
'include_unloaded_segments',
'pretty',

View File

@ -12,6 +12,7 @@ function buildCatNodes (opts) {
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'bytes',
'format',
'full_id',
'local',
@ -19,6 +20,7 @@ function buildCatNodes (opts) {
'h',
'help',
's',
'time',
'v',
'pretty',
'human',

View File

@ -18,6 +18,7 @@ function buildCatPendingTasks (opts) {
'h',
'help',
's',
'time',
'v',
'pretty',
'human',

View File

@ -13,11 +13,14 @@ function buildCatRecovery (opts) {
const acceptedQuerystring = [
'format',
'active_only',
'bytes',
'master_timeout',
'detailed',
'h',
'help',
'index',
's',
'time',
'v',
'pretty',
'human',
@ -27,7 +30,7 @@ function buildCatRecovery (opts) {
]
const snakeCase = {
masterTimeout: 'master_timeout',
activeOnly: 'active_only',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}

View File

@ -19,6 +19,7 @@ function buildCatShards (opts) {
'h',
'help',
's',
'time',
'v',
'pretty',
'human',

View File

@ -18,6 +18,7 @@ function buildCatSnapshots (opts) {
'h',
'help',
's',
'time',
'v',
'pretty',
'human',

View File

@ -20,6 +20,7 @@ function buildCatTasks (opts) {
'h',
'help',
's',
'time',
'v',
'pretty',
'human',

View File

@ -0,0 +1,77 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCcrPauseAutoFollowPattern (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
]
const snakeCase = {
}
/**
* Perform a ccr.pause_auto_follow_pattern request
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html
*/
return function ccrPauseAutoFollowPattern (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['name'] == null) {
const err = new ConfigurationError('Missing required parameter: name')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'POST'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name) + '/' + 'pause'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCcrPauseAutoFollowPattern

View File

@ -0,0 +1,77 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCcrResumeAutoFollowPattern (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
]
const snakeCase = {
}
/**
* Perform a ccr.resume_auto_follow_pattern request
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-resume-auto-follow-pattern.html
*/
return function ccrResumeAutoFollowPattern (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['name'] == null) {
const err = new ConfigurationError('Missing required parameter: name')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'POST'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name) + '/' + 'resume'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCcrResumeAutoFollowPattern

View File

@ -0,0 +1,76 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildEnrichDeletePolicy (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
]
const snakeCase = {
}
/**
* Perform a enrich.delete_policy request
*/
return function enrichDeletePolicy (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['name'] == null) {
const err = new ConfigurationError('Missing required parameter: name')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildEnrichDeletePolicy

View File

@ -0,0 +1,76 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildEnrichExecutePolicy (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'wait_for_completion'
]
const snakeCase = {
waitForCompletion: 'wait_for_completion'
}
/**
* Perform a enrich.execute_policy request
*/
return function enrichExecutePolicy (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['name'] == null) {
const err = new ConfigurationError('Missing required parameter: name')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name) + '/' + '_execute'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildEnrichExecutePolicy

View File

@ -0,0 +1,75 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildEnrichGetPolicy (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
]
const snakeCase = {
}
/**
* Perform a enrich.get_policy request
*/
return function enrichGetPolicy (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'GET'
path = '/' + '_enrich' + '/' + 'policy'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildEnrichGetPolicy

View File

@ -0,0 +1,80 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildEnrichPutPolicy (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
]
const snakeCase = {
}
/**
* Perform a enrich.put_policy request
*/
return function enrichPutPolicy (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['name'] == null) {
const err = new ConfigurationError('Missing required parameter: name')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildEnrichPutPolicy

70
api/api/enrich.stats.js Normal file
View File

@ -0,0 +1,70 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildEnrichStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
]
const snakeCase = {
}
/**
* Perform a enrich.stats request
*/
return function enrichStats (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_enrich' + '/' + '_stats'
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildEnrichStats

View File

@ -84,10 +84,10 @@ function buildIndex (opts) {
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'POST'
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else if ((index) != null && (id) != null) {
if (method == null) method = 'POST'
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
} else if ((index) != null && (type) != null) {
if (method == null) method = 'POST'

View File

@ -79,10 +79,10 @@ function buildIndicesDeleteAlias (opts) {
if ((index) != null && (name) != null) {
if (method == null) method = 'DELETE'
path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name)
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'DELETE'
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name)
}
// build request object

View File

@ -79,10 +79,10 @@ function buildIndicesPutAlias (opts) {
if ((index) != null && (name) != null) {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name)
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name)
}
// build request object

View File

@ -67,16 +67,16 @@ function buildNodesHotThreads (opts) {
if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads'
} else if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads'
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads'
} else if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads'
} else if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads'
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads'
} else if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads'
} else {
if (method == null) method = 'GET'
path = '/' + '_nodes' + '/' + 'hot_threads'

View File

@ -15,11 +15,13 @@ function buildSecurityGetApiKey (opts) {
'id',
'name',
'username',
'realm_name'
'realm_name',
'owner'
]
const snakeCase = {
realmName: 'realm_name'
}
/**

View File

@ -0,0 +1,71 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildSlmExecuteRetention (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
]
const snakeCase = {
}
/**
* Perform a slm.execute_retention request
* https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html
*/
return function slmExecuteRetention (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'POST'
path = '/' + '_slm' + '/' + '_execute_retention'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildSlmExecuteRetention

71
api/api/slm.get_stats.js Normal file
View File

@ -0,0 +1,71 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildSlmGetStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
]
const snakeCase = {
}
/**
* Perform a slm.get_stats request
* https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-get-stats.html
*/
return function slmGetStats (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_slm' + '/' + 'stats'
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildSlmGetStats

View File

@ -7,7 +7,7 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildDataFrameDeleteDataFrameTransform (opts) {
function buildTransformDeleteTransform (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
@ -20,10 +20,10 @@ function buildDataFrameDeleteDataFrameTransform (opts) {
}
/**
* Perform a data_frame.delete_data_frame_transform request
* Perform a transform.delete_transform request
* https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html
*/
return function dataFrameDeleteDataFrameTransform (params, options, callback) {
return function transformDeleteTransform (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -59,7 +59,7 @@ function buildDataFrameDeleteDataFrameTransform (opts) {
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId)
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId)
// build request object
const request = {
@ -74,4 +74,4 @@ function buildDataFrameDeleteDataFrameTransform (opts) {
}
}
module.exports = buildDataFrameDeleteDataFrameTransform
module.exports = buildTransformDeleteTransform

View File

@ -7,7 +7,7 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildDataFrameGetDataFrameTransform (opts) {
function buildTransformGetTransform (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
@ -22,10 +22,10 @@ function buildDataFrameGetDataFrameTransform (opts) {
}
/**
* Perform a data_frame.get_data_frame_transform request
* Perform a transform.get_transform request
* https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html
*/
return function dataFrameGetDataFrameTransform (params, options, callback) {
return function transformGetTransform (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -56,10 +56,10 @@ function buildDataFrameGetDataFrameTransform (opts) {
if ((transform_id || transformId) != null) {
if (method == null) method = 'GET'
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId)
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId)
} else {
if (method == null) method = 'GET'
path = '/' + '_data_frame' + '/' + 'transforms'
path = '/' + '_transform'
}
// build request object
@ -75,4 +75,4 @@ function buildDataFrameGetDataFrameTransform (opts) {
}
}
module.exports = buildDataFrameGetDataFrameTransform
module.exports = buildTransformGetTransform

View File

@ -7,7 +7,7 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildDataFrameGetDataFrameTransformStats (opts) {
function buildTransformGetTransformStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
@ -22,10 +22,10 @@ function buildDataFrameGetDataFrameTransformStats (opts) {
}
/**
* Perform a data_frame.get_data_frame_transform_stats request
* Perform a transform.get_transform_stats request
* https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html
*/
return function dataFrameGetDataFrameTransformStats (params, options, callback) {
return function transformGetTransformStats (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -61,7 +61,7 @@ function buildDataFrameGetDataFrameTransformStats (opts) {
var path = ''
if (method == null) method = 'GET'
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stats'
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stats'
// build request object
const request = {
@ -76,4 +76,4 @@ function buildDataFrameGetDataFrameTransformStats (opts) {
}
}
module.exports = buildDataFrameGetDataFrameTransformStats
module.exports = buildTransformGetTransformStats

View File

@ -7,7 +7,7 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildDataFramePreviewDataFrameTransform (opts) {
function buildTransformPreviewTransform (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
@ -20,10 +20,10 @@ function buildDataFramePreviewDataFrameTransform (opts) {
}
/**
* Perform a data_frame.preview_data_frame_transform request
* Perform a transform.preview_transform request
* https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html
*/
return function dataFramePreviewDataFrameTransform (params, options, callback) {
return function transformPreviewTransform (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -59,7 +59,7 @@ function buildDataFramePreviewDataFrameTransform (opts) {
var path = ''
if (method == null) method = 'POST'
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + '_preview'
path = '/' + '_transform' + '/' + '_preview'
// build request object
const request = {
@ -74,4 +74,4 @@ function buildDataFramePreviewDataFrameTransform (opts) {
}
}
module.exports = buildDataFramePreviewDataFrameTransform
module.exports = buildTransformPreviewTransform

View File

@ -7,7 +7,7 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildDataFramePutDataFrameTransform (opts) {
function buildTransformPutTransform (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
@ -20,10 +20,10 @@ function buildDataFramePutDataFrameTransform (opts) {
}
/**
* Perform a data_frame.put_data_frame_transform request
* Perform a transform.put_transform request
* https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html
*/
return function dataFramePutDataFrameTransform (params, options, callback) {
return function transformPutTransform (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -63,7 +63,7 @@ function buildDataFramePutDataFrameTransform (opts) {
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId)
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId)
// build request object
const request = {
@ -78,4 +78,4 @@ function buildDataFramePutDataFrameTransform (opts) {
}
}
module.exports = buildDataFramePutDataFrameTransform
module.exports = buildTransformPutTransform

View File

@ -7,7 +7,7 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildDataFrameStartDataFrameTransform (opts) {
function buildTransformStartTransform (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
@ -20,10 +20,10 @@ function buildDataFrameStartDataFrameTransform (opts) {
}
/**
* Perform a data_frame.start_data_frame_transform request
* Perform a transform.start_transform request
* https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html
*/
return function dataFrameStartDataFrameTransform (params, options, callback) {
return function transformStartTransform (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -59,7 +59,7 @@ function buildDataFrameStartDataFrameTransform (opts) {
var path = ''
if (method == null) method = 'POST'
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_start'
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_start'
// build request object
const request = {
@ -74,4 +74,4 @@ function buildDataFrameStartDataFrameTransform (opts) {
}
}
module.exports = buildDataFrameStartDataFrameTransform
module.exports = buildTransformStartTransform

View File

@ -7,7 +7,7 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildDataFrameStopDataFrameTransform (opts) {
function buildTransformStopTransform (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
@ -23,10 +23,10 @@ function buildDataFrameStopDataFrameTransform (opts) {
}
/**
* Perform a data_frame.stop_data_frame_transform request
* Perform a transform.stop_transform request
* https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html
*/
return function dataFrameStopDataFrameTransform (params, options, callback) {
return function transformStopTransform (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -62,7 +62,7 @@ function buildDataFrameStopDataFrameTransform (opts) {
var path = ''
if (method == null) method = 'POST'
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stop'
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stop'
// build request object
const request = {
@ -77,4 +77,4 @@ function buildDataFrameStopDataFrameTransform (opts) {
}
}
module.exports = buildDataFrameStopDataFrameTransform
module.exports = buildTransformStopTransform

View File

@ -7,7 +7,7 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildDataFrameUpdateDataFrameTransform (opts) {
function buildTransformUpdateTransform (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
@ -20,10 +20,10 @@ function buildDataFrameUpdateDataFrameTransform (opts) {
}
/**
* Perform a data_frame.update_data_frame_transform request
* Perform a transform.update_transform request
* https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html
*/
return function dataFrameUpdateDataFrameTransform (params, options, callback) {
return function transformUpdateTransform (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -63,7 +63,7 @@ function buildDataFrameUpdateDataFrameTransform (opts) {
var path = ''
if (method == null) method = 'POST'
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_update'
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_update'
// build request object
const request = {
@ -78,4 +78,4 @@ function buildDataFrameUpdateDataFrameTransform (opts) {
}
}
module.exports = buildDataFrameUpdateDataFrameTransform
module.exports = buildTransformUpdateTransform

View File

@ -53,10 +53,14 @@ function ESAPI (opts) {
forgetFollower: lazyLoad('ccr.forget_follower', opts),
get_auto_follow_pattern: lazyLoad('ccr.get_auto_follow_pattern', opts),
getAutoFollowPattern: lazyLoad('ccr.get_auto_follow_pattern', opts),
pause_auto_follow_pattern: lazyLoad('ccr.pause_auto_follow_pattern', opts),
pauseAutoFollowPattern: lazyLoad('ccr.pause_auto_follow_pattern', opts),
pause_follow: lazyLoad('ccr.pause_follow', opts),
pauseFollow: lazyLoad('ccr.pause_follow', opts),
put_auto_follow_pattern: lazyLoad('ccr.put_auto_follow_pattern', opts),
putAutoFollowPattern: lazyLoad('ccr.put_auto_follow_pattern', opts),
resume_auto_follow_pattern: lazyLoad('ccr.resume_auto_follow_pattern', opts),
resumeAutoFollowPattern: lazyLoad('ccr.resume_auto_follow_pattern', opts),
resume_follow: lazyLoad('ccr.resume_follow', opts),
resumeFollow: lazyLoad('ccr.resume_follow', opts),
stats: lazyLoad('ccr.stats', opts),
@ -82,42 +86,6 @@ function ESAPI (opts) {
},
count: lazyLoad('count', opts),
create: lazyLoad('create', opts),
data_frame: {
delete_data_frame_transform: lazyLoad('data_frame.delete_data_frame_transform', opts),
deleteDataFrameTransform: lazyLoad('data_frame.delete_data_frame_transform', opts),
get_data_frame_transform: lazyLoad('data_frame.get_data_frame_transform', opts),
getDataFrameTransform: lazyLoad('data_frame.get_data_frame_transform', opts),
get_data_frame_transform_stats: lazyLoad('data_frame.get_data_frame_transform_stats', opts),
getDataFrameTransformStats: lazyLoad('data_frame.get_data_frame_transform_stats', opts),
preview_data_frame_transform: lazyLoad('data_frame.preview_data_frame_transform', opts),
previewDataFrameTransform: lazyLoad('data_frame.preview_data_frame_transform', opts),
put_data_frame_transform: lazyLoad('data_frame.put_data_frame_transform', opts),
putDataFrameTransform: lazyLoad('data_frame.put_data_frame_transform', opts),
start_data_frame_transform: lazyLoad('data_frame.start_data_frame_transform', opts),
startDataFrameTransform: lazyLoad('data_frame.start_data_frame_transform', opts),
stop_data_frame_transform: lazyLoad('data_frame.stop_data_frame_transform', opts),
stopDataFrameTransform: lazyLoad('data_frame.stop_data_frame_transform', opts),
update_data_frame_transform: lazyLoad('data_frame.update_data_frame_transform', opts),
updateDataFrameTransform: lazyLoad('data_frame.update_data_frame_transform', opts)
},
dataFrame: {
delete_data_frame_transform: lazyLoad('data_frame.delete_data_frame_transform', opts),
deleteDataFrameTransform: lazyLoad('data_frame.delete_data_frame_transform', opts),
get_data_frame_transform: lazyLoad('data_frame.get_data_frame_transform', opts),
getDataFrameTransform: lazyLoad('data_frame.get_data_frame_transform', opts),
get_data_frame_transform_stats: lazyLoad('data_frame.get_data_frame_transform_stats', opts),
getDataFrameTransformStats: lazyLoad('data_frame.get_data_frame_transform_stats', opts),
preview_data_frame_transform: lazyLoad('data_frame.preview_data_frame_transform', opts),
previewDataFrameTransform: lazyLoad('data_frame.preview_data_frame_transform', opts),
put_data_frame_transform: lazyLoad('data_frame.put_data_frame_transform', opts),
putDataFrameTransform: lazyLoad('data_frame.put_data_frame_transform', opts),
start_data_frame_transform: lazyLoad('data_frame.start_data_frame_transform', opts),
startDataFrameTransform: lazyLoad('data_frame.start_data_frame_transform', opts),
stop_data_frame_transform: lazyLoad('data_frame.stop_data_frame_transform', opts),
stopDataFrameTransform: lazyLoad('data_frame.stop_data_frame_transform', opts),
update_data_frame_transform: lazyLoad('data_frame.update_data_frame_transform', opts),
updateDataFrameTransform: lazyLoad('data_frame.update_data_frame_transform', opts)
},
delete: lazyLoad('delete', opts),
delete_by_query: lazyLoad('delete_by_query', opts),
deleteByQuery: lazyLoad('delete_by_query', opts),
@ -125,6 +93,17 @@ function ESAPI (opts) {
deleteByQueryRethrottle: lazyLoad('delete_by_query_rethrottle', opts),
delete_script: lazyLoad('delete_script', opts),
deleteScript: lazyLoad('delete_script', opts),
enrich: {
delete_policy: lazyLoad('enrich.delete_policy', opts),
deletePolicy: lazyLoad('enrich.delete_policy', opts),
execute_policy: lazyLoad('enrich.execute_policy', opts),
executePolicy: lazyLoad('enrich.execute_policy', opts),
get_policy: lazyLoad('enrich.get_policy', opts),
getPolicy: lazyLoad('enrich.get_policy', opts),
put_policy: lazyLoad('enrich.put_policy', opts),
putPolicy: lazyLoad('enrich.put_policy', opts),
stats: lazyLoad('enrich.stats', opts)
},
exists: lazyLoad('exists', opts),
exists_source: lazyLoad('exists_source', opts),
existsSource: lazyLoad('exists_source', opts),
@ -469,8 +448,12 @@ function ESAPI (opts) {
deleteLifecycle: lazyLoad('slm.delete_lifecycle', opts),
execute_lifecycle: lazyLoad('slm.execute_lifecycle', opts),
executeLifecycle: lazyLoad('slm.execute_lifecycle', opts),
execute_retention: lazyLoad('slm.execute_retention', opts),
executeRetention: lazyLoad('slm.execute_retention', opts),
get_lifecycle: lazyLoad('slm.get_lifecycle', opts),
getLifecycle: lazyLoad('slm.get_lifecycle', opts),
get_stats: lazyLoad('slm.get_stats', opts),
getStats: lazyLoad('slm.get_stats', opts),
put_lifecycle: lazyLoad('slm.put_lifecycle', opts),
putLifecycle: lazyLoad('slm.put_lifecycle', opts)
},
@ -506,6 +489,24 @@ function ESAPI (opts) {
list: lazyLoad('tasks.list', opts)
},
termvectors: lazyLoad('termvectors', opts),
transform: {
delete_transform: lazyLoad('transform.delete_transform', opts),
deleteTransform: lazyLoad('transform.delete_transform', opts),
get_transform: lazyLoad('transform.get_transform', opts),
getTransform: lazyLoad('transform.get_transform', opts),
get_transform_stats: lazyLoad('transform.get_transform_stats', opts),
getTransformStats: lazyLoad('transform.get_transform_stats', opts),
preview_transform: lazyLoad('transform.preview_transform', opts),
previewTransform: lazyLoad('transform.preview_transform', opts),
put_transform: lazyLoad('transform.put_transform', opts),
putTransform: lazyLoad('transform.put_transform', opts),
start_transform: lazyLoad('transform.start_transform', opts),
startTransform: lazyLoad('transform.start_transform', opts),
stop_transform: lazyLoad('transform.stop_transform', opts),
stopTransform: lazyLoad('transform.stop_transform', opts),
update_transform: lazyLoad('transform.update_transform', opts),
updateTransform: lazyLoad('transform.update_transform', opts)
},
update: lazyLoad('update', opts),
update_by_query: lazyLoad('update_by_query', opts),
updateByQuery: lazyLoad('update_by_query', opts),

139
api/requestParams.d.ts vendored
View File

@ -32,7 +32,6 @@ export interface CatAliases extends Generic {
name?: string | string[];
format?: string;
local?: boolean;
master_timeout?: string;
h?: string | string[];
help?: boolean;
s?: string | string[];
@ -54,8 +53,6 @@ export interface CatAllocation extends Generic {
export interface CatCount extends Generic {
index?: string | string[];
format?: string;
local?: boolean;
master_timeout?: string;
h?: string | string[];
help?: boolean;
s?: string | string[];
@ -66,8 +63,6 @@ export interface CatFielddata extends Generic {
fields?: string | string[];
format?: string;
bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb';
local?: boolean;
master_timeout?: string;
h?: string | string[];
help?: boolean;
s?: string | string[];
@ -76,11 +71,10 @@ export interface CatFielddata extends Generic {
export interface CatHealth extends Generic {
format?: string;
local?: boolean;
master_timeout?: string;
h?: string | string[];
help?: boolean;
s?: string | string[];
time?: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)';
ts?: boolean;
v?: boolean;
}
@ -101,6 +95,7 @@ export interface CatIndices extends Generic {
help?: boolean;
pri?: boolean;
s?: string | string[];
time?: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)';
v?: boolean;
include_unloaded_segments?: boolean;
}
@ -126,6 +121,7 @@ export interface CatNodeattrs extends Generic {
}
export interface CatNodes extends Generic {
bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb';
format?: string;
full_id?: boolean;
local?: boolean;
@ -133,6 +129,7 @@ export interface CatNodes extends Generic {
h?: string | string[];
help?: boolean;
s?: string | string[];
time?: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)';
v?: boolean;
}
@ -143,6 +140,7 @@ export interface CatPendingTasks extends Generic {
h?: string | string[];
help?: boolean;
s?: string | string[];
time?: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)';
v?: boolean;
}
@ -159,11 +157,13 @@ export interface CatPlugins extends Generic {
export interface CatRecovery extends Generic {
index?: string | string[];
format?: string;
active_only?: boolean;
bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb';
master_timeout?: string;
detailed?: boolean;
h?: string | string[];
help?: boolean;
s?: string | string[];
time?: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)';
v?: boolean;
}
@ -196,6 +196,7 @@ export interface CatShards extends Generic {
h?: string | string[];
help?: boolean;
s?: string | string[];
time?: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)';
v?: boolean;
}
@ -207,6 +208,7 @@ export interface CatSnapshots extends Generic {
h?: string | string[];
help?: boolean;
s?: string | string[];
time?: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)';
v?: boolean;
}
@ -219,6 +221,7 @@ export interface CatTasks extends Generic {
h?: string | string[];
help?: boolean;
s?: string | string[];
time?: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)';
v?: boolean;
}
@ -351,7 +354,7 @@ export interface Create<T = any> extends Generic {
routing?: string;
timeout?: string;
version?: number;
version_type?: 'internal' | 'external' | 'external_gte' | 'force';
version_type?: 'internal' | 'external' | 'external_gte';
pipeline?: string;
body: T;
}
@ -536,7 +539,7 @@ export interface Index<T = any> extends Generic {
routing?: string;
timeout?: string;
version?: number;
version_type?: 'internal' | 'external' | 'external_gte' | 'force';
version_type?: 'internal' | 'external' | 'external_gte';
if_seq_no?: number;
if_primary_term?: number;
pipeline?: string;
@ -1367,6 +1370,10 @@ export interface CcrGetAutoFollowPattern extends Generic {
name?: string;
}
export interface CcrPauseAutoFollowPattern extends Generic {
name: string;
}
export interface CcrPauseFollow extends Generic {
index: string;
}
@ -1376,6 +1383,10 @@ export interface CcrPutAutoFollowPattern<T = any> extends Generic {
body: T;
}
export interface CcrResumeAutoFollowPattern extends Generic {
name: string;
}
export interface CcrResumeFollow<T = any> extends Generic {
index: string;
body?: T;
@ -1388,53 +1399,27 @@ export interface CcrUnfollow extends Generic {
index: string;
}
export interface DataFrameDeleteDataFrameTransform extends Generic {
transform_id: string;
force?: boolean;
export interface EnrichDeletePolicy extends Generic {
name: string;
}
export interface DataFrameGetDataFrameTransform extends Generic {
transform_id?: string;
from?: number;
size?: number;
allow_no_match?: boolean;
}
export interface DataFrameGetDataFrameTransformStats extends Generic {
transform_id: string;
from?: number;
size?: number;
allow_no_match?: boolean;
}
export interface DataFramePreviewDataFrameTransform<T = any> extends Generic {
body: T;
}
export interface DataFramePutDataFrameTransform<T = any> extends Generic {
transform_id: string;
defer_validation?: boolean;
body: T;
}
export interface DataFrameStartDataFrameTransform extends Generic {
transform_id: string;
timeout?: string;
}
export interface DataFrameStopDataFrameTransform extends Generic {
transform_id: string;
export interface EnrichExecutePolicy extends Generic {
name: string;
wait_for_completion?: boolean;
timeout?: string;
allow_no_match?: boolean;
}
export interface DataFrameUpdateDataFrameTransform<T = any> extends Generic {
transform_id: string;
defer_validation?: boolean;
export interface EnrichGetPolicy extends Generic {
name?: string;
}
export interface EnrichPutPolicy<T = any> extends Generic {
name: string;
body: T;
}
export interface EnrichStats extends Generic {
}
export interface GraphExplore<T = any> extends Generic {
index: string | string[];
type?: string | string[];
@ -1998,6 +1983,7 @@ export interface SecurityGetApiKey extends Generic {
name?: string;
username?: string;
realm_name?: string;
owner?: boolean;
}
export interface SecurityGetBuiltinPrivileges extends Generic {
@ -2071,8 +2057,14 @@ export interface SlmExecuteLifecycle extends Generic {
policy_id: string;
}
export interface SlmExecuteRetention extends Generic {
}
export interface SlmGetLifecycle extends Generic {
policy_id?: string;
policy_id?: string | string[];
}
export interface SlmGetStats extends Generic {
}
export interface SlmPutLifecycle<T = any> extends Generic {
@ -2096,6 +2088,53 @@ export interface SqlTranslate<T = any> extends Generic {
export interface SslCertificates extends Generic {
}
export interface TransformDeleteTransform extends Generic {
transform_id: string;
force?: boolean;
}
export interface TransformGetTransform extends Generic {
transform_id?: string;
from?: number;
size?: number;
allow_no_match?: boolean;
}
export interface TransformGetTransformStats extends Generic {
transform_id: string;
from?: number;
size?: number;
allow_no_match?: boolean;
}
export interface TransformPreviewTransform<T = any> extends Generic {
body: T;
}
export interface TransformPutTransform<T = any> extends Generic {
transform_id: string;
defer_validation?: boolean;
body: T;
}
export interface TransformStartTransform extends Generic {
transform_id: string;
timeout?: string;
}
export interface TransformStopTransform extends Generic {
transform_id: string;
wait_for_completion?: boolean;
timeout?: string;
allow_no_match?: boolean;
}
export interface TransformUpdateTransform<T = any> extends Generic {
transform_id: string;
defer_validation?: boolean;
body: T;
}
export interface WatcherAckWatch extends Generic {
watch_id: string;
action_id?: string | string[];

View File

@ -181,6 +181,11 @@ function generateRequestId (params, options) {
|`string` - The name to identify the client instance in the events. +
_Default:_ `elasticsearch-js`
|`opaqueIdPrefix`
|`string` - A string that will be use to prefix any `X-Opaque-Id` header. +
See https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/observability.html#_x-opaque-id_support[`X-Opaque-Id` support] for more details. +
_Default:_ `null`
|`headers`
|`object` - A set of custom headers to send in every request. +
_Default:_ `{}`

View File

@ -248,3 +248,46 @@ child.search({
if (err) console.log(err)
})
----
=== X-Opaque-Id support
To improve the overall observability, the client offers an easy way to configure the `X-Opaque-Id` header. If you set the `X-Opaque-Id` in a specific request, this will allow you to discover this identifier in the https://www.elastic.co/guide/en/elasticsearch/reference/master/logging.html#deprecation-logging[deprecation logs], help you with https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-slowlog.html#_identifying_search_slow_log_origin[identifying search slow log origin] as well as https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html#_identifying_running_tasks[identifying running tasks].
The `X-Opaque-Id` should be configured in each request, for doing that you can use the `opaqueId` option, as you can see in the following example. +
The resulting header will be `{ 'X-Opaque-Id': 'my-search' }`.
[source,js]
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: 'http://localhost:9200'
})
client.search({
index: 'my-index',
body: { foo: 'bar' }
}, {
opaqueId: 'my-search'
}, (err, result) => {
if (err) console.log(err)
})
----
Sometimes it may be useful to prefix all the `X-Opaque-Id` headers with a specific string, in case you need to identify a specific client or server. For doing this, the client offers a top-level configuration option: `opaqueIdPrefix`. +
In the following example, the resulting header will be `{ 'X-Opaque-Id': 'proxy-client::my-search' }`.
[source,js]
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: 'http://localhost:9200',
opaqueIdPrefix: 'proxy-client::'
})
client.search({
index: 'my-index',
body: { foo: 'bar' }
}, {
opaqueId: 'my-search'
}, (err, result) => {
if (err) console.log(err)
})
----

View File

@ -1,18 +1,12 @@
[[api-reference]]
== API Reference
This document contains the entire list of the {es} API supported by the client,
both OSS and commercial. The client is entirely licensed under Apache 2.0.
This document contains the entire list of the Elasticsearch API supported by the client, both OSS and commercial. The client is entirely licensed under Apache 2.0.
{es} exposes an HTTP layer to communicate with, and the client is a library that
helps you do this. Because of this reason, you will see HTTP related parameters,
such as `body` or `headers`.
Elasticsearch exposes an HTTP layer to communicate with, and the client is a library that will help you do this. Because of this reason, you will see HTTP related parameters, such as `body` or `headers`.
Every API can accept two objects, the first contains all the parameters that
will be sent to {es}, while the second includes the request specific parameters,
such as timeouts, headers, and so on. In the first object, every parameter but
the body will be sent via querystring or url parameter, depending on the API,
and every unrecognized parameter will be sent as querystring.
Every API can accept two objects, the first contains all the parameters that will be sent to Elasticsearch, while the second includes the request specific parameters, such as timeouts, headers, and so on.
In the first object, every parameter but the body will be sent via querystring or url parameter, depending on the API, and every unrecognized parameter will be sent as querystring.
[source,js]
----
@ -41,10 +35,7 @@ client.search({
})
----
In this document, you will find the reference of every parameter accepted by the
querystring or the url. If you also need to send the body, you can find the
documentation of its format in the reference link that is present along with
every endpoint.
In this document, you will find the reference of every parameter accepted by the querystring or the url. If you also need to send the body, you can find the documentation of its format in the reference link that is present along with every endpoint.
////////
@ -142,7 +133,6 @@ client.cat.aliases({
name: string | string[],
format: string,
local: boolean,
master_timeout: string,
h: string | string[],
help: boolean,
s: string | string[],
@ -161,9 +151,6 @@ link:{ref}/cat-alias.html[Reference]
|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)
|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node
|`h`
|`string \| string[]` - Comma-separated list of column names to display
@ -233,8 +220,6 @@ link:{ref}/cat-allocation.html[Reference]
client.cat.count({
index: string | string[],
format: string,
local: boolean,
master_timeout: string,
h: string | string[],
help: boolean,
s: string | string[],
@ -250,12 +235,6 @@ link:{ref}/cat-count.html[Reference]
|`format`
|`string` - a short version of the Accept header, e.g. json, yaml
|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)
|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node
|`h`
|`string \| string[]` - Comma-separated list of column names to display
@ -278,8 +257,6 @@ client.cat.fielddata({
fields: string | string[],
format: string,
bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb',
local: boolean,
master_timeout: string,
h: string | string[],
help: boolean,
s: string | string[],
@ -298,12 +275,6 @@ link:{ref}/cat-fielddata.html[Reference]
|`bytes`
|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values
|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)
|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node
|`h`
|`string \| string[]` - Comma-separated list of column names to display
@ -324,11 +295,10 @@ link:{ref}/cat-fielddata.html[Reference]
----
client.cat.health({
format: string,
local: boolean,
master_timeout: string,
h: string | string[],
help: boolean,
s: string | string[],
time: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)',
ts: boolean,
v: boolean
})
@ -339,12 +309,6 @@ link:{ref}/cat-health.html[Reference]
|`format`
|`string` - a short version of the Accept header, e.g. json, yaml
|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)
|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node
|`h`
|`string \| string[]` - Comma-separated list of column names to display
@ -354,6 +318,9 @@ link:{ref}/cat-health.html[Reference]
|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by
|`time`
|`'d (Days)' \| 'h (Hours)' \| 'm (Minutes)' \| 's (Seconds)' \| 'ms (Milliseconds)' \| 'micros (Microseconds)' \| 'nanos (Nanoseconds)'` - The unit in which to display time values
|`ts`
|`boolean` - Set to false to disable timestamping +
_Default:_ `true`
@ -398,6 +365,7 @@ client.cat.indices({
help: boolean,
pri: boolean,
s: string | string[],
time: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)',
v: boolean,
include_unloaded_segments: boolean
})
@ -435,6 +403,9 @@ link:{ref}/cat-indices.html[Reference]
|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by
|`time`
|`'d (Days)' \| 'h (Hours)' \| 'm (Minutes)' \| 's (Seconds)' \| 'ms (Milliseconds)' \| 'micros (Microseconds)' \| 'nanos (Nanoseconds)'` - The unit in which to display time values
|`v`
|`boolean` - Verbose mode. Display column headers
@ -528,6 +499,7 @@ link:{ref}/cat-nodeattrs.html[Reference]
[source,ts]
----
client.cat.nodes({
bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb',
format: string,
full_id: boolean,
local: boolean,
@ -535,12 +507,16 @@ client.cat.nodes({
h: string | string[],
help: boolean,
s: string | string[],
time: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)',
v: boolean
})
----
link:{ref}/cat-nodes.html[Reference]
[cols=2*]
|===
|`bytes`
|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values
|`format`
|`string` - a short version of the Accept header, e.g. json, yaml
@ -562,6 +538,9 @@ link:{ref}/cat-nodes.html[Reference]
|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by
|`time`
|`'d (Days)' \| 'h (Hours)' \| 'm (Minutes)' \| 's (Seconds)' \| 'ms (Milliseconds)' \| 'micros (Microseconds)' \| 'nanos (Nanoseconds)'` - The unit in which to display time values
|`v`
|`boolean` - Verbose mode. Display column headers
@ -578,6 +557,7 @@ client.cat.pendingTasks({
h: string | string[],
help: boolean,
s: string | string[],
time: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)',
v: boolean
})
----
@ -602,6 +582,9 @@ link:{ref}/cat-pending-tasks.html[Reference]
|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by
|`time`
|`'d (Days)' \| 'h (Hours)' \| 'm (Minutes)' \| 's (Seconds)' \| 'ms (Milliseconds)' \| 'micros (Microseconds)' \| 'nanos (Nanoseconds)'` - The unit in which to display time values
|`v`
|`boolean` - Verbose mode. Display column headers
@ -654,11 +637,13 @@ link:{ref}/cat-plugins.html[Reference]
client.cat.recovery({
index: string | string[],
format: string,
active_only: boolean,
bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb',
master_timeout: string,
detailed: boolean,
h: string | string[],
help: boolean,
s: string | string[],
time: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)',
v: boolean
})
----
@ -666,16 +651,19 @@ link:{ref}/cat-recovery.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names to limit the returned information
|`string \| string[]` - Comma-separated list or wildcard expression of index names to limit the returned information
|`format`
|`string` - a short version of the Accept header, e.g. json, yaml
|`active_only` or `activeOnly`
|`boolean` - If `true`, the response only includes ongoing shard recoveries
|`bytes`
|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values
|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node
|`detailed`
|`boolean` - If `true`, the response includes detailed information about shard recoveries
|`h`
|`string \| string[]` - Comma-separated list of column names to display
@ -686,6 +674,9 @@ link:{ref}/cat-recovery.html[Reference]
|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by
|`time`
|`'d (Days)' \| 'h (Hours)' \| 'm (Minutes)' \| 's (Seconds)' \| 'ms (Milliseconds)' \| 'micros (Microseconds)' \| 'nanos (Nanoseconds)'` - The unit in which to display time values
|`v`
|`boolean` - Verbose mode. Display column headers
@ -784,6 +775,7 @@ client.cat.shards({
h: string | string[],
help: boolean,
s: string | string[],
time: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)',
v: boolean
})
----
@ -814,6 +806,9 @@ link:{ref}/cat-shards.html[Reference]
|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by
|`time`
|`'d (Days)' \| 'h (Hours)' \| 'm (Minutes)' \| 's (Seconds)' \| 'ms (Milliseconds)' \| 'micros (Microseconds)' \| 'nanos (Nanoseconds)'` - The unit in which to display time values
|`v`
|`boolean` - Verbose mode. Display column headers
@ -831,6 +826,7 @@ client.cat.snapshots({
h: string | string[],
help: boolean,
s: string | string[],
time: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)',
v: boolean
})
----
@ -858,6 +854,9 @@ link:{ref}/cat-snapshots.html[Reference]
|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by
|`time`
|`'d (Days)' \| 'h (Hours)' \| 'm (Minutes)' \| 's (Seconds)' \| 'ms (Milliseconds)' \| 'micros (Microseconds)' \| 'nanos (Nanoseconds)'` - The unit in which to display time values
|`v`
|`boolean` - Verbose mode. Display column headers
@ -876,6 +875,7 @@ client.cat.tasks({
h: string | string[],
help: boolean,
s: string | string[],
time: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)',
v: boolean
})
----
@ -906,6 +906,9 @@ link:{ref}/tasks.html[Reference]
|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by
|`time`
|`'d (Days)' \| 'h (Hours)' \| 'm (Minutes)' \| 's (Seconds)' \| 'ms (Milliseconds)' \| 'micros (Microseconds)' \| 'nanos (Nanoseconds)'` - The unit in which to display time values
|`v`
|`boolean` - Verbose mode. Display column headers
@ -1408,7 +1411,7 @@ client.create({
routing: string,
timeout: string,
version: number,
version_type: 'internal' | 'external' | 'external_gte' | 'force',
version_type: 'internal' | 'external' | 'external_gte',
pipeline: string,
body: object
})
@ -1443,7 +1446,7 @@ WARNING: This parameter has been deprecated.
|`number` - Explicit version number for concurrency control
|`version_type` or `versionType`
|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type
|`'internal' \| 'external' \| 'external_gte'` - Specific version type
|`pipeline`
|`string` - The pipeline id to preprocess incoming documents with
@ -2119,7 +2122,7 @@ client.index({
routing: string,
timeout: string,
version: number,
version_type: 'internal' | 'external' | 'external_gte' | 'force',
version_type: 'internal' | 'external' | 'external_gte',
if_seq_no: number,
if_primary_term: number,
pipeline: string,
@ -2144,8 +2147,7 @@ WARNING: This parameter has been deprecated.
|`string` - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
|`op_type` or `opType`
|`'index' \| 'create'` - Explicit operation type +
_Default:_ `index`
|`'index' \| 'create'` - Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID
|`refresh`
|`'true' \| 'false' \| 'wait_for'` - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.
@ -2160,7 +2162,7 @@ _Default:_ `index`
|`number` - Explicit version number for concurrency control
|`version_type` or `versionType`
|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type
|`'internal' \| 'external' \| 'external_gte'` - Specific version type
|`if_seq_no` or `ifSeqNo`
|`number` - only perform the index operation if the last operation that has changed the document has the specified sequence number
@ -5507,6 +5509,22 @@ link:{ref}/ccr-get-auto-follow-pattern.html[Reference]
|===
=== ccr.pauseAutoFollowPattern
[source,ts]
----
client.ccr.pauseAutoFollowPattern({
name: string
})
----
link:{ref}/ccr-pause-auto-follow-pattern.html[Reference]
[cols=2*]
|===
|`name`
|`string` - The name of the auto follow pattern that should pause discovering new indices to follow.
|===
=== ccr.pauseFollow
[source,ts]
@ -5543,6 +5561,22 @@ link:{ref}/ccr-put-auto-follow-pattern.html[Reference]
|===
=== ccr.resumeAutoFollowPattern
[source,ts]
----
client.ccr.resumeAutoFollowPattern({
name: string
})
----
link:{ref}/ccr-resume-auto-follow-pattern.html[Reference]
[cols=2*]
|===
|`name`
|`string` - The name of the auto follow pattern to resume discovering new indices to follow.
|===
=== ccr.resumeFollow
[source,ts]
@ -5588,194 +5622,83 @@ link:http://www.elastic.co/guide/en/elasticsearch/reference/current[Reference]
|===
=== dataFrame.deleteDataFrameTransform
*Stability:* beta
=== enrich.deletePolicy
[source,ts]
----
client.dataFrame.deleteDataFrameTransform({
transform_id: string,
force: boolean
client.enrich.deletePolicy({
name: string
})
----
link:{ref}/delete-transform.html[Reference]
[cols=2*]
|===
|`transform_id` or `transformId`
|`string` - The id of the transform to delete
|`force`
|`boolean` - When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted.
|`name`
|`string` - The name of the enrich policy
|===
=== dataFrame.getDataFrameTransform
*Stability:* beta
=== enrich.executePolicy
[source,ts]
----
client.dataFrame.getDataFrameTransform({
transform_id: string,
from: number,
size: number,
allow_no_match: boolean
client.enrich.executePolicy({
name: string,
wait_for_completion: boolean
})
----
link:{ref}/get-transform.html[Reference]
[cols=2*]
|===
|`transform_id` or `transformId`
|`string` - The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms
|`from`
|`number` - skips a number of transform configs, defaults to 0
|`size`
|`number` - specifies a max number of transforms to get, defaults to 100
|`allow_no_match` or `allowNoMatch`
|`boolean` - Whether to ignore if a wildcard expression matches no data frame transforms. (This includes `_all` string or when no data frame transforms have been specified)
|===
=== dataFrame.getDataFrameTransformStats
*Stability:* beta
[source,ts]
----
client.dataFrame.getDataFrameTransformStats({
transform_id: string,
from: number,
size: number,
allow_no_match: boolean
})
----
link:{ref}/get-transform-stats.html[Reference]
[cols=2*]
|===
|`transform_id` or `transformId`
|`string` - The id of the transform for which to get stats. '_all' or '*' implies all transforms
|`from`
|`number` - skips a number of transform stats, defaults to 0
|`size`
|`number` - specifies a max number of transform stats to get, defaults to 100
|`allow_no_match` or `allowNoMatch`
|`boolean` - Whether to ignore if a wildcard expression matches no data frame transforms. (This includes `_all` string or when no data frame transforms have been specified)
|===
=== dataFrame.previewDataFrameTransform
*Stability:* beta
[source,ts]
----
client.dataFrame.previewDataFrameTransform({
body: object
})
----
link:{ref}/preview-transform.html[Reference]
[cols=2*]
|===
|`body`
|`object` - The definition for the data_frame transform to preview
|===
=== dataFrame.putDataFrameTransform
*Stability:* beta
[source,ts]
----
client.dataFrame.putDataFrameTransform({
transform_id: string,
defer_validation: boolean,
body: object
})
----
link:{ref}/put-transform.html[Reference]
[cols=2*]
|===
|`transform_id` or `transformId`
|`string` - The id of the new transform.
|`defer_validation` or `deferValidation`
|`boolean` - If validations should be deferred until data frame transform starts, defaults to false.
|`body`
|`object` - The data frame transform definition
|===
=== dataFrame.startDataFrameTransform
*Stability:* beta
[source,ts]
----
client.dataFrame.startDataFrameTransform({
transform_id: string,
timeout: string
})
----
link:{ref}/start-transform.html[Reference]
[cols=2*]
|===
|`transform_id` or `transformId`
|`string` - The id of the transform to start
|`timeout`
|`string` - Controls the time to wait for the transform to start
|===
=== dataFrame.stopDataFrameTransform
*Stability:* beta
[source,ts]
----
client.dataFrame.stopDataFrameTransform({
transform_id: string,
wait_for_completion: boolean,
timeout: string,
allow_no_match: boolean
})
----
link:{ref}/stop-transform.html[Reference]
[cols=2*]
|===
|`transform_id` or `transformId`
|`string` - The id of the transform to stop
|`name`
|`string` - The name of the enrich policy
|`wait_for_completion` or `waitForCompletion`
|`boolean` - Whether to wait for the transform to fully stop before returning or not. Default to false
|`timeout`
|`string` - Controls the time to wait until the transform has stopped. Default to 30 seconds
|`allow_no_match` or `allowNoMatch`
|`boolean` - Whether to ignore if a wildcard expression matches no data frame transforms. (This includes `_all` string or when no data frame transforms have been specified)
|`boolean` - Should the request should block until the execution is complete. +
_Default:_ `true`
|===
=== dataFrame.updateDataFrameTransform
*Stability:* beta
=== enrich.getPolicy
[source,ts]
----
client.dataFrame.updateDataFrameTransform({
transform_id: string,
defer_validation: boolean,
client.enrich.getPolicy({
name: string
})
----
[cols=2*]
|===
|`name`
|`string` - The name of the enrich policy
|===
=== enrich.putPolicy
[source,ts]
----
client.enrich.putPolicy({
name: string,
body: object
})
----
link:{ref}/update-transform.html[Reference]
[cols=2*]
|===
|`transform_id` or `transformId`
|`string` - The id of the transform.
|`defer_validation` or `deferValidation`
|`boolean` - If validations should be deferred until data frame transform starts, defaults to false.
|`name`
|`string` - The name of the enrich policy
|`body`
|`object` - The update data frame transform definition
|`object` - The enrich policy to register
|===
=== enrich.stats
[source,ts]
----
client.enrich.stats()
----
=== graph.explore
[source,ts]
@ -6408,6 +6331,22 @@ link:{ref}/ml-delete-snapshot.html[Reference]
|===
=== ml.estimateMemoryUsage
*Stability:* experimental
[source,ts]
----
client.ml.estimateMemoryUsage({
body: object
})
----
https://www.elastic.co/guide/en/elasticsearch/reference/current/estimate-memory-usage-dfanalytics.html[Reference]
[cols=2*]
|===
|`body`
|`object` - Memory usage estimation definition
|===
=== ml.evaluateDataFrame
*Stability:* experimental
[source,ts]
@ -7965,7 +7904,8 @@ client.security.getApiKey({
id: string,
name: string,
username: string,
realm_name: string
realm_name: string,
owner: boolean
})
----
link:{ref}/security-api-get-api-key.html[Reference]
@ -7983,6 +7923,9 @@ link:{ref}/security-api-get-api-key.html[Reference]
|`realm_name` or `realmName`
|`string` - realm name of the user who created this API key to be retrieved
|`owner`
|`boolean` - flag to query API keys owned by the currently authenticated user
|===
=== security.getBuiltinPrivileges
@ -8263,22 +8206,40 @@ link:{ref}/slm-api-execute.html[Reference]
|===
=== slm.executeRetention
[source,ts]
----
client.slm.executeRetention()
----
link:{ref}/slm-api-execute-retention.html[Reference]
=== slm.getLifecycle
[source,ts]
----
client.slm.getLifecycle({
policy_id: string
policy_id: string | string[]
})
----
link:{ref}/slm-api-get.html[Reference]
[cols=2*]
|===
|`policy_id` or `policyId`
|`string` - Comma-separated list of snapshot lifecycle policies to retrieve
|`string \| string[]` - Comma-separated list of snapshot lifecycle policies to retrieve
|===
=== slm.getStats
[source,ts]
----
client.slm.getStats()
----
link:{ref}/slm-get-stats.html[Reference]
=== slm.putLifecycle
[source,ts]
@ -8360,6 +8321,194 @@ client.ssl.certificates()
link:{ref}/security-api-ssl.html[Reference]
=== transform.deleteTransform
*Stability:* beta
[source,ts]
----
client.transform.deleteTransform({
transform_id: string,
force: boolean
})
----
link:{ref}/delete-transform.html[Reference]
[cols=2*]
|===
|`transform_id` or `transformId`
|`string` - The id of the transform to delete
|`force`
|`boolean` - When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted.
|===
=== transform.getTransform
*Stability:* beta
[source,ts]
----
client.transform.getTransform({
transform_id: string,
from: number,
size: number,
allow_no_match: boolean
})
----
link:{ref}/get-transform.html[Reference]
[cols=2*]
|===
|`transform_id` or `transformId`
|`string` - The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms
|`from`
|`number` - skips a number of transform configs, defaults to 0
|`size`
|`number` - specifies a max number of transforms to get, defaults to 100
|`allow_no_match` or `allowNoMatch`
|`boolean` - Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)
|===
=== transform.getTransformStats
*Stability:* beta
[source,ts]
----
client.transform.getTransformStats({
transform_id: string,
from: number,
size: number,
allow_no_match: boolean
})
----
link:{ref}/get-transform-stats.html[Reference]
[cols=2*]
|===
|`transform_id` or `transformId`
|`string` - The id of the transform for which to get stats. '_all' or '*' implies all transforms
|`from`
|`number` - skips a number of transform stats, defaults to 0
|`size`
|`number` - specifies a max number of transform stats to get, defaults to 100
|`allow_no_match` or `allowNoMatch`
|`boolean` - Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)
|===
=== transform.previewTransform
*Stability:* beta
[source,ts]
----
client.transform.previewTransform({
body: object
})
----
link:{ref}/preview-transform.html[Reference]
[cols=2*]
|===
|`body`
|`object` - The definition for the transform to preview
|===
=== transform.putTransform
*Stability:* beta
[source,ts]
----
client.transform.putTransform({
transform_id: string,
defer_validation: boolean,
body: object
})
----
link:{ref}/put-transform.html[Reference]
[cols=2*]
|===
|`transform_id` or `transformId`
|`string` - The id of the new transform.
|`defer_validation` or `deferValidation`
|`boolean` - If validations should be deferred until transform starts, defaults to false.
|`body`
|`object` - The transform definition
|===
=== transform.startTransform
*Stability:* beta
[source,ts]
----
client.transform.startTransform({
transform_id: string,
timeout: string
})
----
link:{ref}/start-transform.html[Reference]
[cols=2*]
|===
|`transform_id` or `transformId`
|`string` - The id of the transform to start
|`timeout`
|`string` - Controls the time to wait for the transform to start
|===
=== transform.stopTransform
*Stability:* beta
[source,ts]
----
client.transform.stopTransform({
transform_id: string,
wait_for_completion: boolean,
timeout: string,
allow_no_match: boolean
})
----
link:{ref}/stop-transform.html[Reference]
[cols=2*]
|===
|`transform_id` or `transformId`
|`string` - The id of the transform to stop
|`wait_for_completion` or `waitForCompletion`
|`boolean` - Whether to wait for the transform to fully stop before returning or not. Default to false
|`timeout`
|`string` - Controls the time to wait until the transform has stopped. Default to 30 seconds
|`allow_no_match` or `allowNoMatch`
|`boolean` - Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)
|===
=== transform.updateTransform
*Stability:* beta
[source,ts]
----
client.transform.updateTransform({
transform_id: string,
defer_validation: boolean,
body: object
})
----
link:{ref}/update-transform.html[Reference]
[cols=2*]
|===
|`transform_id` or `transformId`
|`string` - The id of the transform.
|`defer_validation` or `deferValidation`
|`boolean` - If validations should be deferred until transform starts, defaults to false.
|`body`
|`object` - The update transform definition
|===
=== watcher.ackWatch
[source,ts]

74
index.d.ts vendored
View File

@ -94,6 +94,7 @@ interface ClientOptions {
nodeFilter?: nodeFilterFn;
nodeSelector?: nodeSelectorFn | string;
headers?: anyObject;
opaqueIdPrefix?: string;
generateRequestId?: generateRequestIdFn;
name?: string;
auth?: BasicAuth | ApiKeyAuth;
@ -151,10 +152,14 @@ declare class Client extends EventEmitter {
forgetFollower: ApiMethod<RequestParams.CcrForgetFollower>
get_auto_follow_pattern: ApiMethod<RequestParams.CcrGetAutoFollowPattern>
getAutoFollowPattern: ApiMethod<RequestParams.CcrGetAutoFollowPattern>
pause_auto_follow_pattern: ApiMethod<RequestParams.CcrPauseAutoFollowPattern>
pauseAutoFollowPattern: ApiMethod<RequestParams.CcrPauseAutoFollowPattern>
pause_follow: ApiMethod<RequestParams.CcrPauseFollow>
pauseFollow: ApiMethod<RequestParams.CcrPauseFollow>
put_auto_follow_pattern: ApiMethod<RequestParams.CcrPutAutoFollowPattern>
putAutoFollowPattern: ApiMethod<RequestParams.CcrPutAutoFollowPattern>
resume_auto_follow_pattern: ApiMethod<RequestParams.CcrResumeAutoFollowPattern>
resumeAutoFollowPattern: ApiMethod<RequestParams.CcrResumeAutoFollowPattern>
resume_follow: ApiMethod<RequestParams.CcrResumeFollow>
resumeFollow: ApiMethod<RequestParams.CcrResumeFollow>
stats: ApiMethod<RequestParams.CcrStats>
@ -180,42 +185,6 @@ declare class Client extends EventEmitter {
}
count: ApiMethod<RequestParams.Count>
create: ApiMethod<RequestParams.Create>
data_frame: {
delete_data_frame_transform: ApiMethod<RequestParams.DataFrameDeleteDataFrameTransform>
deleteDataFrameTransform: ApiMethod<RequestParams.DataFrameDeleteDataFrameTransform>
get_data_frame_transform: ApiMethod<RequestParams.DataFrameGetDataFrameTransform>
getDataFrameTransform: ApiMethod<RequestParams.DataFrameGetDataFrameTransform>
get_data_frame_transform_stats: ApiMethod<RequestParams.DataFrameGetDataFrameTransformStats>
getDataFrameTransformStats: ApiMethod<RequestParams.DataFrameGetDataFrameTransformStats>
preview_data_frame_transform: ApiMethod<RequestParams.DataFramePreviewDataFrameTransform>
previewDataFrameTransform: ApiMethod<RequestParams.DataFramePreviewDataFrameTransform>
put_data_frame_transform: ApiMethod<RequestParams.DataFramePutDataFrameTransform>
putDataFrameTransform: ApiMethod<RequestParams.DataFramePutDataFrameTransform>
start_data_frame_transform: ApiMethod<RequestParams.DataFrameStartDataFrameTransform>
startDataFrameTransform: ApiMethod<RequestParams.DataFrameStartDataFrameTransform>
stop_data_frame_transform: ApiMethod<RequestParams.DataFrameStopDataFrameTransform>
stopDataFrameTransform: ApiMethod<RequestParams.DataFrameStopDataFrameTransform>
update_data_frame_transform: ApiMethod<RequestParams.DataFrameUpdateDataFrameTransform>
updateDataFrameTransform: ApiMethod<RequestParams.DataFrameUpdateDataFrameTransform>
}
dataFrame: {
delete_data_frame_transform: ApiMethod<RequestParams.DataFrameDeleteDataFrameTransform>
deleteDataFrameTransform: ApiMethod<RequestParams.DataFrameDeleteDataFrameTransform>
get_data_frame_transform: ApiMethod<RequestParams.DataFrameGetDataFrameTransform>
getDataFrameTransform: ApiMethod<RequestParams.DataFrameGetDataFrameTransform>
get_data_frame_transform_stats: ApiMethod<RequestParams.DataFrameGetDataFrameTransformStats>
getDataFrameTransformStats: ApiMethod<RequestParams.DataFrameGetDataFrameTransformStats>
preview_data_frame_transform: ApiMethod<RequestParams.DataFramePreviewDataFrameTransform>
previewDataFrameTransform: ApiMethod<RequestParams.DataFramePreviewDataFrameTransform>
put_data_frame_transform: ApiMethod<RequestParams.DataFramePutDataFrameTransform>
putDataFrameTransform: ApiMethod<RequestParams.DataFramePutDataFrameTransform>
start_data_frame_transform: ApiMethod<RequestParams.DataFrameStartDataFrameTransform>
startDataFrameTransform: ApiMethod<RequestParams.DataFrameStartDataFrameTransform>
stop_data_frame_transform: ApiMethod<RequestParams.DataFrameStopDataFrameTransform>
stopDataFrameTransform: ApiMethod<RequestParams.DataFrameStopDataFrameTransform>
update_data_frame_transform: ApiMethod<RequestParams.DataFrameUpdateDataFrameTransform>
updateDataFrameTransform: ApiMethod<RequestParams.DataFrameUpdateDataFrameTransform>
}
delete: ApiMethod<RequestParams.Delete>
delete_by_query: ApiMethod<RequestParams.DeleteByQuery>
deleteByQuery: ApiMethod<RequestParams.DeleteByQuery>
@ -223,6 +192,17 @@ declare class Client extends EventEmitter {
deleteByQueryRethrottle: ApiMethod<RequestParams.DeleteByQueryRethrottle>
delete_script: ApiMethod<RequestParams.DeleteScript>
deleteScript: ApiMethod<RequestParams.DeleteScript>
enrich: {
delete_policy: ApiMethod<RequestParams.EnrichDeletePolicy>
deletePolicy: ApiMethod<RequestParams.EnrichDeletePolicy>
execute_policy: ApiMethod<RequestParams.EnrichExecutePolicy>
executePolicy: ApiMethod<RequestParams.EnrichExecutePolicy>
get_policy: ApiMethod<RequestParams.EnrichGetPolicy>
getPolicy: ApiMethod<RequestParams.EnrichGetPolicy>
put_policy: ApiMethod<RequestParams.EnrichPutPolicy>
putPolicy: ApiMethod<RequestParams.EnrichPutPolicy>
stats: ApiMethod<RequestParams.EnrichStats>
}
exists: ApiMethod<RequestParams.Exists>
exists_source: ApiMethod<RequestParams.ExistsSource>
existsSource: ApiMethod<RequestParams.ExistsSource>
@ -567,8 +547,12 @@ declare class Client extends EventEmitter {
deleteLifecycle: ApiMethod<RequestParams.SlmDeleteLifecycle>
execute_lifecycle: ApiMethod<RequestParams.SlmExecuteLifecycle>
executeLifecycle: ApiMethod<RequestParams.SlmExecuteLifecycle>
execute_retention: ApiMethod<RequestParams.SlmExecuteRetention>
executeRetention: ApiMethod<RequestParams.SlmExecuteRetention>
get_lifecycle: ApiMethod<RequestParams.SlmGetLifecycle>
getLifecycle: ApiMethod<RequestParams.SlmGetLifecycle>
get_stats: ApiMethod<RequestParams.SlmGetStats>
getStats: ApiMethod<RequestParams.SlmGetStats>
put_lifecycle: ApiMethod<RequestParams.SlmPutLifecycle>
putLifecycle: ApiMethod<RequestParams.SlmPutLifecycle>
}
@ -604,6 +588,24 @@ declare class Client extends EventEmitter {
list: ApiMethod<RequestParams.TasksList>
}
termvectors: ApiMethod<RequestParams.Termvectors>
transform: {
delete_transform: ApiMethod<RequestParams.TransformDeleteTransform>
deleteTransform: ApiMethod<RequestParams.TransformDeleteTransform>
get_transform: ApiMethod<RequestParams.TransformGetTransform>
getTransform: ApiMethod<RequestParams.TransformGetTransform>
get_transform_stats: ApiMethod<RequestParams.TransformGetTransformStats>
getTransformStats: ApiMethod<RequestParams.TransformGetTransformStats>
preview_transform: ApiMethod<RequestParams.TransformPreviewTransform>
previewTransform: ApiMethod<RequestParams.TransformPreviewTransform>
put_transform: ApiMethod<RequestParams.TransformPutTransform>
putTransform: ApiMethod<RequestParams.TransformPutTransform>
start_transform: ApiMethod<RequestParams.TransformStartTransform>
startTransform: ApiMethod<RequestParams.TransformStartTransform>
stop_transform: ApiMethod<RequestParams.TransformStopTransform>
stopTransform: ApiMethod<RequestParams.TransformStopTransform>
update_transform: ApiMethod<RequestParams.TransformUpdateTransform>
updateTransform: ApiMethod<RequestParams.TransformUpdateTransform>
}
update: ApiMethod<RequestParams.Update>
update_by_query: ApiMethod<RequestParams.UpdateByQuery>
updateByQuery: ApiMethod<RequestParams.UpdateByQuery>

View File

@ -79,7 +79,8 @@ class Client extends EventEmitter {
nodeSelector: 'round-robin',
generateRequestId: null,
name: 'elasticsearch-js',
auth: null
auth: null,
opaqueIdPrefix: null
}, opts)
this[kInitialOptions] = options
@ -121,7 +122,8 @@ class Client extends EventEmitter {
nodeFilter: options.nodeFilter,
nodeSelector: options.nodeSelector,
generateRequestId: options.generateRequestId,
name: options.name
name: options.name,
opaqueIdPrefix: options.opaqueIdPrefix
})
const apis = buildApi({

3
lib/Transport.d.ts vendored
View File

@ -38,6 +38,7 @@ interface TransportOptions {
headers?: anyObject;
generateRequestId?: generateRequestIdFn;
name: string;
opaqueIdPrefix?: string;
}
export interface RequestEvent<T = any, C = any> {
@ -90,6 +91,7 @@ export interface TransportRequestOptions {
id?: any;
context?: any;
warnings?: [string];
opaqueId?: string;
}
export interface TransportRequestCallback {
@ -121,6 +123,7 @@ export default class Transport {
compression: 'gzip' | false;
sniffInterval: number;
sniffOnConnectionFault: boolean;
opaqueIdPrefix: string | null;
sniffEndpoint: string;
_sniffEnabled: boolean;
_nextSniff: number;

View File

@ -41,6 +41,7 @@ class Transport {
this.sniffEndpoint = opts.sniffEndpoint
this.generateRequestId = opts.generateRequestId || generateRequestId()
this.name = opts.name
this.opaqueIdPrefix = opts.opaqueIdPrefix
this.nodeFilter = opts.nodeFilter || defaultNodeFilter
if (typeof opts.nodeSelector === 'function') {
@ -114,6 +115,12 @@ class Transport {
// TODO: make this assignment FAST
const headers = Object.assign({}, this.headers, options.headers)
if (options.opaqueId !== undefined) {
headers['X-Opaque-Id'] = this.opaqueIdPrefix !== null
? this.opaqueIdPrefix + options.opaqueId
: options.opaqueId
}
// handle json body
if (params.body != null) {
if (shouldSerialize(params.body) === true) {

View File

@ -48,6 +48,7 @@ function start (opts) {
const apiFolderContents = readdirSync(apiFolder)
const xPackFolderContents = readdirSync(xPackFolder)
.filter(file => !file.startsWith('data_frame_transform_deprecated'))
apiFolderContents.forEach(generateApiFile(apiFolder, log))
xPackFolderContents.forEach(generateApiFile(xPackFolder, log))

View File

@ -13,6 +13,7 @@ const esDefaultRoles = [
'code_user',
'data_frame_transforms_admin',
'data_frame_transforms_user',
'enrich_user',
'ingest_admin',
'kibana_dashboard_only_user',
'kibana_system',
@ -29,6 +30,8 @@ const esDefaultRoles = [
'rollup_user',
'snapshot_user',
'superuser',
'transform_admin',
'transform_user',
'transport_client',
'watcher_admin',
'watcher_user'

View File

@ -851,3 +851,87 @@ test('Elastic cloud config', t => {
t.end()
})
test('Opaque Id support', t => {
t.test('No opaqueId', t => {
t.plan(3)
function handler (req, res) {
t.strictEqual(req.headers['x-opaque-id'], undefined)
res.setHeader('Content-Type', 'application/json;utf=8')
res.end(JSON.stringify({ hello: 'world' }))
}
buildServer(handler, ({ port }, server) => {
const client = new Client({
node: `http://localhost:${port}`
})
client.search({
index: 'test',
q: 'foo:bar'
}, (err, { body }) => {
t.error(err)
t.deepEqual(body, { hello: 'world' })
server.stop()
})
})
})
t.test('No prefix', t => {
t.plan(3)
function handler (req, res) {
t.strictEqual(req.headers['x-opaque-id'], 'bar')
res.setHeader('Content-Type', 'application/json;utf=8')
res.end(JSON.stringify({ hello: 'world' }))
}
buildServer(handler, ({ port }, server) => {
const client = new Client({
node: `http://localhost:${port}`
})
client.search({
index: 'test',
q: 'foo:bar'
}, {
opaqueId: 'bar'
}, (err, { body }) => {
t.error(err)
t.deepEqual(body, { hello: 'world' })
server.stop()
})
})
})
t.test('With prefix', t => {
t.plan(3)
function handler (req, res) {
t.strictEqual(req.headers['x-opaque-id'], 'foo-bar')
res.setHeader('Content-Type', 'application/json;utf=8')
res.end(JSON.stringify({ hello: 'world' }))
}
buildServer(handler, ({ port }, server) => {
const client = new Client({
node: `http://localhost:${port}`,
opaqueIdPrefix: 'foo-'
})
client.search({
index: 'test',
q: 'foo:bar'
}, {
opaqueId: 'bar'
}, (err, { body }) => {
t.error(err)
t.deepEqual(body, { hello: 'world' })
server.stop()
})
})
})
t.end()
})