Support for Elasticsearch 7.7 (#1192)

This commit is contained in:
Tomas Della Vedova
2020-05-14 09:55:54 +02:00
committed by GitHub
parent be6257380e
commit 51169d5efa
258 changed files with 15839 additions and 1485 deletions

View File

@ -32,7 +32,7 @@ echo -e "\033[1m>>>>> NPM run test:integration >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033
repo=$(realpath $(dirname $(realpath -s $0))/../)
run_script_args=""
if [[ "$NODE_JS_VERSION" == "8" ]]; then
run_script_args="-- --node-arg=--harmony-async-iteration"
run_script_args="--harmony-async-iteration"
fi
docker run \
@ -43,4 +43,4 @@ docker run \
--name elasticsearch-js \
--rm \
elastic/elasticsearch-js \
npm run test:integration ${run_script_args}
node ${run_script_args} test/integration/index.js

View File

@ -1,6 +1,6 @@
---
STACK_VERSION:
- 7.6-SNAPSHOT
- 7.7.0-SNAPSHOT
NODE_JS_VERSION:
- 14

View File

@ -65,6 +65,42 @@ jobs:
run: |
npm run test:unit -- --node-arg=--harmony-async-iteration
helpers-integration-test:
name: Helpers integration test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
steps:
- uses: actions/checkout@v2
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.7.0-SNAPSHOT
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: |
npm install
- name: Integration test
run: |
npm run test:integration:helpers
code-coverage:
name: Code coverage
runs-on: ubuntu-latest

View File

@ -52,6 +52,7 @@ We recommend that you write a lightweight proxy that uses this client instead.
## Documentation
- [Introduction](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/introduction.html)
- [Changelog](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/changelog-client.html)
- [Usage](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-usage.html)
- [Client configuration](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-configuration.html)
- [API reference](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html)
@ -60,6 +61,7 @@ We recommend that you write a lightweight proxy that uses this client instead.
- [Observability](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/observability.html)
- [Creating a child client](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/child-client.html)
- [Extend the client](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/extend-client.html)
- [Client helpers](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-helpers.html)
- [Typescript support](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/typescript.html)
- [Testing](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-testing.html)
- [Examples](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/examples.html)

View File

@ -0,0 +1,78 @@
// 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 buildAsyncSearchDelete (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
]
const snakeCase = {
}
/**
* Perform a async_search.delete request
* Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
*/
return function asyncSearchDelete (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_async_search' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildAsyncSearchDelete

View File

@ -0,0 +1,82 @@
// 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 buildAsyncSearchGet (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'wait_for_completion_timeout',
'keep_alive',
'typed_keys'
]
const snakeCase = {
waitForCompletionTimeout: 'wait_for_completion_timeout',
keepAlive: 'keep_alive',
typedKeys: 'typed_keys'
}
/**
* Perform a async_search.get request
* Retrieves the results of a previously submitted async search request given its ID.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
*/
return function asyncSearchGet (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_async_search' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildAsyncSearchGet

View File

@ -0,0 +1,147 @@
// 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 buildAsyncSearchSubmit (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'wait_for_completion_timeout',
'keep_on_completion',
'keep_alive',
'batched_reduce_size',
'request_cache',
'analyzer',
'analyze_wildcard',
'default_operator',
'df',
'explain',
'stored_fields',
'docvalue_fields',
'from',
'ignore_unavailable',
'ignore_throttled',
'allow_no_indices',
'expand_wildcards',
'lenient',
'preference',
'q',
'routing',
'search_type',
'size',
'sort',
'_source',
'_source_excludes',
'_source_exclude',
'_source_includes',
'_source_include',
'terminate_after',
'stats',
'suggest_field',
'suggest_mode',
'suggest_size',
'suggest_text',
'timeout',
'track_scores',
'track_total_hits',
'allow_partial_search_results',
'typed_keys',
'version',
'seq_no_primary_term',
'max_concurrent_shard_requests'
]
const snakeCase = {
waitForCompletionTimeout: 'wait_for_completion_timeout',
keepOnCompletion: 'keep_on_completion',
keepAlive: 'keep_alive',
batchedReduceSize: 'batched_reduce_size',
requestCache: 'request_cache',
analyzeWildcard: 'analyze_wildcard',
defaultOperator: 'default_operator',
storedFields: 'stored_fields',
docvalueFields: 'docvalue_fields',
ignoreUnavailable: 'ignore_unavailable',
ignoreThrottled: 'ignore_throttled',
allowNoIndices: 'allow_no_indices',
expandWildcards: 'expand_wildcards',
searchType: 'search_type',
_sourceExcludes: '_source_excludes',
_sourceExclude: '_source_exclude',
_sourceIncludes: '_source_includes',
_sourceInclude: '_source_include',
terminateAfter: 'terminate_after',
suggestField: 'suggest_field',
suggestMode: 'suggest_mode',
suggestSize: 'suggest_size',
suggestText: 'suggest_text',
trackScores: 'track_scores',
trackTotalHits: 'track_total_hits',
allowPartialSearchResults: 'allow_partial_search_results',
typedKeys: 'typed_keys',
seqNoPrimaryTerm: 'seq_no_primary_term',
maxConcurrentShardRequests: 'max_concurrent_shard_requests'
}
/**
* Perform a async_search.submit request
* Executes a search request asynchronously.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
*/
return function asyncSearchSubmit (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, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_async_search'
} else {
if (method == null) method = 'POST'
path = '/' + '_async_search'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildAsyncSearchSubmit

View File

@ -0,0 +1,72 @@
// 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 buildAutoscalingGetAutoscalingDecision (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
]
const snakeCase = {
}
/**
* Perform a autoscaling.get_autoscaling_decision request
* Gets the current autoscaling decision based on the configured autoscaling policy, indicating whether or not autoscaling is needed.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-decision.html
*/
return function autoscalingGetAutoscalingDecision (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 = '/' + '_autoscaling' + '/' + 'decision'
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildAutoscalingGetAutoscalingDecision

View File

@ -18,6 +18,7 @@ function buildCatAliases (opts) {
'help',
's',
'v',
'expand_wildcards',
'pretty',
'human',
'error_trace',
@ -26,6 +27,7 @@ function buildCatAliases (opts) {
]
const snakeCase = {
expandWildcards: 'expand_wildcards',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}

View File

@ -24,6 +24,7 @@ function buildCatIndices (opts) {
'time',
'v',
'include_unloaded_segments',
'expand_wildcards',
'pretty',
'human',
'error_trace',
@ -34,6 +35,7 @@ function buildCatIndices (opts) {
const snakeCase = {
masterTimeout: 'master_timeout',
includeUnloadedSegments: 'include_unloaded_segments',
expandWildcards: 'expand_wildcards',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}

View File

@ -0,0 +1,85 @@
// 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 buildCatMlDataFrameAnalytics (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'allow_no_match',
'bytes',
'format',
'h',
'help',
's',
'time',
'v'
]
const snakeCase = {
allowNoMatch: 'allow_no_match'
}
/**
* Perform a cat.ml_data_frame_analytics request
* Gets configuration and usage information about data frame analytics jobs.
* http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-dfanalytics.html
*/
return function catMlDataFrameAnalytics (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, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((id) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'data_frame' + '/' + 'analytics'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatMlDataFrameAnalytics

View File

@ -0,0 +1,84 @@
// 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 buildCatMlDatafeeds (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'allow_no_datafeeds',
'format',
'h',
'help',
's',
'time',
'v'
]
const snakeCase = {
allowNoDatafeeds: 'allow_no_datafeeds'
}
/**
* Perform a cat.ml_datafeeds request
* Gets configuration and usage information about datafeeds.
* http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-datafeeds.html
*/
return function catMlDatafeeds (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, datafeedId, datafeed_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((datafeed_id || datafeedId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatMlDatafeeds

85
api/api/cat.ml_jobs.js Normal file
View File

@ -0,0 +1,85 @@
// 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 buildCatMlJobs (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'allow_no_jobs',
'bytes',
'format',
'h',
'help',
's',
'time',
'v'
]
const snakeCase = {
allowNoJobs: 'allow_no_jobs'
}
/**
* Perform a cat.ml_jobs request
* Gets configuration and usage information about anomaly detection jobs.
* http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-anomaly-detectors.html
*/
return function catMlJobs (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, jobId, job_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((job_id || jobId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'anomaly_detectors'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatMlJobs

View File

@ -0,0 +1,87 @@
// 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 buildCatMlTrainedModels (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'allow_no_match',
'from',
'size',
'bytes',
'format',
'h',
'help',
's',
'time',
'v'
]
const snakeCase = {
allowNoMatch: 'allow_no_match'
}
/**
* Perform a cat.ml_trained_models request
* Gets configuration and usage information about inference trained models.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-trained-model.html
*/
return function catMlTrainedModels (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, modelId, model_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((model_id || modelId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models' + '/' + encodeURIComponent(model_id || modelId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatMlTrainedModels

86
api/api/cat.transforms.js Normal file
View File

@ -0,0 +1,86 @@
// 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 buildCatTransforms (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'from',
'size',
'allow_no_match',
'format',
'h',
'help',
's',
'time',
'v'
]
const snakeCase = {
allowNoMatch: 'allow_no_match'
}
/**
* Perform a cat.transforms request
* Gets configuration and usage information about transforms.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-transforms.html
*/
return function catTransforms (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((transform_id || transformId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'transforms'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatTransforms

View File

@ -21,6 +21,7 @@ function buildCcrDeleteAutoFollowPattern (opts) {
/**
* Perform a ccr.delete_auto_follow_pattern request
* Deletes auto-follow patterns.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html
*/
return function ccrDeleteAutoFollowPattern (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildCcrFollow (opts) {
/**
* Perform a ccr.follow request
* Creates a new follower index configured to follow the referenced leader index.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html
*/
return function ccrFollow (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildCcrFollowInfo (opts) {
/**
* Perform a ccr.follow_info request
* Retrieves information about all follower indices, including parameters and status for each follower index
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html
*/
return function ccrFollowInfo (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildCcrFollowStats (opts) {
/**
* Perform a ccr.follow_stats request
* Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html
*/
return function ccrFollowStats (params, options, callback) {

View File

@ -21,7 +21,8 @@ function buildCcrForgetFollower (opts) {
/**
* Perform a ccr.forget_follower request
* http://www.elastic.co/guide/en/elasticsearch/reference/current
* Removes the follower retention leases from the leader.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-forget-follower.html
*/
return function ccrForgetFollower (params, options, callback) {
options = options || {}

View File

@ -21,6 +21,7 @@ function buildCcrGetAutoFollowPattern (opts) {
/**
* Perform a ccr.get_auto_follow_pattern request
* Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html
*/
return function ccrGetAutoFollowPattern (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildCcrPauseAutoFollowPattern (opts) {
/**
* Perform a ccr.pause_auto_follow_pattern request
* Pauses an auto-follow pattern
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html
*/
return function ccrPauseAutoFollowPattern (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildCcrPauseFollow (opts) {
/**
* Perform a ccr.pause_follow request
* Pauses a follower index. The follower index will not fetch any additional operations from the leader index.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html
*/
return function ccrPauseFollow (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildCcrPutAutoFollowPattern (opts) {
/**
* Perform a ccr.put_auto_follow_pattern request
* Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html
*/
return function ccrPutAutoFollowPattern (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildCcrResumeAutoFollowPattern (opts) {
/**
* Perform a ccr.resume_auto_follow_pattern request
* Resumes an auto-follow pattern that has been paused
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-resume-auto-follow-pattern.html
*/
return function ccrResumeAutoFollowPattern (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildCcrResumeFollow (opts) {
/**
* Perform a ccr.resume_follow request
* Resumes a follower index that has been paused
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html
*/
return function ccrResumeFollow (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildCcrStats (opts) {
/**
* Perform a ccr.stats request
* Gets all stats related to cross-cluster replication.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html
*/
return function ccrStats (params, options, callback) {

View File

@ -21,7 +21,8 @@ function buildCcrUnfollow (opts) {
/**
* Perform a ccr.unfollow request
* http://www.elastic.co/guide/en/elasticsearch/reference/current
* Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-unfollow.html
*/
return function ccrUnfollow (params, options, callback) {
options = options || {}

View File

@ -0,0 +1,86 @@
// 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 buildClusterDeleteComponentTemplate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'timeout',
'master_timeout',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cluster.delete_component_template request
* Deletes a component template
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-templates.html
*/
return function clusterDeleteComponentTemplate (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 = '/' + '_component_template' + '/' + 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 = buildClusterDeleteComponentTemplate

View File

@ -0,0 +1,85 @@
// 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 buildClusterGetComponentTemplate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'master_timeout',
'local',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cluster.get_component_template request
* Returns one or more component templates
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-templates.html
*/
return function clusterGetComponentTemplate (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 = '/' + '_component_template' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'GET'
path = '/' + '_component_template'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildClusterGetComponentTemplate

View File

@ -0,0 +1,91 @@
// 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 buildClusterPutComponentTemplate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'create',
'timeout',
'master_timeout',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cluster.put_component_template request
* Creates or updates a component template
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-templates.html
*/
return function clusterPutComponentTemplate (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 = '/' + '_component_template' + '/' + 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 = buildClusterPutComponentTemplate

View File

@ -12,6 +12,7 @@ function buildDeleteByQuery (opts) {
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'analyzer',
'analyze_wildcard',
'default_operator',
'df',

View File

@ -21,6 +21,8 @@ function buildEnrichDeletePolicy (opts) {
/**
* Perform a enrich.delete_policy request
* Deletes an existing enrich policy and its enrich index.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-enrich-policy-api.html
*/
return function enrichDeletePolicy (params, options, callback) {
options = options || {}

View File

@ -21,6 +21,8 @@ function buildEnrichExecutePolicy (opts) {
/**
* Perform a enrich.execute_policy request
* Creates the enrich index for an existing enrich policy.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/execute-enrich-policy-api.html
*/
return function enrichExecutePolicy (params, options, callback) {
options = options || {}

View File

@ -21,6 +21,8 @@ function buildEnrichGetPolicy (opts) {
/**
* Perform a enrich.get_policy request
* Gets information about an enrich policy.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html
*/
return function enrichGetPolicy (params, options, callback) {
options = options || {}

View File

@ -21,6 +21,8 @@ function buildEnrichPutPolicy (opts) {
/**
* Perform a enrich.put_policy request
* Creates a new enrich policy.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/put-enrich-policy-api.html
*/
return function enrichPutPolicy (params, options, callback) {
options = options || {}

View File

@ -21,6 +21,8 @@ function buildEnrichStats (opts) {
/**
* Perform a enrich.stats request
* Gets enrich coordinator statistics and information about enrich policies that are currently executing.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats-api.html
*/
return function enrichStats (params, options, callback) {
options = options || {}

82
api/api/eql.search.js Normal file
View File

@ -0,0 +1,82 @@
// 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 buildEqlSearch (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
]
const snakeCase = {
}
/**
* Perform a eql.search request
* Returns results matching a query expressed in Event Query Language (EQL)
* https://www.elastic.co/guide/en/elasticsearch/reference/current/eql.html
*/
return function eqlSearch (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['index'] == null) {
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_eql' + '/' + 'search'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildEqlSearch

View File

@ -27,6 +27,7 @@ function buildGetScriptContext (opts) {
/**
* Perform a get_script_context request
* Returns all script contexts.
* https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-contexts.html
*/
return function getScriptContext (params, options, callback) {
options = options || {}

View File

@ -27,6 +27,7 @@ function buildGetScriptLanguages (opts) {
/**
* Perform a get_script_languages request
* Returns available script types, languages and contexts
* https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html
*/
return function getScriptLanguages (params, options, callback) {
options = options || {}

View File

@ -22,6 +22,7 @@ function buildGraphExplore (opts) {
/**
* Perform a graph.explore request
* Explore extracted and summarized information about the documents and terms in an index.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html
*/
return function graphExplore (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildIlmDeleteLifecycle (opts) {
/**
* Perform a ilm.delete_lifecycle request
* Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html
*/
return function ilmDeleteLifecycle (params, options, callback) {

View File

@ -23,6 +23,7 @@ function buildIlmExplainLifecycle (opts) {
/**
* Perform a ilm.explain_lifecycle request
* Retrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html
*/
return function ilmExplainLifecycle (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildIlmGetLifecycle (opts) {
/**
* Perform a ilm.get_lifecycle request
* Returns the specified policy definition. Includes the policy version and last modified date.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html
*/
return function ilmGetLifecycle (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildIlmGetStatus (opts) {
/**
* Perform a ilm.get_status request
* Retrieves the current index lifecycle management (ILM) status.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html
*/
return function ilmGetStatus (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildIlmMoveToStep (opts) {
/**
* Perform a ilm.move_to_step request
* Manually moves an index into the specified step and executes that step.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html
*/
return function ilmMoveToStep (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildIlmPutLifecycle (opts) {
/**
* Perform a ilm.put_lifecycle request
* Creates a lifecycle policy
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html
*/
return function ilmPutLifecycle (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildIlmRemovePolicy (opts) {
/**
* Perform a ilm.remove_policy request
* Removes the assigned lifecycle policy and stops managing the specified index
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html
*/
return function ilmRemovePolicy (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildIlmRetry (opts) {
/**
* Perform a ilm.retry request
* Retries executing the policy for an index that is in the ERROR step.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html
*/
return function ilmRetry (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildIlmStart (opts) {
/**
* Perform a ilm.start request
* Start the index lifecycle management (ILM) plugin.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html
*/
return function ilmStart (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildIlmStop (opts) {
/**
* Perform a ilm.stop request
* Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html
*/
return function ilmStop (params, options, callback) {

View File

@ -0,0 +1,87 @@
// 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 buildIndicesCreateDataStream (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a indices.create_data_stream request
* Creates or updates a data stream
* https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
*/
return function indicesCreateDataStream (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 = '/' + '_data_stream' + '/' + 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 = buildIndicesCreateDataStream

View File

@ -0,0 +1,83 @@
// 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 buildIndicesDeleteDataStream (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a indices.delete_data_stream request
* Deletes a data stream.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
*/
return function indicesDeleteDataStream (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 = '/' + '_data_stream' + '/' + 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 = buildIndicesDeleteDataStream

View File

@ -30,7 +30,8 @@ function buildIndicesFreeze (opts) {
/**
* Perform a indices.freeze request
* https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html
* Freezes an index. A frozen index has almost no overhead on the cluster (except for maintaining its metadata in memory) and is read-only.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/freeze-index-api.html
*/
return function indicesFreeze (params, options, callback) {
options = options || {}

View File

@ -0,0 +1,82 @@
// 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 buildIndicesGetDataStreams (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a indices.get_data_streams request
* Returns data streams.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
*/
return function indicesGetDataStreams (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 = '/' + '_data_streams' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'GET'
path = '/' + '_data_streams'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildIndicesGetDataStreams

View File

@ -15,9 +15,7 @@ function buildIndicesPutTemplate (opts) {
'include_type_name',
'order',
'create',
'timeout',
'master_timeout',
'flat_settings',
'pretty',
'human',
'error_trace',
@ -28,7 +26,6 @@ function buildIndicesPutTemplate (opts) {
const snakeCase = {
includeTypeName: 'include_type_name',
masterTimeout: 'master_timeout',
flatSettings: 'flat_settings',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}

View File

@ -25,6 +25,7 @@ function buildIndicesReloadSearchAnalyzers (opts) {
/**
* Perform a indices.reload_search_analyzers request
* Reloads an index's search analyzers and their resources.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-reload-analyzers.html
*/
return function indicesReloadSearchAnalyzers (params, options, callback) {

View File

@ -30,7 +30,8 @@ function buildIndicesUnfreeze (opts) {
/**
* Perform a indices.unfreeze request
* https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html
* Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/unfreeze-index-api.html
*/
return function indicesUnfreeze (params, options, callback) {
options = options || {}

View File

@ -21,6 +21,7 @@ function buildLicenseDelete (opts) {
/**
* Perform a license.delete request
* Deletes licensing information for the cluster
* https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-license.html
*/
return function licenseDelete (params, options, callback) {

View File

@ -22,6 +22,7 @@ function buildLicenseGet (opts) {
/**
* Perform a license.get request
* Retrieves licensing information for the cluster
* https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html
*/
return function licenseGet (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildLicenseGetBasicStatus (opts) {
/**
* Perform a license.get_basic_status request
* Retrieves information about the status of the basic license.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html
*/
return function licenseGetBasicStatus (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildLicenseGetTrialStatus (opts) {
/**
* Perform a license.get_trial_status request
* Retrieves information about the status of the trial license.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html
*/
return function licenseGetTrialStatus (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildLicensePost (opts) {
/**
* Perform a license.post request
* Updates the license for the cluster.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html
*/
return function licensePost (params, options, callback) {

View File

@ -21,6 +21,7 @@ function buildLicensePostStartBasic (opts) {
/**
* Perform a license.post_start_basic request
* Starts an indefinite basic license.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html
*/
return function licensePostStartBasic (params, options, callback) {

View File

@ -22,6 +22,7 @@ function buildLicensePostStartTrial (opts) {
/**
* Perform a license.post_start_trial request
* starts a limited time trial license.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html
*/
return function licensePostStartTrial (params, options, callback) {

View File

@ -21,7 +21,8 @@ function buildMigrationDeprecations (opts) {
/**
* Perform a migration.deprecations request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html
* Retrieves information about different cluster, node, and index level settings that use deprecated features that will be removed or changed in the next major version.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html
*/
return function migrationDeprecations (params, options, callback) {
options = options || {}

View File

@ -24,7 +24,8 @@ function buildMlCloseJob (opts) {
/**
* Perform a ml.close_job request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html
* Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html
*/
return function mlCloseJob (params, options, callback) {
options = options || {}

View File

@ -21,6 +21,8 @@ function buildMlDeleteCalendar (opts) {
/**
* Perform a ml.delete_calendar request
* Deletes a calendar.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar.html
*/
return function mlDeleteCalendar (params, options, callback) {
options = options || {}

View File

@ -21,6 +21,8 @@ function buildMlDeleteCalendarEvent (opts) {
/**
* Perform a ml.delete_calendar_event request
* Deletes scheduled events from a calendar.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-event.html
*/
return function mlDeleteCalendarEvent (params, options, callback) {
options = options || {}

View File

@ -21,6 +21,8 @@ function buildMlDeleteCalendarJob (opts) {
/**
* Perform a ml.delete_calendar_job request
* Deletes anomaly detection jobs from a calendar.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-job.html
*/
return function mlDeleteCalendarJob (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,8 @@ function buildMlDeleteDataFrameAnalytics (opts) {
/**
* Perform a ml.delete_data_frame_analytics request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html
* Deletes an existing data frame analytics job.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html
*/
return function mlDeleteDataFrameAnalytics (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,8 @@ function buildMlDeleteDatafeed (opts) {
/**
* Perform a ml.delete_datafeed request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html
* Deletes an existing datafeed.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html
*/
return function mlDeleteDatafeed (params, options, callback) {
options = options || {}

View File

@ -21,6 +21,8 @@ function buildMlDeleteExpiredData (opts) {
/**
* Perform a ml.delete_expired_data request
* Deletes expired and unused machine learning data.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-expired-data.html
*/
return function mlDeleteExpiredData (params, options, callback) {
options = options || {}

View File

@ -21,6 +21,8 @@ function buildMlDeleteFilter (opts) {
/**
* Perform a ml.delete_filter request
* Deletes a filter.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-filter.html
*/
return function mlDeleteFilter (params, options, callback) {
options = options || {}

View File

@ -23,7 +23,8 @@ function buildMlDeleteForecast (opts) {
/**
* Perform a ml.delete_forecast request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html
* Deletes forecasts from a machine learning job.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html
*/
return function mlDeleteForecast (params, options, callback) {
options = options || {}

View File

@ -22,7 +22,8 @@ function buildMlDeleteJob (opts) {
/**
* Perform a ml.delete_job request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html
* Deletes an existing anomaly detection job.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html
*/
return function mlDeleteJob (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,8 @@ function buildMlDeleteModelSnapshot (opts) {
/**
* Perform a ml.delete_model_snapshot request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html
* Deletes an existing model snapshot.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html
*/
return function mlDeleteModelSnapshot (params, options, callback) {
options = options || {}

View File

@ -21,6 +21,7 @@ function buildMlDeleteTrainedModel (opts) {
/**
* Perform a ml.delete_trained_model request
* Deletes an existing trained inference model that is currently not referenced by an ingest pipeline.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-inference.html
*/
return function mlDeleteTrainedModel (params, options, callback) {

View File

@ -0,0 +1,78 @@
// 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 buildMlEstimateModelMemory (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
]
const snakeCase = {
}
/**
* Perform a ml.estimate_model_memory request
* Estimates the model memory
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-apis.html
*/
return function mlEstimateModelMemory (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['body'] == null) {
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'POST'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + '_estimate_model_memory'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildMlEstimateModelMemory

View File

@ -21,7 +21,8 @@ function buildMlEvaluateDataFrame (opts) {
/**
* Perform a ml.evaluate_data_frame request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html
* Evaluates the data frame analytics for an annotated index.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html
*/
return function mlEvaluateDataFrame (params, options, callback) {
options = options || {}

View File

@ -21,6 +21,7 @@ function buildMlExplainDataFrameAnalytics (opts) {
/**
* Perform a ml.explain_data_frame_analytics request
* Explains a data frame analytics config.
* http://www.elastic.co/guide/en/elasticsearch/reference/current/explain-dfanalytics.html
*/
return function mlExplainDataFrameAnalytics (params, options, callback) {

View File

@ -42,7 +42,8 @@ function buildMlFindFileStructure (opts) {
/**
* Perform a ml.find_file_structure request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-find-file-structure.html
* Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-find-file-structure.html
*/
return function mlFindFileStructure (params, options, callback) {
options = options || {}

View File

@ -27,7 +27,8 @@ function buildMlFlushJob (opts) {
/**
* Perform a ml.flush_job request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html
* Forces any buffered data to be processed by the job.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html
*/
return function mlFlushJob (params, options, callback) {
options = options || {}

View File

@ -22,6 +22,8 @@ function buildMlForecast (opts) {
/**
* Perform a ml.forecast request
* Predicts the future behavior of a time series by using its historical behavior.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-forecast.html
*/
return function mlForecast (params, options, callback) {
options = options || {}

View File

@ -31,7 +31,8 @@ function buildMlGetBuckets (opts) {
/**
* Perform a ml.get_buckets request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html
* Retrieves anomaly detection job results for one or more buckets.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html
*/
return function mlGetBuckets (params, options, callback) {
options = options || {}

View File

@ -26,6 +26,8 @@ function buildMlGetCalendarEvents (opts) {
/**
* Perform a ml.get_calendar_events request
* Retrieves information about the scheduled events in calendars.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar-event.html
*/
return function mlGetCalendarEvents (params, options, callback) {
options = options || {}

View File

@ -22,6 +22,8 @@ function buildMlGetCalendars (opts) {
/**
* Perform a ml.get_calendars request
* Retrieves configuration information for calendars.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar.html
*/
return function mlGetCalendars (params, options, callback) {
options = options || {}

View File

@ -22,7 +22,8 @@ function buildMlGetCategories (opts) {
/**
* Perform a ml.get_categories request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html
* Retrieves anomaly detection job results for one or more categories.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html
*/
return function mlGetCategories (params, options, callback) {
options = options || {}

View File

@ -24,7 +24,8 @@ function buildMlGetDataFrameAnalytics (opts) {
/**
* Perform a ml.get_data_frame_analytics request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html
* Retrieves configuration information for data frame analytics jobs.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html
*/
return function mlGetDataFrameAnalytics (params, options, callback) {
options = options || {}

View File

@ -24,7 +24,8 @@ function buildMlGetDataFrameAnalyticsStats (opts) {
/**
* Perform a ml.get_data_frame_analytics_stats request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html
* Retrieves usage information for data frame analytics jobs.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html
*/
return function mlGetDataFrameAnalyticsStats (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,8 @@ function buildMlGetDatafeedStats (opts) {
/**
* Perform a ml.get_datafeed_stats request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html
* Retrieves usage information for datafeeds.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html
*/
return function mlGetDatafeedStats (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,8 @@ function buildMlGetDatafeeds (opts) {
/**
* Perform a ml.get_datafeeds request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html
* Retrieves configuration information for datafeeds.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html
*/
return function mlGetDatafeeds (params, options, callback) {
options = options || {}

View File

@ -22,6 +22,8 @@ function buildMlGetFilters (opts) {
/**
* Perform a ml.get_filters request
* Retrieves filters.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-filter.html
*/
return function mlGetFilters (params, options, callback) {
options = options || {}

View File

@ -30,7 +30,8 @@ function buildMlGetInfluencers (opts) {
/**
* Perform a ml.get_influencers request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html
* Retrieves anomaly detection job results for one or more influencers.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html
*/
return function mlGetInfluencers (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,8 @@ function buildMlGetJobStats (opts) {
/**
* Perform a ml.get_job_stats request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html
* Retrieves usage information for anomaly detection jobs.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html
*/
return function mlGetJobStats (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,8 @@ function buildMlGetJobs (opts) {
/**
* Perform a ml.get_jobs request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html
* Retrieves configuration information for anomaly detection jobs.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html
*/
return function mlGetJobs (params, options, callback) {
options = options || {}

View File

@ -26,7 +26,8 @@ function buildMlGetModelSnapshots (opts) {
/**
* Perform a ml.get_model_snapshots request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html
* Retrieves information about model snapshots.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html
*/
return function mlGetModelSnapshots (params, options, callback) {
options = options || {}

View File

@ -31,7 +31,8 @@ function buildMlGetOverallBuckets (opts) {
/**
* Perform a ml.get_overall_buckets request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html
* Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html
*/
return function mlGetOverallBuckets (params, options, callback) {
options = options || {}

View File

@ -30,7 +30,8 @@ function buildMlGetRecords (opts) {
/**
* Perform a ml.get_records request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html
* Retrieves anomaly records for an anomaly detection job.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html
*/
return function mlGetRecords (params, options, callback) {
options = options || {}

View File

@ -16,7 +16,8 @@ function buildMlGetTrainedModels (opts) {
'include_model_definition',
'decompress_definition',
'from',
'size'
'size',
'tags'
]
const snakeCase = {
@ -28,6 +29,7 @@ function buildMlGetTrainedModels (opts) {
/**
* Perform a ml.get_trained_models request
* Retrieves configuration information for a trained inference model.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference.html
*/
return function mlGetTrainedModels (params, options, callback) {

Some files were not shown because too many files have changed in this diff Show More