Compare commits

..

10 Commits

Author SHA1 Message Date
4def742e47 Bumped v7.10.0 2020-11-12 07:46:09 +01:00
1b7402d06c API generation 2020-11-12 07:45:50 +01:00
3d728bcad7 Handle connectivity issues while reading the body (#1343) 2020-11-10 18:25:22 +01:00
2d51ef429f [Backport 7.x] Add warning log about nodejs version support (#1350)
Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
2020-11-10 18:14:58 +01:00
39789031c3 Added node.js support doc (#1346)
Co-authored-by: István Zoltán Szabó <istvan.szabo@elastic.co>
2020-11-10 18:14:55 +01:00
dfb09b4827 [7.x][DOCS] Adds Connecting section to Node.JS docs (#1344) 2020-11-10 18:13:53 +01:00
11c11e4568 API generation 2020-10-21 11:08:30 +02:00
27a4e908c9 Bumped v7.10.0-rc.1 2020-10-19 16:49:39 +02:00
c20109ec78 Fix integration test (#1335) 2020-10-15 08:56:44 +02:00
d6270b17c4 Updated ci configuration 2020-10-12 16:18:34 +02:00
152 changed files with 2062 additions and 4740 deletions

View File

@ -18,7 +18,7 @@ require_stack_version
if [[ -z $es_node_name ]]; then
# only set these once
set -euo pipefail
export TEST_SUITE=${TEST_SUITE-free}
export TEST_SUITE=${TEST_SUITE-oss}
export RUNSCRIPTS=${RUNSCRIPTS-}
export DETACH=${DETACH-false}
export CLEANUP=${CLEANUP-false}
@ -27,7 +27,8 @@ if [[ -z $es_node_name ]]; then
export elastic_password=changeme
export elasticsearch_image=elasticsearch
export elasticsearch_url=https://elastic:${elastic_password}@${es_node_name}:9200
if [[ $TEST_SUITE != "platinum" ]]; then
if [[ $TEST_SUITE != "xpack" ]]; then
export elasticsearch_image=elasticsearch-${TEST_SUITE}
export elasticsearch_url=http://${es_node_name}:9200
fi
export external_elasticsearch_url=${elasticsearch_url/$es_node_name/localhost}

View File

@ -4,7 +4,7 @@
# to form a cluster suitable for running the REST API tests.
#
# Export the STACK_VERSION variable, eg. '8.0.0-SNAPSHOT'.
# Export the TEST_SUITE variable, eg. 'free' or 'platinum' defaults to 'free'.
# Export the TEST_SUITE variable, eg. 'oss' or 'xpack' defaults to 'oss'.
# Export the NUMBER_OF_NODES variable to start more than 1 node
# Version 1.2.0
@ -39,7 +39,7 @@ environment=($(cat <<-END
--env repositories.url.allowed_urls=http://snapshot.test*
END
))
if [[ "$TEST_SUITE" == "platinum" ]]; then
if [[ "$TEST_SUITE" == "xpack" ]]; then
environment+=($(cat <<-END
--env ELASTIC_PASSWORD=$elastic_password
--env xpack.license.self_generated.type=trial
@ -64,7 +64,7 @@ END
fi
cert_validation_flags=""
if [[ "$TEST_SUITE" == "platinum" ]]; then
if [[ "$TEST_SUITE" == "xpack" ]]; then
cert_validation_flags="--insecure --cacert /usr/share/elasticsearch/config/certs/ca.crt --resolve ${es_node_name}:443:127.0.0.1"
fi

View File

@ -2,7 +2,7 @@
# parameters are available to this script
# STACK_VERSION -- version e.g Major.Minor.Patch(-Prelease)
# TEST_SUITE -- which test suite to run: free or platinum
# TEST_SUITE -- which test suite to run: oss or xpack
# ELASTICSEARCH_URL -- The url at which elasticsearch is reachable, a default is composed based on STACK_VERSION and TEST_SUITE
# NODE_JS_VERSION -- node js version (defined in test-matrix.yml, a default is hardcoded here)
script_path=$(dirname $(realpath -s $0))

View File

@ -1,14 +1,15 @@
---
STACK_VERSION:
- 7.12.0-SNAPSHOT
- 7.10.0-SNAPSHOT
NODE_JS_VERSION:
- 14
- 12
- 10
- 8
TEST_SUITE:
- free
- platinum
- oss
- xpack
exclude: ~

View File

@ -40,6 +40,31 @@ jobs:
run: |
npm run test:types
test-node-v8:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [8.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: |
npm install
- name: Test
run: |
npm run test:node8
helpers-integration-test:
name: Helpers integration test
runs-on: ubuntu-latest
@ -61,7 +86,7 @@ jobs:
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.12.0-SNAPSHOT
stack-version: 7.10.0-SNAPSHOT
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1

1
.gitignore vendored
View File

@ -60,4 +60,3 @@ test/benchmarks/macro/fixtures/*
.cache
test/bundlers/**/bundle.js
test/bundlers/parcel-test/.parcel-cache

View File

@ -70,7 +70,3 @@ certs
.github
CODE_OF_CONDUCT.md
CONTRIBUTING.md
# CANARY-PACKAGE
api/kibana.d.ts
# /CANARY-PACKAGE

View File

@ -28,7 +28,7 @@ npm install @elastic/elasticsearch
### Node.js support
NOTE: The minimum supported version of Node.js is `v10`.
NOTE: The minimum supported version of Node.js is `v8`.
The client versioning follows the Elastc Stack versioning, this means that
major, minor, and patch releases are done following a precise schedule that
@ -71,7 +71,7 @@ npm install @elastic/elasticsearch@<major>
#### Browser
WARNING: There is no official support for the browser environment. It exposes your Elasticsearch instance to everyone, which could lead to security issues.
We recommend that you write a lightweight proxy that uses this client instead, you can see a proxy example [here](./docs/examples/proxy).
We recommend that you write a lightweight proxy that uses this client instead.
## Documentation

View File

@ -35,15 +35,15 @@ AsyncSearchApi.prototype.delete = function asyncSearchDeleteApi (params, options
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_async_search' + '/' + encodeURIComponent(id)
@ -62,15 +62,15 @@ AsyncSearchApi.prototype.get = function asyncSearchGetApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_async_search' + '/' + encodeURIComponent(id)
@ -85,40 +85,13 @@ AsyncSearchApi.prototype.get = function asyncSearchGetApi (params, options, call
return this.transport.request(request, options, callback)
}
AsyncSearchApi.prototype.status = function asyncSearchStatusApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_async_search' + '/' + 'status' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
AsyncSearchApi.prototype.submit = function asyncSearchSubmitApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_async_search'

View File

@ -35,15 +35,15 @@ AutoscalingApi.prototype.deleteAutoscalingPolicy = function autoscalingDeleteAut
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name)
@ -58,15 +58,15 @@ AutoscalingApi.prototype.deleteAutoscalingPolicy = function autoscalingDeleteAut
return this.transport.request(request, options, callback)
}
AutoscalingApi.prototype.getAutoscalingCapacity = function autoscalingGetAutoscalingCapacityApi (params, options, callback) {
AutoscalingApi.prototype.getAutoscalingDecision = function autoscalingGetAutoscalingDecisionApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_autoscaling' + '/' + 'capacity'
path = '/' + '_autoscaling' + '/' + 'decision'
// build request object
const request = {
@ -83,15 +83,15 @@ AutoscalingApi.prototype.getAutoscalingPolicy = function autoscalingGetAutoscali
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name)
@ -110,19 +110,19 @@ AutoscalingApi.prototype.putAutoscalingPolicy = function autoscalingPutAutoscali
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name)
@ -139,7 +139,7 @@ AutoscalingApi.prototype.putAutoscalingPolicy = function autoscalingPutAutoscali
Object.defineProperties(AutoscalingApi.prototype, {
delete_autoscaling_policy: { get () { return this.deleteAutoscalingPolicy } },
get_autoscaling_capacity: { get () { return this.getAutoscalingCapacity } },
get_autoscaling_decision: { get () { return this.getAutoscalingDecision } },
get_autoscaling_policy: { get () { return this.getAutoscalingPolicy } },
put_autoscaling_policy: { get () { return this.putAutoscalingPolicy } }
})

View File

@ -30,21 +30,21 @@ function bulkApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params.type != null && (params.index == null)) {
if (params['type'] != null && (params['index'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, index, type, ...querystring } = params
var { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_bulk'

View File

@ -23,8 +23,8 @@
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['format', 'local', 'h', 'help', 's', 'v', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'bytes', 'master_timeout', 'fields', 'time', 'ts', 'health', 'pri', 'include_unloaded_segments', 'full_id', 'include_bootstrap', 'active_only', 'detailed', 'index', 'ignore_unavailable', 'nodes', 'actions', 'parent_task_id', 'size', 'allow_no_match', 'allow_no_datafeeds', 'allow_no_jobs', 'from']
const snakeCase = { expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', includeUnloadedSegments: 'include_unloaded_segments', fullId: 'full_id', includeBootstrap: 'include_bootstrap', activeOnly: 'active_only', ignoreUnavailable: 'ignore_unavailable', parentTaskId: 'parent_task_id', allowNoMatch: 'allow_no_match', allowNoDatafeeds: 'allow_no_datafeeds', allowNoJobs: 'allow_no_jobs' }
const acceptedQuerystring = ['format', 'local', 'h', 'help', 's', 'v', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'bytes', 'master_timeout', 'fields', 'time', 'ts', 'health', 'pri', 'include_unloaded_segments', 'full_id', 'active_only', 'detailed', 'index', 'ignore_unavailable', 'node_id', 'actions', 'parent_task', 'size', 'allow_no_match', 'allow_no_datafeeds', 'allow_no_jobs', 'from']
const snakeCase = { expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', includeUnloadedSegments: 'include_unloaded_segments', fullId: 'full_id', activeOnly: 'active_only', ignoreUnavailable: 'ignore_unavailable', nodeId: 'node_id', parentTask: 'parent_task', allowNoMatch: 'allow_no_match', allowNoDatafeeds: 'allow_no_datafeeds', allowNoJobs: 'allow_no_jobs' }
function CatApi (transport, ConfigurationError) {
this.transport = transport
@ -34,10 +34,10 @@ function CatApi (transport, ConfigurationError) {
CatApi.prototype.aliases = function catAliasesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'aliases' + '/' + encodeURIComponent(name)
@ -60,10 +60,10 @@ CatApi.prototype.aliases = function catAliasesApi (params, options, callback) {
CatApi.prototype.allocation = function catAllocationApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, nodeId, node_id, ...querystring } = params
var { method, body, nodeId, node_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'allocation' + '/' + encodeURIComponent(node_id || nodeId)
@ -86,10 +86,10 @@ CatApi.prototype.allocation = function catAllocationApi (params, options, callba
CatApi.prototype.count = function catCountApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'count' + '/' + encodeURIComponent(index)
@ -112,10 +112,10 @@ CatApi.prototype.count = function catCountApi (params, options, callback) {
CatApi.prototype.fielddata = function catFielddataApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, fields, ...querystring } = params
var { method, body, fields, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((fields) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'fielddata' + '/' + encodeURIComponent(fields)
@ -138,10 +138,10 @@ CatApi.prototype.fielddata = function catFielddataApi (params, options, callback
CatApi.prototype.health = function catHealthApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'health'
@ -159,10 +159,10 @@ CatApi.prototype.health = function catHealthApi (params, options, callback) {
CatApi.prototype.help = function catHelpApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat'
@ -180,10 +180,10 @@ CatApi.prototype.help = function catHelpApi (params, options, callback) {
CatApi.prototype.indices = function catIndicesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'indices' + '/' + encodeURIComponent(index)
@ -206,10 +206,10 @@ CatApi.prototype.indices = function catIndicesApi (params, options, callback) {
CatApi.prototype.master = function catMasterApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'master'
@ -227,10 +227,10 @@ CatApi.prototype.master = function catMasterApi (params, options, callback) {
CatApi.prototype.nodeattrs = function catNodeattrsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'nodeattrs'
@ -248,10 +248,10 @@ CatApi.prototype.nodeattrs = function catNodeattrsApi (params, options, callback
CatApi.prototype.nodes = function catNodesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'nodes'
@ -269,10 +269,10 @@ CatApi.prototype.nodes = function catNodesApi (params, options, callback) {
CatApi.prototype.pendingTasks = function catPendingTasksApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'pending_tasks'
@ -290,10 +290,10 @@ CatApi.prototype.pendingTasks = function catPendingTasksApi (params, options, ca
CatApi.prototype.plugins = function catPluginsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'plugins'
@ -311,10 +311,10 @@ CatApi.prototype.plugins = function catPluginsApi (params, options, callback) {
CatApi.prototype.recovery = function catRecoveryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'recovery' + '/' + encodeURIComponent(index)
@ -337,10 +337,10 @@ CatApi.prototype.recovery = function catRecoveryApi (params, options, callback)
CatApi.prototype.repositories = function catRepositoriesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'repositories'
@ -358,10 +358,10 @@ CatApi.prototype.repositories = function catRepositoriesApi (params, options, ca
CatApi.prototype.segments = function catSegmentsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'segments' + '/' + encodeURIComponent(index)
@ -384,10 +384,10 @@ CatApi.prototype.segments = function catSegmentsApi (params, options, callback)
CatApi.prototype.shards = function catShardsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'shards' + '/' + encodeURIComponent(index)
@ -410,10 +410,10 @@ CatApi.prototype.shards = function catShardsApi (params, options, callback) {
CatApi.prototype.snapshots = function catSnapshotsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, repository, ...querystring } = params
var { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((repository) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'snapshots' + '/' + encodeURIComponent(repository)
@ -436,10 +436,10 @@ CatApi.prototype.snapshots = function catSnapshotsApi (params, options, callback
CatApi.prototype.tasks = function catTasksApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'tasks'
@ -457,10 +457,10 @@ CatApi.prototype.tasks = function catTasksApi (params, options, callback) {
CatApi.prototype.templates = function catTemplatesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'templates' + '/' + encodeURIComponent(name)
@ -483,10 +483,10 @@ CatApi.prototype.templates = function catTemplatesApi (params, options, callback
CatApi.prototype.threadPool = function catThreadPoolApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, threadPoolPatterns, thread_pool_patterns, ...querystring } = params
var { method, body, threadPoolPatterns, thread_pool_patterns, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((thread_pool_patterns || threadPoolPatterns) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'thread_pool' + '/' + encodeURIComponent(thread_pool_patterns || threadPoolPatterns)
@ -509,10 +509,10 @@ CatApi.prototype.threadPool = function catThreadPoolApi (params, options, callba
CatApi.prototype.mlDataFrameAnalytics = function catMlDataFrameAnalyticsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((id) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id)
@ -535,10 +535,10 @@ CatApi.prototype.mlDataFrameAnalytics = function catMlDataFrameAnalyticsApi (par
CatApi.prototype.mlDatafeeds = function catMlDatafeedsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, datafeedId, datafeed_id, ...querystring } = params
var { method, body, datafeedId, datafeed_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((datafeed_id || datafeedId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
@ -561,10 +561,10 @@ CatApi.prototype.mlDatafeeds = function catMlDatafeedsApi (params, options, call
CatApi.prototype.mlJobs = function catMlJobsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, jobId, job_id, ...querystring } = params
var { method, body, jobId, job_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((job_id || jobId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
@ -587,10 +587,10 @@ CatApi.prototype.mlJobs = function catMlJobsApi (params, options, callback) {
CatApi.prototype.mlTrainedModels = function catMlTrainedModelsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, modelId, model_id, ...querystring } = params
var { method, body, modelId, model_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((model_id || modelId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models' + '/' + encodeURIComponent(model_id || modelId)
@ -613,10 +613,10 @@ CatApi.prototype.mlTrainedModels = function catMlTrainedModelsApi (params, optio
CatApi.prototype.transforms = function catTransformsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, transformId, transform_id, ...querystring } = params
var { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((transform_id || transformId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId)

View File

@ -35,15 +35,15 @@ CcrApi.prototype.deleteAutoFollowPattern = function ccrDeleteAutoFollowPatternAp
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
@ -62,19 +62,19 @@ CcrApi.prototype.follow = function ccrFollowApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'follow'
@ -93,15 +93,15 @@ CcrApi.prototype.followInfo = function ccrFollowInfoApi (params, options, callba
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'info'
@ -120,15 +120,15 @@ CcrApi.prototype.followStats = function ccrFollowStatsApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'stats'
@ -147,19 +147,19 @@ CcrApi.prototype.forgetFollower = function ccrForgetFollowerApi (params, options
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'forget_follower'
@ -177,10 +177,10 @@ CcrApi.prototype.forgetFollower = function ccrForgetFollowerApi (params, options
CcrApi.prototype.getAutoFollowPattern = function ccrGetAutoFollowPatternApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
@ -204,15 +204,15 @@ CcrApi.prototype.pauseAutoFollowPattern = function ccrPauseAutoFollowPatternApi
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name) + '/' + 'pause'
@ -231,15 +231,15 @@ CcrApi.prototype.pauseFollow = function ccrPauseFollowApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'pause_follow'
@ -258,19 +258,19 @@ CcrApi.prototype.putAutoFollowPattern = function ccrPutAutoFollowPatternApi (par
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
@ -289,15 +289,15 @@ CcrApi.prototype.resumeAutoFollowPattern = function ccrResumeAutoFollowPatternAp
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name) + '/' + 'resume'
@ -316,15 +316,15 @@ CcrApi.prototype.resumeFollow = function ccrResumeFollowApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'resume_follow'
@ -342,10 +342,10 @@ CcrApi.prototype.resumeFollow = function ccrResumeFollowApi (params, options, ca
CcrApi.prototype.stats = function ccrStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_ccr' + '/' + 'stats'
@ -364,15 +364,15 @@ CcrApi.prototype.unfollow = function ccrUnfollowApi (params, options, callback)
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'unfollow'

View File

@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function clearScrollApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, scrollId, scroll_id, ...querystring } = params
var { method, body, scrollId, scroll_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((scroll_id || scrollId) != null) {
if (method == null) method = 'DELETE'
path = '/' + '_search' + '/' + 'scroll' + '/' + encodeURIComponent(scroll_id || scrollId)

View File

@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function closePointInTimeApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_pit'

View File

@ -34,10 +34,10 @@ function ClusterApi (transport, ConfigurationError) {
ClusterApi.prototype.allocationExplain = function clusterAllocationExplainApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_cluster' + '/' + 'allocation' + '/' + 'explain'
@ -56,15 +56,15 @@ ClusterApi.prototype.deleteComponentTemplate = function clusterDeleteComponentTe
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
@ -82,10 +82,10 @@ ClusterApi.prototype.deleteComponentTemplate = function clusterDeleteComponentTe
ClusterApi.prototype.deleteVotingConfigExclusions = function clusterDeleteVotingConfigExclusionsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_cluster' + '/' + 'voting_config_exclusions'
@ -104,15 +104,15 @@ ClusterApi.prototype.existsComponentTemplate = function clusterExistsComponentTe
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'HEAD'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
@ -130,10 +130,10 @@ ClusterApi.prototype.existsComponentTemplate = function clusterExistsComponentTe
ClusterApi.prototype.getComponentTemplate = function clusterGetComponentTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
@ -156,10 +156,10 @@ ClusterApi.prototype.getComponentTemplate = function clusterGetComponentTemplate
ClusterApi.prototype.getSettings = function clusterGetSettingsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'settings'
@ -177,10 +177,10 @@ ClusterApi.prototype.getSettings = function clusterGetSettingsApi (params, optio
ClusterApi.prototype.health = function clusterHealthApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'health' + '/' + encodeURIComponent(index)
@ -203,10 +203,10 @@ ClusterApi.prototype.health = function clusterHealthApi (params, options, callba
ClusterApi.prototype.pendingTasks = function clusterPendingTasksApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'pending_tasks'
@ -224,10 +224,10 @@ ClusterApi.prototype.pendingTasks = function clusterPendingTasksApi (params, opt
ClusterApi.prototype.postVotingConfigExclusions = function clusterPostVotingConfigExclusionsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_cluster' + '/' + 'voting_config_exclusions'
@ -246,19 +246,19 @@ ClusterApi.prototype.putComponentTemplate = function clusterPutComponentTemplate
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
@ -277,15 +277,15 @@ ClusterApi.prototype.putSettings = function clusterPutSettingsApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_cluster' + '/' + 'settings'
@ -303,10 +303,10 @@ ClusterApi.prototype.putSettings = function clusterPutSettingsApi (params, optio
ClusterApi.prototype.remoteInfo = function clusterRemoteInfoApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_remote' + '/' + 'info'
@ -324,10 +324,10 @@ ClusterApi.prototype.remoteInfo = function clusterRemoteInfoApi (params, options
ClusterApi.prototype.reroute = function clusterRerouteApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_cluster' + '/' + 'reroute'
@ -346,15 +346,15 @@ ClusterApi.prototype.state = function clusterStateApi (params, options, callback
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required url components
if (params.index != null && (params.metric == null)) {
if (params['index'] != null && (params['metric'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: metric')
return handleError(err, callback)
}
let { method, body, metric, index, ...querystring } = params
var { method, body, metric, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((metric) != null && (index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index)
@ -380,10 +380,10 @@ ClusterApi.prototype.state = function clusterStateApi (params, options, callback
ClusterApi.prototype.stats = function clusterStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, nodeId, node_id, ...querystring } = params
var { method, body, nodeId, node_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'stats' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId)

View File

@ -30,15 +30,15 @@ function countApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required url components
if (params.type != null && (params.index == null)) {
if (params['type'] != null && (params['index'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, index, type, ...querystring } = params
var { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_count'

View File

@ -30,23 +30,23 @@ function createApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, id, index, type, ...querystring } = params
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_create'

View File

@ -35,15 +35,15 @@ DanglingIndicesApi.prototype.deleteDanglingIndex = function danglingIndicesDelet
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index_uuid == null && params.indexUuid == null) {
if (params['index_uuid'] == null && params['indexUuid'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index_uuid or indexUuid')
return handleError(err, callback)
}
let { method, body, indexUuid, index_uuid, ...querystring } = params
var { method, body, indexUuid, index_uuid, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_dangling' + '/' + encodeURIComponent(index_uuid || indexUuid)
@ -62,15 +62,15 @@ DanglingIndicesApi.prototype.importDanglingIndex = function danglingIndicesImpor
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index_uuid == null && params.indexUuid == null) {
if (params['index_uuid'] == null && params['indexUuid'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index_uuid or indexUuid')
return handleError(err, callback)
}
let { method, body, indexUuid, index_uuid, ...querystring } = params
var { method, body, indexUuid, index_uuid, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_dangling' + '/' + encodeURIComponent(index_uuid || indexUuid)
@ -88,10 +88,10 @@ DanglingIndicesApi.prototype.importDanglingIndex = function danglingIndicesImpor
DanglingIndicesApi.prototype.listDanglingIndices = function danglingIndicesListDanglingIndicesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_dangling'

View File

@ -30,19 +30,19 @@ function deleteApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, id, index, type, ...querystring } = params
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'DELETE'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)

View File

@ -30,25 +30,25 @@ function deleteByQueryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params.type != null && (params.index == null)) {
if (params['type'] != null && (params['index'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, index, type, ...querystring } = params
var { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_delete_by_query'

View File

@ -30,19 +30,19 @@ function deleteByQueryRethrottleApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.task_id == null && params.taskId == null) {
if (params['task_id'] == null && params['taskId'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: task_id or taskId')
return handleError(err, callback)
}
if (params.requests_per_second == null && params.requestsPerSecond == null) {
if (params['requests_per_second'] == null && params['requestsPerSecond'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: requests_per_second or requestsPerSecond')
return handleError(err, callback)
}
let { method, body, taskId, task_id, ...querystring } = params
var { method, body, taskId, task_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_delete_by_query' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_rethrottle'

View File

@ -30,15 +30,15 @@ function deleteScriptApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_scripts' + '/' + encodeURIComponent(id)

View File

@ -35,15 +35,15 @@ EnrichApi.prototype.deletePolicy = function enrichDeletePolicyApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
@ -62,15 +62,15 @@ EnrichApi.prototype.executePolicy = function enrichExecutePolicyApi (params, opt
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name) + '/' + '_execute'
@ -88,10 +88,10 @@ EnrichApi.prototype.executePolicy = function enrichExecutePolicyApi (params, opt
EnrichApi.prototype.getPolicy = function enrichGetPolicyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
@ -115,19 +115,19 @@ EnrichApi.prototype.putPolicy = function enrichPutPolicyApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
@ -145,10 +145,10 @@ EnrichApi.prototype.putPolicy = function enrichPutPolicyApi (params, options, ca
EnrichApi.prototype.stats = function enrichStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_enrich' + '/' + '_stats'

View File

@ -35,15 +35,15 @@ EqlApi.prototype.delete = function eqlDeleteApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_eql' + '/' + 'search' + '/' + encodeURIComponent(id)
@ -62,15 +62,15 @@ EqlApi.prototype.get = function eqlGetApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_eql' + '/' + 'search' + '/' + encodeURIComponent(id)
@ -85,50 +85,23 @@ EqlApi.prototype.get = function eqlGetApi (params, options, callback) {
return this.transport.request(request, options, callback)
}
EqlApi.prototype.getStatus = function eqlGetStatusApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_eql' + '/' + 'search' + '/' + 'status' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
EqlApi.prototype.search = function eqlSearchApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_eql' + '/' + 'search'
@ -143,8 +116,4 @@ EqlApi.prototype.search = function eqlSearchApi (params, options, callback) {
return this.transport.request(request, options, callback)
}
Object.defineProperties(EqlApi.prototype, {
get_status: { get () { return this.getStatus } }
})
module.exports = EqlApi

View File

@ -30,19 +30,19 @@ function existsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, id, index, type, ...querystring } = params
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)

View File

@ -30,28 +30,28 @@ function existsSourceApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
// check required url components
if (params.id != null && (params.type == null || params.index == null)) {
if (params['id'] != null && (params['type'] == null || params['index'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: type, index')
return handleError(err, callback)
} else if (params.type != null && (params.index == null)) {
} else if (params['type'] != null && (params['index'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, id, index, type, ...querystring } = params
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'

View File

@ -30,19 +30,19 @@ function explainApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, id, index, type, ...querystring } = params
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain'

View File

@ -1,59 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' }
function FeaturesApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
FeaturesApi.prototype.getFeatures = function featuresGetFeaturesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_features'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(FeaturesApi.prototype, {
get_features: { get () { return this.getFeatures } }
})
module.exports = FeaturesApi

View File

@ -29,10 +29,10 @@ const snakeCase = { ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'al
function fieldCapsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_field_caps'

View File

@ -30,19 +30,19 @@ function getApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, id, index, type, ...querystring } = params
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)

View File

@ -30,15 +30,15 @@ function getScriptApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_scripts' + '/' + encodeURIComponent(id)

View File

@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function getScriptContextApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_script_context'

View File

@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function getScriptLanguagesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_script_language'

View File

@ -30,19 +30,19 @@ function getSourceApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, id, index, type, ...querystring } = params
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'

View File

@ -35,21 +35,21 @@ GraphApi.prototype.explore = function graphExploreApi (params, options, callback
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
// check required url components
if (params.type != null && (params.index == null)) {
if (params['type'] != null && (params['index'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, index, type, ...querystring } = params
var { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_graph' + '/' + 'explore'

View File

@ -35,15 +35,15 @@ IlmApi.prototype.deleteLifecycle = function ilmDeleteLifecycleApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.policy == null) {
if (params['policy'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: policy')
return handleError(err, callback)
}
let { method, body, policy, ...querystring } = params
var { method, body, policy, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy)
@ -62,15 +62,15 @@ IlmApi.prototype.explainLifecycle = function ilmExplainLifecycleApi (params, opt
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'explain'
@ -88,10 +88,10 @@ IlmApi.prototype.explainLifecycle = function ilmExplainLifecycleApi (params, opt
IlmApi.prototype.getLifecycle = function ilmGetLifecycleApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, policy, ...querystring } = params
var { method, body, policy, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((policy) != null) {
if (method == null) method = 'GET'
path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy)
@ -114,10 +114,10 @@ IlmApi.prototype.getLifecycle = function ilmGetLifecycleApi (params, options, ca
IlmApi.prototype.getStatus = function ilmGetStatusApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_ilm' + '/' + 'status'
@ -136,15 +136,15 @@ IlmApi.prototype.moveToStep = function ilmMoveToStepApi (params, options, callba
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_ilm' + '/' + 'move' + '/' + encodeURIComponent(index)
@ -163,15 +163,15 @@ IlmApi.prototype.putLifecycle = function ilmPutLifecycleApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.policy == null) {
if (params['policy'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: policy')
return handleError(err, callback)
}
let { method, body, policy, ...querystring } = params
var { method, body, policy, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy)
@ -190,15 +190,15 @@ IlmApi.prototype.removePolicy = function ilmRemovePolicyApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'remove'
@ -217,15 +217,15 @@ IlmApi.prototype.retry = function ilmRetryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'retry'
@ -243,10 +243,10 @@ IlmApi.prototype.retry = function ilmRetryApi (params, options, callback) {
IlmApi.prototype.start = function ilmStartApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_ilm' + '/' + 'start'
@ -264,10 +264,10 @@ IlmApi.prototype.start = function ilmStartApi (params, options, callback) {
IlmApi.prototype.stop = function ilmStopApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_ilm' + '/' + 'stop'

View File

@ -30,19 +30,19 @@ function indexApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, id, index, type, ...querystring } = params
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)

File diff suppressed because it is too large Load Diff

View File

@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function infoApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/'

View File

@ -35,15 +35,15 @@ IngestApi.prototype.deletePipeline = function ingestDeletePipelineApi (params, o
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
@ -61,10 +61,10 @@ IngestApi.prototype.deletePipeline = function ingestDeletePipelineApi (params, o
IngestApi.prototype.getPipeline = function ingestGetPipelineApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((id) != null) {
if (method == null) method = 'GET'
path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
@ -87,10 +87,10 @@ IngestApi.prototype.getPipeline = function ingestGetPipelineApi (params, options
IngestApi.prototype.processorGrok = function ingestProcessorGrokApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_ingest' + '/' + 'processor' + '/' + 'grok'
@ -109,19 +109,19 @@ IngestApi.prototype.putPipeline = function ingestPutPipelineApi (params, options
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
@ -140,15 +140,15 @@ IngestApi.prototype.simulate = function ingestSimulateApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((id) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id) + '/' + '_simulate'

View File

@ -34,10 +34,10 @@ function LicenseApi (transport, ConfigurationError) {
LicenseApi.prototype.delete = function licenseDeleteApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_license'
@ -55,10 +55,10 @@ LicenseApi.prototype.delete = function licenseDeleteApi (params, options, callba
LicenseApi.prototype.get = function licenseGetApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_license'
@ -76,10 +76,10 @@ LicenseApi.prototype.get = function licenseGetApi (params, options, callback) {
LicenseApi.prototype.getBasicStatus = function licenseGetBasicStatusApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_license' + '/' + 'basic_status'
@ -97,10 +97,10 @@ LicenseApi.prototype.getBasicStatus = function licenseGetBasicStatusApi (params,
LicenseApi.prototype.getTrialStatus = function licenseGetTrialStatusApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_license' + '/' + 'trial_status'
@ -118,10 +118,10 @@ LicenseApi.prototype.getTrialStatus = function licenseGetTrialStatusApi (params,
LicenseApi.prototype.post = function licensePostApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_license'
@ -139,10 +139,10 @@ LicenseApi.prototype.post = function licensePostApi (params, options, callback)
LicenseApi.prototype.postStartBasic = function licensePostStartBasicApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_license' + '/' + 'start_basic'
@ -160,10 +160,10 @@ LicenseApi.prototype.postStartBasic = function licensePostStartBasicApi (params,
LicenseApi.prototype.postStartTrial = function licensePostStartTrialApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_license' + '/' + 'start_trial'

View File

@ -1,125 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function LogstashApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
LogstashApi.prototype.deletePipeline = function logstashDeletePipelineApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_logstash' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
LogstashApi.prototype.getPipeline = function logstashGetPipelineApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_logstash' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
LogstashApi.prototype.putPipeline = function logstashPutPipelineApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_logstash' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(LogstashApi.prototype, {
delete_pipeline: { get () { return this.deletePipeline } },
get_pipeline: { get () { return this.getPipeline } },
put_pipeline: { get () { return this.putPipeline } }
})
module.exports = LogstashApi

View File

@ -30,21 +30,21 @@ function mgetApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params.type != null && (params.index == null)) {
if (params['type'] != null && (params['index'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, index, type, ...querystring } = params
var { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mget'

View File

@ -34,10 +34,10 @@ function MigrationApi (transport, ConfigurationError) {
MigrationApi.prototype.deprecations = function migrationDeprecationsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_migration' + '/' + 'deprecations'

File diff suppressed because it is too large Load Diff

View File

@ -35,15 +35,15 @@ MonitoringApi.prototype.bulk = function monitoringBulkApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, type, ...querystring } = params
var { method, body, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((type) != null) {
if (method == null) method = 'POST'
path = '/' + '_monitoring' + '/' + encodeURIComponent(type) + '/' + 'bulk'

View File

@ -30,21 +30,21 @@ function msearchApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params.type != null && (params.index == null)) {
if (params['type'] != null && (params['index'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, index, type, ...querystring } = params
var { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch'

View File

@ -30,21 +30,21 @@ function msearchTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params.type != null && (params.index == null)) {
if (params['type'] != null && (params['index'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, index, type, ...querystring } = params
var { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch' + '/' + 'template'

View File

@ -30,15 +30,15 @@ function mtermvectorsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required url components
if (params.type != null && (params.index == null)) {
if (params['type'] != null && (params['index'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, index, type, ...querystring } = params
var { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mtermvectors'

View File

@ -34,10 +34,10 @@ function NodesApi (transport, ConfigurationError) {
NodesApi.prototype.hotThreads = function nodesHotThreadsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, nodeId, node_id, ...querystring } = params
var { method, body, nodeId, node_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads'
@ -69,10 +69,10 @@ NodesApi.prototype.hotThreads = function nodesHotThreadsApi (params, options, ca
NodesApi.prototype.info = function nodesInfoApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, nodeId, node_id, metric, ...querystring } = params
var { method, body, nodeId, node_id, metric, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((node_id || nodeId) != null && (metric) != null) {
if (method == null) method = 'GET'
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + encodeURIComponent(metric)
@ -101,10 +101,10 @@ NodesApi.prototype.info = function nodesInfoApi (params, options, callback) {
NodesApi.prototype.reloadSecureSettings = function nodesReloadSecureSettingsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, nodeId, node_id, ...querystring } = params
var { method, body, nodeId, node_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((node_id || nodeId) != null) {
if (method == null) method = 'POST'
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'reload_secure_settings'
@ -127,10 +127,10 @@ NodesApi.prototype.reloadSecureSettings = function nodesReloadSecureSettingsApi
NodesApi.prototype.stats = function nodesStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, nodeId, node_id, metric, indexMetric, index_metric, ...querystring } = params
var { method, body, nodeId, node_id, metric, indexMetric, index_metric, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((node_id || nodeId) != null && (metric) != null && (index_metric || indexMetric) != null) {
if (method == null) method = 'GET'
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'stats' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index_metric || indexMetric)
@ -165,10 +165,10 @@ NodesApi.prototype.stats = function nodesStatsApi (params, options, callback) {
NodesApi.prototype.usage = function nodesUsageApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, nodeId, node_id, metric, ...querystring } = params
var { method, body, nodeId, node_id, metric, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((node_id || nodeId) != null && (metric) != null) {
if (method == null) method = 'GET'
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'usage' + '/' + encodeURIComponent(metric)

View File

@ -29,10 +29,10 @@ const snakeCase = { ignoreUnavailable: 'ignore_unavailable', expandWildcards: 'e
function openPointInTimeApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_pit'

View File

@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function pingApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'HEAD'
path = '/'

View File

@ -30,25 +30,25 @@ function putScriptApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params.context != null && (params.id == null)) {
if (params['context'] != null && (params['id'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: id')
return handleError(err, callback)
}
let { method, body, id, context, ...querystring } = params
var { method, body, id, context, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((id) != null && (context) != null) {
if (method == null) method = 'PUT'
path = '/' + '_scripts' + '/' + encodeURIComponent(id) + '/' + encodeURIComponent(context)

View File

@ -30,15 +30,15 @@ function rankEvalApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_rank_eval'

View File

@ -30,15 +30,15 @@ function reindexApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_reindex'

View File

@ -30,19 +30,19 @@ function reindexRethrottleApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.task_id == null && params.taskId == null) {
if (params['task_id'] == null && params['taskId'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: task_id or taskId')
return handleError(err, callback)
}
if (params.requests_per_second == null && params.requestsPerSecond == null) {
if (params['requests_per_second'] == null && params['requestsPerSecond'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: requests_per_second or requestsPerSecond')
return handleError(err, callback)
}
let { method, body, taskId, task_id, ...querystring } = params
var { method, body, taskId, task_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_reindex' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_rethrottle'

View File

@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function renderSearchTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((id) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_render' + '/' + 'template' + '/' + encodeURIComponent(id)

View File

@ -35,15 +35,15 @@ RollupApi.prototype.deleteJob = function rollupDeleteJobApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
@ -61,10 +61,10 @@ RollupApi.prototype.deleteJob = function rollupDeleteJobApi (params, options, ca
RollupApi.prototype.getJobs = function rollupGetJobsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((id) != null) {
if (method == null) method = 'GET'
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
@ -87,10 +87,10 @@ RollupApi.prototype.getJobs = function rollupGetJobsApi (params, options, callba
RollupApi.prototype.getRollupCaps = function rollupGetRollupCapsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((id) != null) {
if (method == null) method = 'GET'
path = '/' + '_rollup' + '/' + 'data' + '/' + encodeURIComponent(id)
@ -114,15 +114,15 @@ RollupApi.prototype.getRollupIndexCaps = function rollupGetRollupIndexCapsApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_rollup' + '/' + 'data'
@ -141,19 +141,19 @@ RollupApi.prototype.putJob = function rollupPutJobApi (params, options, callback
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
@ -168,70 +168,29 @@ RollupApi.prototype.putJob = function rollupPutJobApi (params, options, callback
return this.transport.request(request, options, callback)
}
RollupApi.prototype.rollup = function rollupRollupApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params.rollup_index == null && params.rollupIndex == null) {
const err = new this[kConfigurationError]('Missing required parameter: rollup_index or rollupIndex')
return handleError(err, callback)
}
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if ((params.rollup_index != null || params.rollupIndex != null) && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, index, rollupIndex, rollup_index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_rollup' + '/' + encodeURIComponent(rollup_index || rollupIndex)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
RollupApi.prototype.rollupSearch = function rollupRollupSearchApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params.type != null && (params.index == null)) {
if (params['type'] != null && (params['index'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, index, type, ...querystring } = params
var { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_rollup_search'
@ -255,15 +214,15 @@ RollupApi.prototype.startJob = function rollupStartJobApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id) + '/' + '_start'
@ -282,15 +241,15 @@ RollupApi.prototype.stopJob = function rollupStopJobApi (params, options, callba
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id) + '/' + '_stop'

View File

@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function scriptsPainlessExecuteApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_scripts' + '/' + 'painless' + '/' + '_execute'

View File

@ -29,10 +29,10 @@ const snakeCase = { scrollId: 'scroll_id', restTotalHitsAsInt: 'rest_total_hits_
function scrollApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, scrollId, scroll_id, ...querystring } = params
var { method, body, scrollId, scroll_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((scroll_id || scrollId) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_search' + '/' + 'scroll' + '/' + encodeURIComponent(scroll_id || scrollId)

View File

@ -23,22 +23,22 @@
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'ccs_minimize_roundtrips', 'default_operator', 'df', 'explain', 'stored_fields', 'docvalue_fields', 'from', 'ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'scroll', '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', 'request_cache', 'batched_reduce_size', 'max_concurrent_shard_requests', 'pre_filter_shard_size', 'rest_total_hits_as_int', 'min_compatible_shard_node', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { analyzeWildcard: 'analyze_wildcard', ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips', 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', requestCache: 'request_cache', batchedReduceSize: 'batched_reduce_size', maxConcurrentShardRequests: 'max_concurrent_shard_requests', preFilterShardSize: 'pre_filter_shard_size', restTotalHitsAsInt: 'rest_total_hits_as_int', minCompatibleShardNode: 'min_compatible_shard_node', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'ccs_minimize_roundtrips', 'default_operator', 'df', 'explain', 'stored_fields', 'docvalue_fields', 'from', 'ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'scroll', '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', 'request_cache', 'batched_reduce_size', 'max_concurrent_shard_requests', 'pre_filter_shard_size', 'rest_total_hits_as_int', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { analyzeWildcard: 'analyze_wildcard', ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips', 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', requestCache: 'request_cache', batchedReduceSize: 'batched_reduce_size', maxConcurrentShardRequests: 'max_concurrent_shard_requests', preFilterShardSize: 'pre_filter_shard_size', restTotalHitsAsInt: 'rest_total_hits_as_int', errorTrace: 'error_trace', filterPath: 'filter_path' }
function searchApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required url components
if (params.type != null && (params.index == null)) {
if (params['type'] != null && (params['index'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, index, type, ...querystring } = params
var { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search'

View File

@ -29,10 +29,10 @@ const snakeCase = { ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'al
function searchShardsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_search_shards'

View File

@ -30,21 +30,21 @@ function searchTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params.type != null && (params.index == null)) {
if (params['type'] != null && (params['index'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, index, type, ...querystring } = params
var { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search' + '/' + 'template'

View File

@ -23,7 +23,7 @@
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'index', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'master_timeout', 'wait_for_completion', 'storage', 'level']
const acceptedQuerystring = ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'index', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'master_timeout', 'wait_for_completion']
const snakeCase = { ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', waitForCompletion: 'wait_for_completion' }
function SearchableSnapshotsApi (transport, ConfigurationError) {
@ -34,10 +34,10 @@ function SearchableSnapshotsApi (transport, ConfigurationError) {
SearchableSnapshotsApi.prototype.clearCache = function searchableSnapshotsClearCacheApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_searchable_snapshots' + '/' + 'cache' + '/' + 'clear'
@ -61,29 +61,29 @@ SearchableSnapshotsApi.prototype.mount = function searchableSnapshotsMountApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.repository == null) {
if (params['repository'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
if (params.snapshot == null) {
if (params['snapshot'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: snapshot')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params.snapshot != null && (params.repository == null)) {
if (params['snapshot'] != null && (params['repository'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
return handleError(err, callback)
}
let { method, body, repository, snapshot, ...querystring } = params
var { method, body, repository, snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) + '/' + '_mount'
@ -102,15 +102,15 @@ SearchableSnapshotsApi.prototype.repositoryStats = function searchableSnapshotsR
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.repository == null) {
if (params['repository'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
let { method, body, repository, ...querystring } = params
var { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_stats'
@ -128,10 +128,10 @@ SearchableSnapshotsApi.prototype.repositoryStats = function searchableSnapshotsR
SearchableSnapshotsApi.prototype.stats = function searchableSnapshotsStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_searchable_snapshots' + '/' + 'stats'

View File

@ -34,10 +34,10 @@ function SecurityApi (transport, ConfigurationError) {
SecurityApi.prototype.authenticate = function securityAuthenticateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_security' + '/' + '_authenticate'
@ -56,15 +56,15 @@ SecurityApi.prototype.changePassword = function securityChangePasswordApi (param
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, username, ...querystring } = params
var { method, body, username, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((username) != null) {
if (method == null) method = 'PUT'
path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username) + '/' + '_password'
@ -88,15 +88,15 @@ SecurityApi.prototype.clearApiKeyCache = function securityClearApiKeyCacheApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.ids == null) {
if (params['ids'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: ids')
return handleError(err, callback)
}
let { method, body, ids, ...querystring } = params
var { method, body, ids, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_security' + '/' + 'api_key' + '/' + encodeURIComponent(ids) + '/' + '_clear_cache'
@ -115,15 +115,15 @@ SecurityApi.prototype.clearCachedPrivileges = function securityClearCachedPrivil
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.application == null) {
if (params['application'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: application')
return handleError(err, callback)
}
let { method, body, application, ...querystring } = params
var { method, body, application, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application) + '/' + '_clear_cache'
@ -142,15 +142,15 @@ SecurityApi.prototype.clearCachedRealms = function securityClearCachedRealmsApi
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.realms == null) {
if (params['realms'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: realms')
return handleError(err, callback)
}
let { method, body, realms, ...querystring } = params
var { method, body, realms, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_security' + '/' + 'realm' + '/' + encodeURIComponent(realms) + '/' + '_clear_cache'
@ -169,15 +169,15 @@ SecurityApi.prototype.clearCachedRoles = function securityClearCachedRolesApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name) + '/' + '_clear_cache'
@ -196,15 +196,15 @@ SecurityApi.prototype.createApiKey = function securityCreateApiKeyApi (params, o
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_security' + '/' + 'api_key'
@ -223,25 +223,25 @@ SecurityApi.prototype.deletePrivileges = function securityDeletePrivilegesApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.application == null) {
if (params['application'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: application')
return handleError(err, callback)
}
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
// check required url components
if (params.name != null && (params.application == null)) {
if (params['name'] != null && (params['application'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: application')
return handleError(err, callback)
}
let { method, body, application, name, ...querystring } = params
var { method, body, application, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application) + '/' + encodeURIComponent(name)
@ -260,15 +260,15 @@ SecurityApi.prototype.deleteRole = function securityDeleteRoleApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name)
@ -287,15 +287,15 @@ SecurityApi.prototype.deleteRoleMapping = function securityDeleteRoleMappingApi
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_security' + '/' + 'role_mapping' + '/' + encodeURIComponent(name)
@ -314,15 +314,15 @@ SecurityApi.prototype.deleteUser = function securityDeleteUserApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.username == null) {
if (params['username'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: username')
return handleError(err, callback)
}
let { method, body, username, ...querystring } = params
var { method, body, username, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username)
@ -341,15 +341,15 @@ SecurityApi.prototype.disableUser = function securityDisableUserApi (params, opt
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.username == null) {
if (params['username'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: username')
return handleError(err, callback)
}
let { method, body, username, ...querystring } = params
var { method, body, username, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username) + '/' + '_disable'
@ -368,15 +368,15 @@ SecurityApi.prototype.enableUser = function securityEnableUserApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.username == null) {
if (params['username'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: username')
return handleError(err, callback)
}
let { method, body, username, ...querystring } = params
var { method, body, username, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username) + '/' + '_enable'
@ -394,10 +394,10 @@ SecurityApi.prototype.enableUser = function securityEnableUserApi (params, optio
SecurityApi.prototype.getApiKey = function securityGetApiKeyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_security' + '/' + 'api_key'
@ -415,10 +415,10 @@ SecurityApi.prototype.getApiKey = function securityGetApiKeyApi (params, options
SecurityApi.prototype.getBuiltinPrivileges = function securityGetBuiltinPrivilegesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_security' + '/' + 'privilege' + '/' + '_builtin'
@ -437,15 +437,15 @@ SecurityApi.prototype.getPrivileges = function securityGetPrivilegesApi (params,
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required url components
if (params.name != null && (params.application == null)) {
if (params['name'] != null && (params['application'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: application')
return handleError(err, callback)
}
let { method, body, application, name, ...querystring } = params
var { method, body, application, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((application) != null && (name) != null) {
if (method == null) method = 'GET'
path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application) + '/' + encodeURIComponent(name)
@ -471,10 +471,10 @@ SecurityApi.prototype.getPrivileges = function securityGetPrivilegesApi (params,
SecurityApi.prototype.getRole = function securityGetRoleApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name)
@ -497,10 +497,10 @@ SecurityApi.prototype.getRole = function securityGetRoleApi (params, options, ca
SecurityApi.prototype.getRoleMapping = function securityGetRoleMappingApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_security' + '/' + 'role_mapping' + '/' + encodeURIComponent(name)
@ -524,15 +524,15 @@ SecurityApi.prototype.getToken = function securityGetTokenApi (params, options,
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_security' + '/' + 'oauth2' + '/' + 'token'
@ -550,10 +550,10 @@ SecurityApi.prototype.getToken = function securityGetTokenApi (params, options,
SecurityApi.prototype.getUser = function securityGetUserApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, username, ...querystring } = params
var { method, body, username, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((username) != null) {
if (method == null) method = 'GET'
path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username)
@ -576,10 +576,10 @@ SecurityApi.prototype.getUser = function securityGetUserApi (params, options, ca
SecurityApi.prototype.getUserPrivileges = function securityGetUserPrivilegesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_security' + '/' + 'user' + '/' + '_privileges'
@ -598,15 +598,15 @@ SecurityApi.prototype.grantApiKey = function securityGrantApiKeyApi (params, opt
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_security' + '/' + 'api_key' + '/' + 'grant'
@ -625,15 +625,15 @@ SecurityApi.prototype.hasPrivileges = function securityHasPrivilegesApi (params,
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, user, ...querystring } = params
var { method, body, user, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((user) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(user) + '/' + '_has_privileges'
@ -657,15 +657,15 @@ SecurityApi.prototype.invalidateApiKey = function securityInvalidateApiKeyApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_security' + '/' + 'api_key'
@ -684,15 +684,15 @@ SecurityApi.prototype.invalidateToken = function securityInvalidateTokenApi (par
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_security' + '/' + 'oauth2' + '/' + 'token'
@ -711,15 +711,15 @@ SecurityApi.prototype.putPrivileges = function securityPutPrivilegesApi (params,
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_security' + '/' + 'privilege'
@ -738,19 +738,19 @@ SecurityApi.prototype.putRole = function securityPutRoleApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name)
@ -769,19 +769,19 @@ SecurityApi.prototype.putRoleMapping = function securityPutRoleMappingApi (param
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_security' + '/' + 'role_mapping' + '/' + encodeURIComponent(name)
@ -800,19 +800,19 @@ SecurityApi.prototype.putUser = function securityPutUserApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.username == null) {
if (params['username'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: username')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, username, ...querystring } = params
var { method, body, username, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username)

View File

@ -35,15 +35,15 @@ SlmApi.prototype.deleteLifecycle = function slmDeleteLifecycleApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.policy_id == null && params.policyId == null) {
if (params['policy_id'] == null && params['policyId'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: policy_id or policyId')
return handleError(err, callback)
}
let { method, body, policyId, policy_id, ...querystring } = params
var { method, body, policyId, policy_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_slm' + '/' + 'policy' + '/' + encodeURIComponent(policy_id || policyId)
@ -62,15 +62,15 @@ SlmApi.prototype.executeLifecycle = function slmExecuteLifecycleApi (params, opt
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.policy_id == null && params.policyId == null) {
if (params['policy_id'] == null && params['policyId'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: policy_id or policyId')
return handleError(err, callback)
}
let { method, body, policyId, policy_id, ...querystring } = params
var { method, body, policyId, policy_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_slm' + '/' + 'policy' + '/' + encodeURIComponent(policy_id || policyId) + '/' + '_execute'
@ -88,10 +88,10 @@ SlmApi.prototype.executeLifecycle = function slmExecuteLifecycleApi (params, opt
SlmApi.prototype.executeRetention = function slmExecuteRetentionApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_slm' + '/' + '_execute_retention'
@ -109,10 +109,10 @@ SlmApi.prototype.executeRetention = function slmExecuteRetentionApi (params, opt
SlmApi.prototype.getLifecycle = function slmGetLifecycleApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, policyId, policy_id, ...querystring } = params
var { method, body, policyId, policy_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((policy_id || policyId) != null) {
if (method == null) method = 'GET'
path = '/' + '_slm' + '/' + 'policy' + '/' + encodeURIComponent(policy_id || policyId)
@ -135,10 +135,10 @@ SlmApi.prototype.getLifecycle = function slmGetLifecycleApi (params, options, ca
SlmApi.prototype.getStats = function slmGetStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_slm' + '/' + 'stats'
@ -156,10 +156,10 @@ SlmApi.prototype.getStats = function slmGetStatsApi (params, options, callback)
SlmApi.prototype.getStatus = function slmGetStatusApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_slm' + '/' + 'status'
@ -178,15 +178,15 @@ SlmApi.prototype.putLifecycle = function slmPutLifecycleApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.policy_id == null && params.policyId == null) {
if (params['policy_id'] == null && params['policyId'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: policy_id or policyId')
return handleError(err, callback)
}
let { method, body, policyId, policy_id, ...querystring } = params
var { method, body, policyId, policy_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_slm' + '/' + 'policy' + '/' + encodeURIComponent(policy_id || policyId)
@ -204,10 +204,10 @@ SlmApi.prototype.putLifecycle = function slmPutLifecycleApi (params, options, ca
SlmApi.prototype.start = function slmStartApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_slm' + '/' + 'start'
@ -225,10 +225,10 @@ SlmApi.prototype.start = function slmStartApi (params, options, callback) {
SlmApi.prototype.stop = function slmStopApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_slm' + '/' + 'stop'

View File

@ -35,15 +35,15 @@ SnapshotApi.prototype.cleanupRepository = function snapshotCleanupRepositoryApi
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.repository == null) {
if (params['repository'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
let { method, body, repository, ...querystring } = params
var { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_cleanup'
@ -62,36 +62,36 @@ SnapshotApi.prototype.clone = function snapshotCloneApi (params, options, callba
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.repository == null) {
if (params['repository'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
if (params.snapshot == null) {
if (params['snapshot'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: snapshot')
return handleError(err, callback)
}
if (params.target_snapshot == null && params.targetSnapshot == null) {
if (params['target_snapshot'] == null && params['targetSnapshot'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: target_snapshot or targetSnapshot')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if ((params.target_snapshot != null || params.targetSnapshot != null) && (params.snapshot == null || params.repository == null)) {
if ((params['target_snapshot'] != null || params['targetSnapshot'] != null) && (params['snapshot'] == null || params['repository'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: snapshot, repository')
return handleError(err, callback)
} else if (params.snapshot != null && (params.repository == null)) {
} else if (params['snapshot'] != null && (params['repository'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
return handleError(err, callback)
}
let { method, body, repository, snapshot, targetSnapshot, target_snapshot, ...querystring } = params
var { method, body, repository, snapshot, targetSnapshot, target_snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) + '/' + '_clone' + '/' + encodeURIComponent(target_snapshot || targetSnapshot)
@ -110,25 +110,25 @@ SnapshotApi.prototype.create = function snapshotCreateApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.repository == null) {
if (params['repository'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
if (params.snapshot == null) {
if (params['snapshot'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: snapshot')
return handleError(err, callback)
}
// check required url components
if (params.snapshot != null && (params.repository == null)) {
if (params['snapshot'] != null && (params['repository'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
return handleError(err, callback)
}
let { method, body, repository, snapshot, ...querystring } = params
var { method, body, repository, snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot)
@ -147,19 +147,19 @@ SnapshotApi.prototype.createRepository = function snapshotCreateRepositoryApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.repository == null) {
if (params['repository'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, repository, ...querystring } = params
var { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository)
@ -178,25 +178,25 @@ SnapshotApi.prototype.delete = function snapshotDeleteApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.repository == null) {
if (params['repository'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
if (params.snapshot == null) {
if (params['snapshot'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: snapshot')
return handleError(err, callback)
}
// check required url components
if (params.snapshot != null && (params.repository == null)) {
if (params['snapshot'] != null && (params['repository'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
return handleError(err, callback)
}
let { method, body, repository, snapshot, ...querystring } = params
var { method, body, repository, snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot)
@ -215,15 +215,15 @@ SnapshotApi.prototype.deleteRepository = function snapshotDeleteRepositoryApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.repository == null) {
if (params['repository'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
let { method, body, repository, ...querystring } = params
var { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository)
@ -242,25 +242,25 @@ SnapshotApi.prototype.get = function snapshotGetApi (params, options, callback)
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.repository == null) {
if (params['repository'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
if (params.snapshot == null) {
if (params['snapshot'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: snapshot')
return handleError(err, callback)
}
// check required url components
if (params.snapshot != null && (params.repository == null)) {
if (params['snapshot'] != null && (params['repository'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
return handleError(err, callback)
}
let { method, body, repository, snapshot, ...querystring } = params
var { method, body, repository, snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot)
@ -278,10 +278,10 @@ SnapshotApi.prototype.get = function snapshotGetApi (params, options, callback)
SnapshotApi.prototype.getRepository = function snapshotGetRepositoryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, repository, ...querystring } = params
var { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((repository) != null) {
if (method == null) method = 'GET'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository)
@ -305,25 +305,25 @@ SnapshotApi.prototype.restore = function snapshotRestoreApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.repository == null) {
if (params['repository'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
if (params.snapshot == null) {
if (params['snapshot'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: snapshot')
return handleError(err, callback)
}
// check required url components
if (params.snapshot != null && (params.repository == null)) {
if (params['snapshot'] != null && (params['repository'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
return handleError(err, callback)
}
let { method, body, repository, snapshot, ...querystring } = params
var { method, body, repository, snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) + '/' + '_restore'
@ -342,15 +342,15 @@ SnapshotApi.prototype.status = function snapshotStatusApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required url components
if (params.snapshot != null && (params.repository == null)) {
if (params['snapshot'] != null && (params['repository'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
return handleError(err, callback)
}
let { method, body, repository, snapshot, ...querystring } = params
var { method, body, repository, snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((repository) != null && (snapshot) != null) {
if (method == null) method = 'GET'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) + '/' + '_status'
@ -377,15 +377,15 @@ SnapshotApi.prototype.verifyRepository = function snapshotVerifyRepositoryApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.repository == null) {
if (params['repository'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
let { method, body, repository, ...querystring } = params
var { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_verify'

View File

@ -35,15 +35,15 @@ SqlApi.prototype.clearCursor = function sqlClearCursorApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_sql' + '/' + 'close'
@ -62,15 +62,15 @@ SqlApi.prototype.query = function sqlQueryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_sql'
@ -89,15 +89,15 @@ SqlApi.prototype.translate = function sqlTranslateApi (params, options, callback
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_sql' + '/' + 'translate'

View File

@ -34,10 +34,10 @@ function SslApi (transport, ConfigurationError) {
SslApi.prototype.certificates = function sslCertificatesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_ssl' + '/' + 'certificates'

View File

@ -34,10 +34,10 @@ function TasksApi (transport, ConfigurationError) {
TasksApi.prototype.cancel = function tasksCancelApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, taskId, task_id, ...querystring } = params
var { method, body, taskId, task_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((task_id || taskId) != null) {
if (method == null) method = 'POST'
path = '/' + '_tasks' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_cancel'
@ -61,15 +61,15 @@ TasksApi.prototype.get = function tasksGetApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.task_id == null && params.taskId == null) {
if (params['task_id'] == null && params['taskId'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: task_id or taskId')
return handleError(err, callback)
}
let { method, body, taskId, task_id, ...querystring } = params
var { method, body, taskId, task_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_tasks' + '/' + encodeURIComponent(task_id || taskId)
@ -87,10 +87,10 @@ TasksApi.prototype.get = function tasksGetApi (params, options, callback) {
TasksApi.prototype.list = function tasksListApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_tasks'

View File

@ -30,15 +30,15 @@ function termvectorsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, id, type, ...querystring } = params
var { method, body, index, id, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_termvectors'

View File

@ -1,65 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['lines_to_sample', 'line_merge_size_limit', 'timeout', 'charset', 'format', 'has_header_row', 'column_names', 'delimiter', 'quote', 'should_trim_fields', 'grok_pattern', 'timestamp_field', 'timestamp_format', 'explain', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { linesToSample: 'lines_to_sample', lineMergeSizeLimit: 'line_merge_size_limit', hasHeaderRow: 'has_header_row', columnNames: 'column_names', shouldTrimFields: 'should_trim_fields', grokPattern: 'grok_pattern', timestampField: 'timestamp_field', timestampFormat: 'timestamp_format', errorTrace: 'error_trace', filterPath: 'filter_path' }
function TextStructureApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
TextStructureApi.prototype.findStructure = function textStructureFindStructureApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + '_text_structure' + '/' + 'find_structure'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(TextStructureApi.prototype, {
find_structure: { get () { return this.findStructure } }
})
module.exports = TextStructureApi

View File

@ -23,8 +23,8 @@
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['force', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'from', 'size', 'allow_no_match', 'exclude_generated', 'defer_validation', 'timeout', 'wait_for_completion', 'wait_for_checkpoint']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', allowNoMatch: 'allow_no_match', excludeGenerated: 'exclude_generated', deferValidation: 'defer_validation', waitForCompletion: 'wait_for_completion', waitForCheckpoint: 'wait_for_checkpoint' }
const acceptedQuerystring = ['force', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'from', 'size', 'allow_no_match', 'defer_validation', 'timeout', 'wait_for_completion', 'wait_for_checkpoint']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', allowNoMatch: 'allow_no_match', deferValidation: 'defer_validation', waitForCompletion: 'wait_for_completion', waitForCheckpoint: 'wait_for_checkpoint' }
function TransformApi (transport, ConfigurationError) {
this.transport = transport
@ -35,15 +35,15 @@ TransformApi.prototype.deleteTransform = function transformDeleteTransformApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.transform_id == null && params.transformId == null) {
if (params['transform_id'] == null && params['transformId'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: transform_id or transformId')
return handleError(err, callback)
}
let { method, body, transformId, transform_id, ...querystring } = params
var { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId)
@ -61,10 +61,10 @@ TransformApi.prototype.deleteTransform = function transformDeleteTransformApi (p
TransformApi.prototype.getTransform = function transformGetTransformApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, transformId, transform_id, ...querystring } = params
var { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((transform_id || transformId) != null) {
if (method == null) method = 'GET'
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId)
@ -88,15 +88,15 @@ TransformApi.prototype.getTransformStats = function transformGetTransformStatsAp
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.transform_id == null && params.transformId == null) {
if (params['transform_id'] == null && params['transformId'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: transform_id or transformId')
return handleError(err, callback)
}
let { method, body, transformId, transform_id, ...querystring } = params
var { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stats'
@ -115,15 +115,15 @@ TransformApi.prototype.previewTransform = function transformPreviewTransformApi
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_transform' + '/' + '_preview'
@ -142,19 +142,19 @@ TransformApi.prototype.putTransform = function transformPutTransformApi (params,
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.transform_id == null && params.transformId == null) {
if (params['transform_id'] == null && params['transformId'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: transform_id or transformId')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, transformId, transform_id, ...querystring } = params
var { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId)
@ -173,15 +173,15 @@ TransformApi.prototype.startTransform = function transformStartTransformApi (par
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.transform_id == null && params.transformId == null) {
if (params['transform_id'] == null && params['transformId'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: transform_id or transformId')
return handleError(err, callback)
}
let { method, body, transformId, transform_id, ...querystring } = params
var { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_start'
@ -200,15 +200,15 @@ TransformApi.prototype.stopTransform = function transformStopTransformApi (param
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.transform_id == null && params.transformId == null) {
if (params['transform_id'] == null && params['transformId'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: transform_id or transformId')
return handleError(err, callback)
}
let { method, body, transformId, transform_id, ...querystring } = params
var { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stop'
@ -227,19 +227,19 @@ TransformApi.prototype.updateTransform = function transformUpdateTransformApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.transform_id == null && params.transformId == null) {
if (params['transform_id'] == null && params['transformId'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: transform_id or transformId')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, transformId, transform_id, ...querystring } = params
var { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_update'

View File

@ -30,23 +30,23 @@ function updateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body == null) {
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, id, index, type, ...querystring } = params
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_update'

View File

@ -30,21 +30,21 @@ function updateByQueryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
// check required url components
if (params.type != null && (params.index == null)) {
if (params['type'] != null && (params['index'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, index, type, ...querystring } = params
var { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_update_by_query'

View File

@ -30,19 +30,19 @@ function updateByQueryRethrottleApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.task_id == null && params.taskId == null) {
if (params['task_id'] == null && params['taskId'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: task_id or taskId')
return handleError(err, callback)
}
if (params.requests_per_second == null && params.requestsPerSecond == null) {
if (params['requests_per_second'] == null && params['requestsPerSecond'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: requests_per_second or requestsPerSecond')
return handleError(err, callback)
}
let { method, body, taskId, task_id, ...querystring } = params
var { method, body, taskId, task_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_update_by_query' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_rethrottle'

View File

@ -35,21 +35,21 @@ WatcherApi.prototype.ackWatch = function watcherAckWatchApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.watch_id == null && params.watchId == null) {
if (params['watch_id'] == null && params['watchId'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: watch_id or watchId')
return handleError(err, callback)
}
// check required url components
if ((params.action_id != null || params.actionId != null) && ((params.watch_id == null && params.watchId == null))) {
if ((params['action_id'] != null || params['actionId'] != null) && ((params['watch_id'] == null && params['watchId'] == null))) {
const err = new this[kConfigurationError]('Missing required parameter of the url: watch_id')
return handleError(err, callback)
}
let { method, body, watchId, watch_id, actionId, action_id, ...querystring } = params
var { method, body, watchId, watch_id, actionId, action_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((watch_id || watchId) != null && (action_id || actionId) != null) {
if (method == null) method = 'PUT'
path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(watch_id || watchId) + '/' + '_ack' + '/' + encodeURIComponent(action_id || actionId)
@ -73,15 +73,15 @@ WatcherApi.prototype.activateWatch = function watcherActivateWatchApi (params, o
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.watch_id == null && params.watchId == null) {
if (params['watch_id'] == null && params['watchId'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: watch_id or watchId')
return handleError(err, callback)
}
let { method, body, watchId, watch_id, ...querystring } = params
var { method, body, watchId, watch_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(watch_id || watchId) + '/' + '_activate'
@ -100,15 +100,15 @@ WatcherApi.prototype.deactivateWatch = function watcherDeactivateWatchApi (param
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.watch_id == null && params.watchId == null) {
if (params['watch_id'] == null && params['watchId'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: watch_id or watchId')
return handleError(err, callback)
}
let { method, body, watchId, watch_id, ...querystring } = params
var { method, body, watchId, watch_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(watch_id || watchId) + '/' + '_deactivate'
@ -127,15 +127,15 @@ WatcherApi.prototype.deleteWatch = function watcherDeleteWatchApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(id)
@ -153,10 +153,10 @@ WatcherApi.prototype.deleteWatch = function watcherDeleteWatchApi (params, optio
WatcherApi.prototype.executeWatch = function watcherExecuteWatchApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((id) != null) {
if (method == null) method = 'PUT'
path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(id) + '/' + '_execute'
@ -180,15 +180,15 @@ WatcherApi.prototype.getWatch = function watcherGetWatchApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(id)
@ -207,15 +207,15 @@ WatcherApi.prototype.putWatch = function watcherPutWatchApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(id)
@ -230,34 +230,13 @@ WatcherApi.prototype.putWatch = function watcherPutWatchApi (params, options, ca
return this.transport.request(request, options, callback)
}
WatcherApi.prototype.queryWatches = function watcherQueryWatchesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_watcher' + '/' + '_query' + '/' + 'watches'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
WatcherApi.prototype.start = function watcherStartApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_watcher' + '/' + '_start'
@ -275,10 +254,10 @@ WatcherApi.prototype.start = function watcherStartApi (params, options, callback
WatcherApi.prototype.stats = function watcherStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, metric, ...querystring } = params
var { method, body, metric, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if ((metric) != null) {
if (method == null) method = 'GET'
path = '/' + '_watcher' + '/' + 'stats' + '/' + encodeURIComponent(metric)
@ -301,10 +280,10 @@ WatcherApi.prototype.stats = function watcherStatsApi (params, options, callback
WatcherApi.prototype.stop = function watcherStopApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'POST'
path = '/' + '_watcher' + '/' + '_stop'
@ -326,8 +305,7 @@ Object.defineProperties(WatcherApi.prototype, {
delete_watch: { get () { return this.deleteWatch } },
execute_watch: { get () { return this.executeWatch } },
get_watch: { get () { return this.getWatch } },
put_watch: { get () { return this.putWatch } },
query_watches: { get () { return this.queryWatches } }
put_watch: { get () { return this.putWatch } }
})
module.exports = WatcherApi

View File

@ -34,10 +34,10 @@ function XpackApi (transport, ConfigurationError) {
XpackApi.prototype.info = function xpackInfoApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_xpack'
@ -55,10 +55,10 @@ XpackApi.prototype.info = function xpackInfoApi (params, options, callback) {
XpackApi.prototype.usage = function xpackUsageApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
var path = ''
if (method == null) method = 'GET'
path = '/' + '_xpack' + '/' + 'usage'

View File

@ -33,7 +33,6 @@ const deleteScriptApi = require('./api/delete_script')
const existsApi = require('./api/exists')
const existsSourceApi = require('./api/exists_source')
const explainApi = require('./api/explain')
const FeaturesApi = require('./api/features')
const fieldCapsApi = require('./api/field_caps')
const getApi = require('./api/get')
const getScriptApi = require('./api/get_script')
@ -75,7 +74,6 @@ const EqlApi = require('./api/eql')
const GraphApi = require('./api/graph')
const IlmApi = require('./api/ilm')
const LicenseApi = require('./api/license')
const LogstashApi = require('./api/logstash')
const MigrationApi = require('./api/migration')
const MlApi = require('./api/ml')
const MonitoringApi = require('./api/monitoring')
@ -86,7 +84,6 @@ const SecurityApi = require('./api/security')
const SlmApi = require('./api/slm')
const SqlApi = require('./api/sql')
const SslApi = require('./api/ssl')
const TextStructureApi = require('./api/text_structure')
const TransformApi = require('./api/transform')
const WatcherApi = require('./api/watcher')
const XpackApi = require('./api/xpack')
@ -95,7 +92,6 @@ const { kConfigurationError } = require('./utils')
const kCat = Symbol('Cat')
const kCluster = Symbol('Cluster')
const kDanglingIndices = Symbol('DanglingIndices')
const kFeatures = Symbol('Features')
const kIndices = Symbol('Indices')
const kIngest = Symbol('Ingest')
const kNodes = Symbol('Nodes')
@ -109,7 +105,6 @@ const kEql = Symbol('Eql')
const kGraph = Symbol('Graph')
const kIlm = Symbol('Ilm')
const kLicense = Symbol('License')
const kLogstash = Symbol('Logstash')
const kMigration = Symbol('Migration')
const kMl = Symbol('Ml')
const kMonitoring = Symbol('Monitoring')
@ -119,7 +114,6 @@ const kSecurity = Symbol('Security')
const kSlm = Symbol('Slm')
const kSql = Symbol('Sql')
const kSsl = Symbol('Ssl')
const kTextStructure = Symbol('TextStructure')
const kTransform = Symbol('Transform')
const kWatcher = Symbol('Watcher')
const kXpack = Symbol('Xpack')
@ -129,7 +123,6 @@ function ESAPI (opts) {
this[kCat] = null
this[kCluster] = null
this[kDanglingIndices] = null
this[kFeatures] = null
this[kIndices] = null
this[kIngest] = null
this[kNodes] = null
@ -143,7 +136,6 @@ function ESAPI (opts) {
this[kGraph] = null
this[kIlm] = null
this[kLicense] = null
this[kLogstash] = null
this[kMigration] = null
this[kMl] = null
this[kMonitoring] = null
@ -153,7 +145,6 @@ function ESAPI (opts) {
this[kSlm] = null
this[kSql] = null
this[kSsl] = null
this[kTextStructure] = null
this[kTransform] = null
this[kWatcher] = null
this[kXpack] = null
@ -231,14 +222,6 @@ Object.defineProperties(ESAPI.prototype, {
delete_by_query_rethrottle: { get () { return this.deleteByQueryRethrottle } },
delete_script: { get () { return this.deleteScript } },
exists_source: { get () { return this.existsSource } },
features: {
get () {
if (this[kFeatures] === null) {
this[kFeatures] = new FeaturesApi(this.transport, this[kConfigurationError])
}
return this[kFeatures]
}
},
field_caps: { get () { return this.fieldCaps } },
get_script: { get () { return this.getScript } },
get_script_context: { get () { return this.getScriptContext } },
@ -360,14 +343,6 @@ Object.defineProperties(ESAPI.prototype, {
return this[kLicense]
}
},
logstash: {
get () {
if (this[kLogstash] === null) {
this[kLogstash] = new LogstashApi(this.transport, this[kConfigurationError])
}
return this[kLogstash]
}
},
migration: {
get () {
if (this[kMigration] === null) {
@ -442,15 +417,6 @@ Object.defineProperties(ESAPI.prototype, {
return this[kSsl]
}
},
textStructure: {
get () {
if (this[kTextStructure] === null) {
this[kTextStructure] = new TextStructureApi(this.transport, this[kConfigurationError])
}
return this[kTextStructure]
}
},
text_structure: { get () { return this.textStructure } },
transform: {
get () {
if (this[kTransform] === null) {

21
api/kibana.d.ts vendored
View File

@ -78,12 +78,11 @@ interface KibanaClient {
asyncSearch: {
delete<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.AsyncSearchDelete, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
get<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.AsyncSearchGet, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
status<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.AsyncSearchStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
submit<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.AsyncSearchSubmit<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
}
autoscaling: {
deleteAutoscalingPolicy<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.AutoscalingDeleteAutoscalingPolicy, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getAutoscalingCapacity<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.AutoscalingGetAutoscalingCapacity, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getAutoscalingDecision<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.AutoscalingGetAutoscalingDecision, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getAutoscalingPolicy<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.AutoscalingGetAutoscalingPolicy, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
putAutoscalingPolicy<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.AutoscalingPutAutoscalingPolicy<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
}
@ -170,15 +169,11 @@ interface KibanaClient {
eql: {
delete<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.EqlDelete, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
get<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.EqlGet, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getStatus<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.EqlGetStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.EqlSearch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
}
exists<TResponse = boolean, TContext = Context>(params?: RequestParams.Exists, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
existsSource<TResponse = boolean, TContext = Context>(params?: RequestParams.ExistsSource, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
explain<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Explain<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
features: {
getFeatures<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.FeaturesGetFeatures, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
}
fieldCaps<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.FieldCaps<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
get<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.Get, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getScript<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.GetScript, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
@ -233,9 +228,7 @@ interface KibanaClient {
getSettings<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesGetSettings, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getTemplate<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesGetTemplate, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getUpgrade<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesGetUpgrade, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
migrateToDataStream<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesMigrateToDataStream, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
open<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesOpen, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
promoteDataStream<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPromoteDataStream, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
putAlias<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPutAlias<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
putIndexTemplate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPutIndexTemplate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
putMapping<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPutMapping<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
@ -275,11 +268,6 @@ interface KibanaClient {
postStartBasic<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LicensePostStartBasic, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
postStartTrial<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LicensePostStartTrial, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
}
logstash: {
deletePipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashDeletePipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getPipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashGetPipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
putPipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashPutPipeline<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
}
mget<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Mget<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
migration: {
deprecations<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MigrationDeprecations, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
@ -300,6 +288,7 @@ interface KibanaClient {
estimateModelMemory<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlEstimateModelMemory<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
evaluateDataFrame<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlEvaluateDataFrame<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
explainDataFrameAnalytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlExplainDataFrameAnalytics<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
findFileStructure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params?: RequestParams.MlFindFileStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
flushJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlFlushJob<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
forecast<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlForecast, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getBuckets<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetBuckets<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
@ -342,7 +331,6 @@ interface KibanaClient {
updateFilter<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpdateFilter<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
updateJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpdateJob<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
updateModelSnapshot<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpdateModelSnapshot<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
upgradeJobSnapshot<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpgradeJobSnapshot, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
validate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlValidate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
validateDetector<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlValidateDetector<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
}
@ -372,7 +360,6 @@ interface KibanaClient {
getRollupCaps<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.RollupGetRollupCaps, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getRollupIndexCaps<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.RollupGetRollupIndexCaps, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
putJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.RollupPutJob<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
rollup<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.RollupRollup<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
rollupSearch<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.RollupRollupSearch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
startJob<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.RollupStartJob, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
stopJob<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.RollupStopJob, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
@ -457,9 +444,6 @@ interface KibanaClient {
list<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.TasksList, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
}
termvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Termvectors<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
textStructure: {
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.TextStructureFindStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
}
transform: {
deleteTransform<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.TransformDeleteTransform, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getTransform<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.TransformGetTransform, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
@ -481,7 +465,6 @@ interface KibanaClient {
executeWatch<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherExecuteWatch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getWatch<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherGetWatch, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
putWatch<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherPutWatch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
queryWatches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherQueryWatches<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
start<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherStart, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
stats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
stop<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherStop, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>

104
api/requestParams.d.ts vendored
View File

@ -39,10 +39,6 @@ export interface AsyncSearchGet extends Generic {
typed_keys?: boolean;
}
export interface AsyncSearchStatus extends Generic {
id: string;
}
export interface AsyncSearchSubmit<T = RequestBody> extends Generic {
index?: string | string[];
_source_exclude?: string | string[];
@ -95,7 +91,7 @@ export interface AutoscalingDeleteAutoscalingPolicy extends Generic {
name: string;
}
export interface AutoscalingGetAutoscalingCapacity extends Generic {
export interface AutoscalingGetAutoscalingDecision extends Generic {
}
export interface AutoscalingGetAutoscalingPolicy extends Generic {
@ -299,7 +295,6 @@ export interface CatPlugins extends Generic {
master_timeout?: string;
h?: string | string[];
help?: boolean;
include_bootstrap?: boolean;
s?: string | string[];
v?: boolean;
}
@ -364,10 +359,10 @@ export interface CatSnapshots extends Generic {
export interface CatTasks extends Generic {
format?: string;
nodes?: string | string[];
node_id?: string | string[];
actions?: string | string[];
detailed?: boolean;
parent_task_id?: string;
parent_task?: number;
h?: string | string[];
help?: boolean;
s?: string | string[];
@ -732,10 +727,6 @@ export interface EqlGet extends Generic {
keep_alive?: string;
}
export interface EqlGetStatus extends Generic {
id: string;
}
export interface EqlSearch<T = RequestBody> extends Generic {
index: string;
wait_for_completion_timeout?: string;
@ -800,10 +791,6 @@ export interface Explain<T = RequestBody> extends Generic {
body?: T;
}
export interface FeaturesGetFeatures extends Generic {
master_timeout?: string;
}
export interface FieldCaps<T = RequestBody> extends Generic {
index?: string | string[];
fields?: string | string[];
@ -1007,7 +994,6 @@ export interface IndicesDeleteAlias extends Generic {
export interface IndicesDeleteDataStream extends Generic {
name: string | string[];
expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all';
}
export interface IndicesDeleteIndexTemplate extends Generic {
@ -1123,7 +1109,6 @@ export interface IndicesGetAlias extends Generic {
export interface IndicesGetDataStream extends Generic {
name?: string | string[];
expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all';
}
export interface IndicesGetFieldMapping extends Generic {
@ -1183,10 +1168,6 @@ export interface IndicesGetUpgrade extends Generic {
expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all';
}
export interface IndicesMigrateToDataStream extends Generic {
name: string;
}
export interface IndicesOpen extends Generic {
index: string | string[];
timeout?: string;
@ -1197,10 +1178,6 @@ export interface IndicesOpen extends Generic {
wait_for_active_shards?: string;
}
export interface IndicesPromoteDataStream extends Generic {
name: string;
}
export interface IndicesPutAlias<T = RequestBody> extends Generic {
index: string | string[];
name: string;
@ -1455,19 +1432,6 @@ export interface LicensePostStartTrial extends Generic {
acknowledge?: boolean;
}
export interface LogstashDeletePipeline extends Generic {
id: string;
}
export interface LogstashGetPipeline extends Generic {
id: string;
}
export interface LogstashPutPipeline<T = RequestBody> extends Generic {
id: string;
body: T;
}
export interface Mget<T = RequestBody> extends Generic {
index?: string;
type?: string;
@ -1568,6 +1532,24 @@ export interface MlExplainDataFrameAnalytics<T = RequestBody> extends Generic {
body?: T;
}
export interface MlFindFileStructure<T = RequestNDBody> extends Generic {
lines_to_sample?: number;
line_merge_size_limit?: number;
timeout?: string;
charset?: string;
format?: 'ndjson' | 'xml' | 'delimited' | 'semi_structured_text';
has_header_row?: boolean;
column_names?: string | string[];
delimiter?: string;
quote?: string;
should_trim_fields?: boolean;
grok_pattern?: string;
timestamp_field?: string;
timestamp_format?: string;
explain?: boolean;
body: T;
}
export interface MlFlushJob<T = RequestBody> extends Generic {
job_id: string;
calc_interim?: boolean;
@ -1630,7 +1612,6 @@ export interface MlGetDataFrameAnalytics extends Generic {
allow_no_match?: boolean;
from?: number;
size?: number;
exclude_generated?: boolean;
}
export interface MlGetDataFrameAnalyticsStats extends Generic {
@ -1651,7 +1632,6 @@ export interface MlGetDatafeeds extends Generic {
datafeed_id?: string;
allow_no_match?: boolean;
allow_no_datafeeds?: boolean;
exclude_generated?: boolean;
}
export interface MlGetFilters extends Generic {
@ -1683,7 +1663,6 @@ export interface MlGetJobs extends Generic {
job_id?: string;
allow_no_match?: boolean;
allow_no_jobs?: boolean;
exclude_generated?: boolean;
}
export interface MlGetModelSnapshots<T = RequestBody> extends Generic {
@ -1733,7 +1712,7 @@ export interface MlGetTrainedModels extends Generic {
from?: number;
size?: number;
tags?: string | string[];
exclude_generated?: boolean;
for_export?: boolean;
}
export interface MlGetTrainedModelsStats extends Generic {
@ -1878,13 +1857,6 @@ export interface MlUpdateModelSnapshot<T = RequestBody> extends Generic {
body: T;
}
export interface MlUpgradeJobSnapshot extends Generic {
job_id: string;
snapshot_id: string;
timeout?: string;
wait_for_completion?: boolean;
}
export interface MlValidate<T = RequestBody> extends Generic {
body: T;
}
@ -2058,12 +2030,6 @@ export interface RollupPutJob<T = RequestBody> extends Generic {
body: T;
}
export interface RollupRollup<T = RequestBody> extends Generic {
index: string;
rollup_index: string;
body: T;
}
export interface RollupRollupSearch<T = RequestBody> extends Generic {
index: string | string[];
type?: string;
@ -2140,7 +2106,6 @@ export interface Search<T = RequestBody> extends Generic {
max_concurrent_shard_requests?: number;
pre_filter_shard_size?: number;
rest_total_hits_as_int?: boolean;
min_compatible_shard_node?: string;
body?: T;
}
@ -2185,7 +2150,6 @@ export interface SearchableSnapshotsMount<T = RequestBody> extends Generic {
snapshot: string;
master_timeout?: string;
wait_for_completion?: boolean;
storage?: string;
body: T;
}
@ -2195,7 +2159,6 @@ export interface SearchableSnapshotsRepositoryStats extends Generic {
export interface SearchableSnapshotsStats extends Generic {
index?: string | string[];
level?: 'cluster' | 'indices' | 'shards';
}
export interface SecurityAuthenticate extends Generic {
@ -2503,24 +2466,6 @@ export interface Termvectors<T = RequestBody> extends Generic {
body?: T;
}
export interface TextStructureFindStructure<T = RequestBody> extends Generic {
lines_to_sample?: number;
line_merge_size_limit?: number;
timeout?: string;
charset?: string;
format?: 'ndjson' | 'xml' | 'delimited' | 'semi_structured_text';
has_header_row?: boolean;
column_names?: string | string[];
delimiter?: string;
quote?: string;
should_trim_fields?: boolean;
grok_pattern?: string;
timestamp_field?: string;
timestamp_format?: string;
explain?: boolean;
body: T;
}
export interface TransformDeleteTransform extends Generic {
transform_id: string;
force?: boolean;
@ -2531,7 +2476,6 @@ export interface TransformGetTransform extends Generic {
from?: number;
size?: number;
allow_no_match?: boolean;
exclude_generated?: boolean;
}
export interface TransformGetTransformStats extends Generic {
@ -2676,10 +2620,6 @@ export interface WatcherPutWatch<T = RequestBody> extends Generic {
body?: T;
}
export interface WatcherQueryWatches<T = RequestBody> extends Generic {
body?: T;
}
export interface WatcherStart extends Generic {
}

View File

@ -31,10 +31,10 @@ function handleError (err, callback) {
}
function snakeCaseKeys (acceptedQuerystring, snakeCase, querystring) {
const target = {}
const keys = Object.keys(querystring)
for (let i = 0, len = keys.length; i < len; i++) {
const key = keys[i]
var target = {}
var keys = Object.keys(querystring)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
target[snakeCase[key] || key] = querystring[key]
}
return target

View File

@ -1,120 +0,0 @@
[[advanced-config]]
=== Advanced configuration
If you need to customize the client behavior heavily, you are in the right
place! The client enables you to customize the following internals:
* `Transport` class
* `ConnectionPool` class
* `Connection` class
* `Serializer` class
[discrete]
==== `Transport`
This class is responsible for performing the request to {es} and handling
errors, it also handles the sniffing.
[source,js]
----
const { Client, Transport } = require('@elastic/elasticsearch')
class MyTransport extends Transport {
request (params, options, callback) {
// your code
}
}
const client = new Client({
Transport: MyTransport
})
----
Sometimes you need to inject a small snippet of your code and then continue to
use the usual client code. In such cases, call `super.method`:
[source,js]
----
class MyTransport extends Transport {
request (params, options, callback) {
// your code
return super.request(params, options, callback)
}
}
----
[discrete]
==== `ConnectionPool`
This class is responsible for keeping in memory all the {es} Connection that you
are using. There is a single Connection for every node. The connection pool
handles the resurrection strategies and the updates of the pool.
[source,js]
----
const { Client, ConnectionPool } = require('@elastic/elasticsearch')
class MyConnectionPool extends ConnectionPool {
markAlive (connection) {
// your code
super.markAlive(connection)
}
}
const client = new Client({
ConnectionPool: MyConnectionPool
})
----
[discrete]
==== `Connection`
This class represents a single node, it holds every information we have on the
node, such as roles, id, URL, custom headers and so on. The actual HTTP request
is performed here, this means that if you want to swap the default HTTP client
(Node.js core), you should override the `request` method of this class.
[source,js]
----
const { Client, Connection } = require('@elastic/elasticsearch')
class MyConnection extends Connection {
request (params, callback) {
// your code
}
}
const client = new Client({
Connection: MyConnection
})
----
[discrete]
==== `Serializer`
This class is responsible for the serialization of every request, it offers the
following methods:
* `serialize(object: any): string;` serializes request objects.
* `deserialize(json: string): any;` deserializes response strings.
* `ndserialize(array: any[]): string;` serializes bulk request objects.
* `qserialize(object: any): string;` serializes request query parameters.
[source,js]
----
const { Client, Serializer } = require('@elastic/elasticsearch')
class MySerializer extends Serializer {
serialize (object) {
// your code
}
}
const client = new Client({
Serializer: MySerializer
})
----

View File

@ -1,247 +0,0 @@
[[basic-config]]
=== Basic configuration
This page shows you the possible basic configuration options that the clients
offers.
[source,js]
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: 'http://localhost:9200',
maxRetries: 5,
requestTimeout: 60000,
sniffOnStart: true
})
----
[cols=2*]
|===
|`node` or `nodes`
a|The Elasticsearch endpoint to use. +
It can be a single string or an array of strings:
[source,js]
----
node: 'http://localhost:9200'
----
Or it can be an object (or an array of objects) that represents the node:
[source,js]
----
node: {
url: new URL('http://localhost:9200'),
ssl: 'ssl options',
agent: 'http agent options',
id: 'custom node id',
headers: { 'custom': 'headers' }
roles: {
master: true,
data: true,
ingest: true,
ml: false
}
}
----
|`auth`
a|Your authentication data. You can use both basic authentication and
{ref}/security-api-create-api-key.html[ApiKey]. +
See https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/auth-reference.html[Authentication]
for more details. +
_Default:_ `null`
Basic authentication:
[source,js]
----
auth: {
username: 'elastic',
password: 'changeme'
}
----
{ref}/security-api-create-api-key.html[ApiKey] authentication:
[source,js]
----
auth: {
apiKey: 'base64EncodedKey'
}
----
|`maxRetries`
|`number` - Max number of retries for each request. +
_Default:_ `3`
|`requestTimeout`
|`number` - Max request timeout in milliseconds for each request. +
_Default:_ `30000`
|`pingTimeout`
|`number` - Max ping request timeout in milliseconds for each request. +
_Default:_ `3000`
|`sniffInterval`
|`number, boolean` - Perform a sniff operation every `n` milliseconds. Sniffing might not be the best solution for you, take a look https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how[here] to know more. +
_Default:_ `false`
|`sniffOnStart`
|`boolean` - Perform a sniff once the client is started. Sniffing might not be the best solution for you, take a look https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how[here] to know more. +
_Default:_ `false`
|`sniffEndpoint`
|`string` - Endpoint to ping during a sniff. +
_Default:_ `'_nodes/_all/http'`
|`sniffOnConnectionFault`
|`boolean` - Perform a sniff on connection fault. Sniffing might not be the best solution for you, take a look https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how[here] to know more. +
_Default:_ `false`
|`resurrectStrategy`
|`string` - Configure the node resurrection strategy. +
_Options:_ `'ping'`, `'optimistic'`, `'none'` +
_Default:_ `'ping'`
|`suggestCompression`
|`boolean` - Adds `accept-encoding` header to every request. +
_Default:_ `false`
|`compression`
|`string, boolean` - Enables gzip request body compression. +
_Options:_ `'gzip'`, `false` +
_Default:_ `false`
|`ssl`
|`http.SecureContextOptions` - ssl https://nodejs.org/api/tls.html[configuraton]. +
_Default:_ `null`
|`proxy`
a|`string, URL` - If you are using an http(s) proxy, you can put its url here.
The client will automatically handle the connection to it. +
_Default:_ `null`
[source,js]
----
const client = new Client({
node: 'http://localhost:9200',
proxy: 'http://localhost:8080'
})
// Proxy with basic authentication
const client = new Client({
node: 'http://localhost:9200',
proxy: 'http://user:pwd@localhost:8080'
})
----
|`agent`
a|`http.AgentOptions, function` - http agent https://nodejs.org/api/http.html#http_new_agent_options[options],
or a function that returns an actual http agent instance. If you want to disable the http agent use entirely
(and disable the `keep-alive` feature), set the agent to `false`. +
_Default:_ `null`
[source,js]
----
const client = new Client({
node: 'http://localhost:9200',
agent: { agent: 'options' }
})
const client = new Client({
node: 'http://localhost:9200',
// the function takes as parameter the option
// object passed to the Connection constructor
agent: (opts) => new CustomAgent()
})
const client = new Client({
node: 'http://localhost:9200',
// Disable agent and keep-alive
agent: false
})
----
|`nodeFilter`
a|`function` - Filters which node not to use for a request. +
_Default:_
[source,js]
----
function defaultNodeFilter (node) {
// avoid master only nodes
if (node.roles.master === true &&
node.roles.data === false &&
node.roles.ingest === false) {
return false
}
return true
}
----
|`nodeSelector`
a|`function` - custom selection strategy. +
_Options:_ `'round-robin'`, `'random'`, custom function +
_Default:_ `'round-robin'` +
_Custom function example:_
[source,js]
----
function nodeSelector (connections) {
const index = calculateIndex()
return connections[index]
}
----
|`generateRequestId`
a|`function` - function to generate the request id for every request, it takes
two parameters, the request parameters and options. +
By default it generates an incremental integer for every request. +
_Custom function example:_
[source,js]
----
function generateRequestId (params, options) {
// your id generation logic
// must be syncronous
return 'id'
}
----
|`name`
|`string, symbol` - 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:_ `{}`
|`context`
|`object` - A custom object that you can use for observability in your events.
It will be merged with the API level context option. +
_Default:_ `null`
|`enableMetaHeader`
|`boolean` - If true, adds an header named `'x-elastic-client-meta'`, containing some minimal telemetry data,
such as the client and platform version. +
_Default:_ `true`
|`cloud`
a|`object` - Custom configuration for connecting to
https://cloud.elastic.co[Elastic Cloud]. See https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/auth-reference.html[Authentication]
for more details. +
_Default:_ `null` +
_Cloud configuration example:_
[source,js]
----
const client = new Client({
cloud: {
id: 'name:bG9jYWxob3N0JGFiY2QkZWZnaA=='
},
auth: {
username: 'elastic',
password: 'changeme'
}
})
----
|===

View File

@ -1,128 +1,10 @@
[[changelog-client]]
== Changelog
[discrete]
=== 7.11.0
[discrete]
==== Features
[discrete]
===== Support for Elasticsearch `v7.11`.
You can find all the API changes https://www.elastic.co/guide/en/elasticsearch/reference/7.11/release-notes-7.11.0.html[here].
[discrete]
===== Added new observability events https://github.com/elastic/elasticsearch-js/pull/1365[#1365]
Two new observability events has been introduced: `serialization` and `deserialization`.
The event order is described in the following graph, in some edge cases, the order is not guaranteed.
You can find in https://github.com/elastic/elasticsearch-js/blob/master/test/acceptance/events-order.test.js[`test/acceptance/events-order.test.js`]
how the order changes based on the situation.
----
serialization
│ (serialization and compression happens between those two events)
└─▶ request
│ (actual time spent over the wire)
└─▶ deserialization
│ (deserialization and decompression happens between those two events)
└─▶ response
----
[discrete]
===== Added x-elastic-client-meta header https://github.com/elastic/elasticsearch-js/pull/1373[#1373]
Adds the `x-elastic-client-meta` HTTP header which is used by Elastic Cloud
and can be disabled with the `enableMetaHeader` parameter set to `false`.
[discrete]
==== Fixes
[discrete]
===== Fixes req.abort() with a body that is a stream calls callback(err) twice https://github.com/elastic/elasticsearch-js/pull/1376[#1376]
When using a body that is a stream to client.search(), and calling req.abort(), the callback is called twice.
Once for the RequestAbortedError, as expected, and once for a "premature close" error from end-of-stream, used by pump, used by the client.
This issue has now been fixed.
[discrete]
=== 7.10.0
[discrete]
==== Features
[discrete]
===== Support for Elasticsearch `v7.10`.
You can find all the API changes https://www.elastic.co/guide/en/elasticsearch/reference/7.10/release-notes-7.10.0.html[here].
[discrete]
===== Added proxy support https://github.com/elastic/elasticsearch-js/pull/1260[#1260]
If you need to pass through an http(s) proxy for connecting to Elasticsearch, the client offers
out of the box a handy configuration for helping you with it. Under the hood it
uses the https://github.com/delvedor/hpagent[`hpagent`] module.
[source,js]
----
const client = new Client({
node: 'http://localhost:9200',
proxy: 'http://localhost:8080'
})
----
Basic authentication is supported as well:
[source,js]
----
const client = new Client({
node: 'http://localhost:9200',
proxy: 'http://user:pwd@localhost:8080'
})
----
[discrete]
==== Fixes
[discrete]
===== Scroll search should clear the scroll at the end https://github.com/elastic/elasticsearch-js/pull/1331[#1331]
From now on the scroll search helper will automatically close the scroll on Elasticsearch,
by doing so, Elasticsearch will free resources faster.
[discrete]
===== Handle connectivity issues while reading the body https://github.com/elastic/elasticsearch-js/pull/1343[#1343]
It might happen that the underlying socket stops working due to an external cause while reading the body.
This could lead to an unwanted `DeserialzationError`. From now, this will be handled as a generic `ConnectionError`.
[discrete]
==== Warnings
[discrete]
===== Add warning log about nodejs version support https://github.com/elastic/elasticsearch-js/pull/1349[#1349]
`7.11` will be the last version of the client that will support Node.js v8, while `7.12` will be
the last one that supports Node.js v10. If you are eusing this versions you will see a
`DeprecationWaring` in your logs. We strongly recommend to upgrade to newer versions of Node.js
as usng an EOL version will expose you to securty risks.
Please refer to https://ela.st/nodejs-support[ela.st/nodejs-support] for additional information.
[discrete]
=== 7.9.1
[discrete]
==== Fixes
[discrete]
===== Improve child performances https://github.com/elastic/elasticsearch-js/pull/1314[#1314]
The client code has been refactored to speed up the performances of the child method.
@ -133,35 +15,29 @@ This change should not cause any breaking change unless you were mocking the cli
Finally, this change should also fix once and of all the bundlers support.
[discrete]
===== Throw all errors asynchronously https://github.com/elastic/elasticsearch-js/pull/1295[#1295]
Some validation errors were thrown synchronously, causing the callback to be called in th same tick.
This issue is known as _"The release fo Zalgo"_ (see https://blog.izs.me/2013/08/designing-apis-for-asynchrony[here]).
[discrete]
===== Fix `maxRetries` request option handling https://github.com/elastic/elasticsearch-js/pull/1296[#1296]
The `maxRetries` parameter can be configured on a per requets basis, if set to zero it was defaulting to the client default. Now the client is honoring the request specific configuration.
[discrete]
===== Fix RequestOptions.body type to include null https://github.com/elastic/elasticsearch-js/pull/1300[#1300]
The Connection requets option types were not accepting `null` as valid value.
[discrete]
===== Fixed `size` and `maxRetries` parameters in helpers https://github.com/elastic/elasticsearch-js/pull/1284[#1284]
The `size` parameter was being passed too the scroll request, which was causing an error.
`maxRetries` setted to 0 was resulting in no request at all.
[discrete]
=== 7.9.0
[discrete]
==== Features
[discrete]
===== Add ability to disable the http agent https://github.com/elastic/elasticsearch-js/pull/1251[#1251]
If needed, the http agent can be disabled by setting it to `false`
@ -175,7 +51,6 @@ const client = new Client({
})
----
[discrete]
===== Add support for a global context option https://github.com/elastic/elasticsearch-js/pull/1256[#1256]
Before this, you could set a `context` option in each request, but there was no way of setting it globally.
@ -190,7 +65,6 @@ const client = new Client({
})
----
[discrete]
===== ESM support https://github.com/elastic/elasticsearch-js/pull/1235[#1235]
If you are using ES Modules, now you can easily import the client!
@ -200,10 +74,8 @@ If you are using ES Modules, now you can easily import the client!
import { Client } from '@elastic/elasticsearch'
----
[discrete]
==== Fixes
[discrete]
===== Allow the client name to be a symbol https://github.com/elastic/elasticsearch-js/pull/1254[#1254]
It was possible in plain JavaScript, but not in TypeScript, now you can do it in TypeScript as well.
@ -217,18 +89,15 @@ const client = new Client({
})
----
[discrete]
===== Fixed transport.request querystring type https://github.com/elastic/elasticsearch-js/pull/1240[#1240]
Only `Record<string, any>` was allowed. Now `string` is allowed as well.
[discrete]
===== Fixed type definitions https://github.com/elastic/elasticsearch-js/pull/1263[#1263]
* The `transport.request` defintion was incorrect, it was returning a `Promise<T>` instead of `TransportRequestPromise<T>`.
* The `refresh` parameter of most APIs was declared as `'true' | 'false' | 'wait_for'`, which was clunky. Now is `'wait_for' | boolean`.
[discrete]
===== Generate response type as boolean if the request is HEAD only https://github.com/elastic/elasticsearch-js/pull/1275[#1275]
All HEAD request will have the body casted to a boolean value, `true` in case of a 200 response, `false` in case of
@ -245,17 +114,14 @@ const { body } = await client.exist({ index: 'my-index', id: 'my-id' })
console.log(body) // either `true` or `false`
----
[discrete]
==== Internals
[discrete]
===== Updated default http agent configuration https://github.com/elastic/elasticsearch-js/pull/1242[#1242]
Added the scheduling: 'lifo' option to the default HTTP agent configuration to avoid maximizing the open sockets
against Elasticsearch and lowering the risk of encountering socket timeouts.
This feature is only available from Node v14.5+, but it should be backported to v10 and v12. (https://github.com/nodejs/node/pull/33278[nodejs/node#33278])
[discrete]
===== Improve child API https://github.com/elastic/elasticsearch-js/pull/1245[#1245]
This pr introduce two changes which should not impact the surface API:
@ -265,18 +131,14 @@ and improves the child creation performances by ~12%.
* The client no longer inherits from the EventEmitter class, but instead has an internal event emitter and exposes
only the API useful for the users, namely `emit, `on`, `once`, and `off`. The type definitions have been updated accordingly.
[discrete]
=== 7.8.0
[discrete]
==== Features
[discrete]
===== Support for Elasticsearch `v7.8`.
You can find all the API changes https://www.elastic.co/guide/en/elasticsearch/reference/7.8/release-notes-7.8.0.html[here].
[discrete]
===== Added multi search helper https://github.com/elastic/elasticsearch-js/pull/1186[#1186]
If you are sending search request at a high rate, this helper might be useful for you.
@ -309,7 +171,6 @@ m.search(
)
----
[discrete]
===== Added timeout support in bulk and msearch helpers https://github.com/elastic/elasticsearch-js/pull/1206[#1206]
If there is a slow producer, the bulk helper might send data with a very large period of time, and if the process crashes for any reason, the data would be lost.
@ -331,48 +192,38 @@ const m = client.helpers.msearch({
})
----
[discrete]
==== Internals
[discrete]
===== Use filter_path for improving the search helpers performances https://github.com/elastic/elasticsearch-js/pull/1199[#1199]
From now on, all he search helpers will use the `filter_path` option automatically when needed to retrieve only the hits source. This change will result in less netwprk traffic and improved deserialization performances.
[discrete]
===== Search helpers documents getter https://github.com/elastic/elasticsearch-js/pull/1186[#1186]
Before this, the `documents` key that you can access in any search helper was computed as soon as we got the search result from Elasticsearch. With this change the `documents` key is now a getter, which makes this procees lazy, resulting in better performances and lower memory impact.
[discrete]
=== 7.7.1
[discrete]
==== Fixes
[discrete]
===== Disable client Helpers in Node.js < 10 - https://github.com/elastic/elasticsearch-js/pull/1194[#1194]
The client helpers can't be used in Node.js < 10 because it needs a custom flag to be able to use them.
Given that not every provider allows the user to specify cuatom Node.js flags, the Helpers has been disabled completely in Node.js < 10.
[discrete]
===== Force lowercase in all headers - https://github.com/elastic/elasticsearch-js/pull/1187[#1187]
Now all the user-provided headers names will be lowercased by default, so there will be no conflicts in case of the same header with different casing.
[discrete]
=== 7.7.0
[discrete]
==== Features
[discrete]
===== Support for Elasticsearch `v7.7`.
You can find all the API changes https://www.elastic.co/guide/en/elasticsearch/reference/7.7/release-notes-7.7.0.html[here].
[discrete]
===== Introduced client helpers - https://github.com/elastic/elasticsearch-js/pull/1107[#1107]
From now on, the client comes with an handy collection of helpers to give you a more comfortable experience with some APIs.
@ -386,13 +237,11 @@ The following helpers has been introduced:
- `client.helpers.scrollSearch`
- `client.helpers.scrollDocuments`
[discrete]
===== The `ConnectionPool.getConnection` now always returns a `Connection` - https://github.com/elastic/elasticsearch-js/pull/1127[#1127]
What does this mean? It means that you will see less `NoLivingConnectionError`, which now can only be caused if you set a selector/filter too strict.
For improving the debugging experience, the `NoLivingConnectionsError` error message has been updated.
[discrete]
===== Abortable promises - https://github.com/elastic/elasticsearch-js/pull/1141[#1141]
From now on, it will be possible to abort a request generated with the promise-styl API. If you abort a request generated from a promise, the promise will be rejected with a `RequestAbortedError`.
@ -413,7 +262,6 @@ promise
promise.abort()
----
[discrete]
===== Major refactor of the Type Definitions - https://github.com/elastic/elasticsearch-js/pull/1119[#1119] https://github.com/elastic/elasticsearch-js/issues/1130[#1130] https://github.com/elastic/elasticsearch-js/pull/1132[#1132]
Now every API makes better use of the generics and overloading, so you can (or not, by default request/response bodies are `Record<string, any>`) define the request/response bodies in the generics.
@ -429,31 +277,25 @@ client.search<SearchResponse, SearchBody>(...)
This *should* not be a breaking change, as every generics defaults to `any`. It might happen to some users that the code breaks, but our test didn't detect any of it, probably because they were not robust enough. However, given the gigantic improvement in the developer experience, we have decided to release this change in the 7.x line.
[discrete]
==== Fixes
[discrete]
===== The `ConnectionPool.update` method now cleans the `dead` list - https://github.com/elastic/elasticsearch-js/issues/1122[#1122] https://github.com/elastic/elasticsearch-js/pull/1127[#1127]
It can happen in a situation where we are updating the connections list and running sniff, leaving the `dead` list in a dirty state. Now the `ConnectionPool.update` cleans up the `dead` list every time, which makes way more sense given that all the new connections are alive.
[discrete]
===== `ConnectionPoolmarkDead` should ignore connections that no longer exists - https://github.com/elastic/elasticsearch-js/pull/1159[#1159]
It might happen that markDead is called just after a pool update, and in such case, the clint was adding the dead list a node that no longer exists, causing unhandled exceptions later.
[discrete]
===== Do not retry a request if the body is a stream - https://github.com/elastic/elasticsearch-js/pull/1143[#1143]
The client should not retry if it's sending a stream body, because it should store in memory a copy of the stream to be able to send it again, but since it doesn't know in advance the size of the stream, it risks to take too much memory.
Furthermore, copying everytime the stream is very an expensive operation.
[discrete]
===== Return an error if the request has been aborted - https://github.com/elastic/elasticsearch-js/pull/1141[#1141]
Until now, aborting a request was blocking the HTTP request, but never calling the callback or resolving the promise to notify the user. This is a bug because it could lead to dangerous memory leaks. From now on if the user calls the `request.abort()` method, the callback style API will be called with a `RequestAbortedError`, the promise will be rejected with `RequestAbortedError` as well.
[discrete]
=== 7.6.1
**Fixes:**
@ -465,12 +307,10 @@ Until now, aborting a request was blocking the HTTP request, but never calling t
- Fix typo in api reference - https://github.com/elastic/elasticsearch-js/pull/1109[#1109]
[discrete]
=== 7.6.0
Support for Elasticsearch `v7.6`.
[discrete]
=== 7.5.1
**Fixes:**
@ -486,7 +326,6 @@ Support for Elasticsearch `v7.6`.
- Add examples to reference - https://github.com/elastic/elasticsearch-js/pull/1076[#1076]
- Added new examples - https://github.com/elastic/elasticsearch-js/pull/1031[#1031]
[discrete]
=== 7.5.0
Support for Elasticsearch `v7.5`.
@ -495,7 +334,6 @@ Support for Elasticsearch `v7.5`.
- X-Opaque-Id support https://github.com/elastic/elasticsearch-js/pull/997[#997]
[discrete]
=== 7.4.0
Support for Elasticsearch `v7.4`.
@ -513,7 +351,6 @@ Support for Elasticsearch `v7.4`.
- Update code generation https://github.com/elastic/elasticsearch-js/pull/969[#969]
[discrete]
=== 7.3.0
Support for Elasticsearch `v7.3`.
@ -536,7 +373,6 @@ Support for Elasticsearch `v7.3`.
- Better reference code examples - https://github.com/elastic/elasticsearch-js/pull/920[#920]
- Improve README - https://github.com/elastic/elasticsearch-js/pull/909[#909]
[discrete]
=== 7.2.0
Support for Elasticsearch `v7.2`
@ -545,7 +381,6 @@ Support for Elasticsearch `v7.2`
- Remove auth data from inspect and toJSON in connection class - https://github.com/elastic/elasticsearch-js/pull/887[#887]
[discrete]
=== 7.1.0
Support for Elasticsearch `v7.1`
@ -555,7 +390,6 @@ Support for Elasticsearch `v7.1`
- Support for non-friendly chars in url username and password - https://github.com/elastic/elasticsearch-js/pull/858[#858]
- Patch deprecated parameters - https://github.com/elastic/elasticsearch-js/pull/851[#851]
[discrete]
=== 7.0.1
**Fixes:**
@ -565,9 +399,8 @@ Support for Elasticsearch `v7.1`
- Fix TypeScript definiton *(issue https://github.com/elastic/elasticsearch-js/pull/803[#803])* - https://github.com/elastic/elasticsearch-js/pull/846[#846]
- Added toJSON method to Connection class *(issue https://github.com/elastic/elasticsearch-js/pull/848[#848])* - https://github.com/elastic/elasticsearch-js/pull/849[#849]
[discrete]
=== 7.0.0
Support for Elasticsearch `v7.0`
- Stable release.
- Stable release.

View File

@ -1,5 +1,5 @@
[[child]]
=== Creating a child client
[[child-client]]
== Creating a child client
There are some use cases where you may need multiple instances of the client.
You can easily do that by calling `new Client()` as many times as you need, but

View File

@ -1,11 +1,366 @@
[[client-configuration]]
== Configuration
== Client configuration
The client is designed to be easily configured for your needs. In the following
section, you can see the possible options that you can use to configure it.
section, you can see the possible basic options that you can use to configure
it.
* <<basic-config>>
* <<advanced-config>>
* <<child>>
* <<extend>>
[source,js]
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: 'http://localhost:9200',
maxRetries: 5,
requestTimeout: 60000,
sniffOnStart: true
})
----
[discrete]
=== Basic options
[cols=2*]
|===
|`node` or `nodes`
a|The Elasticsearch endpoint to use. +
It can be a single string or an array of strings:
[source,js]
----
node: 'http://localhost:9200'
----
Or it can be an object (or an array of objects) that represents the node:
[source,js]
----
node: {
url: new URL('http://localhost:9200'),
ssl: 'ssl options',
agent: 'http agent options',
id: 'custom node id',
headers: { 'custom': 'headers' }
roles: {
master: true,
data: true,
ingest: true,
ml: false
}
}
----
|`auth`
a|Your authentication data. You can use both basic authentication and
{ref}/security-api-create-api-key.html[ApiKey]. +
See https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/auth-reference.html[Authentication]
for more details. +
_Default:_ `null`
Basic authentication:
[source,js]
----
auth: {
username: 'elastic',
password: 'changeme'
}
----
{ref}/security-api-create-api-key.html[ApiKey] authentication:
[source,js]
----
auth: {
apiKey: 'base64EncodedKey'
}
----
|`maxRetries`
|`number` - Max number of retries for each request. +
_Default:_ `3`
|`requestTimeout`
|`number` - Max request timeout in milliseconds for each request. +
_Default:_ `30000`
|`pingTimeout`
|`number` - Max ping request timeout in milliseconds for each request. +
_Default:_ `3000`
|`sniffInterval`
|`number, boolean` - Perform a sniff operation every `n` milliseconds. Sniffing might not be the best solution for you, take a look https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how[here] to know more. +
_Default:_ `false`
|`sniffOnStart`
|`boolean` - Perform a sniff once the client is started. Sniffing might not be the best solution for you, take a look https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how[here] to know more. +
_Default:_ `false`
|`sniffEndpoint`
|`string` - Endpoint to ping during a sniff. +
_Default:_ `'_nodes/_all/http'`
|`sniffOnConnectionFault`
|`boolean` - Perform a sniff on connection fault. Sniffing might not be the best solution for you, take a look https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how[here] to know more. +
_Default:_ `false`
|`resurrectStrategy`
|`string` - Configure the node resurrection strategy. +
_Options:_ `'ping'`, `'optimistic'`, `'none'` +
_Default:_ `'ping'`
|`suggestCompression`
|`boolean` - Adds `accept-encoding` header to every request. +
_Default:_ `false`
|`compression`
|`string, boolean` - Enables gzip request body compression. +
_Options:_ `'gzip'`, `false` +
_Default:_ `false`
|`ssl`
|`http.SecureContextOptions` - ssl https://nodejs.org/api/tls.html[configuraton]. +
_Default:_ `null`
|`proxy`
a|`string, URL` - If you are using an http(s) proxy, you can put its url here.
The client will automatically handle the connection to it. +
_Default:_ `null`
[source,js]
----
const client = new Client({
node: 'http://localhost:9200',
proxy: 'http://localhost:8080'
})
// Proxy with basic authentication
const client = new Client({
node: 'http://localhost:9200',
proxy: 'http://user:pwd@localhost:8080'
})
----
|`agent`
a|`http.AgentOptions, function` - http agent https://nodejs.org/api/http.html#http_new_agent_options[options],
or a function that returns an actual http agent instance. If you want to disable the http agent use entirely
(and disable the `keep-alive` feature), set the agent to `false`. +
_Default:_ `null`
[source,js]
----
const client = new Client({
node: 'http://localhost:9200',
agent: { agent: 'options' }
})
const client = new Client({
node: 'http://localhost:9200',
// the function takes as parameter the option
// object passed to the Connection constructor
agent: (opts) => new CustomAgent()
})
const client = new Client({
node: 'http://localhost:9200',
// Disable agent and keep-alive
agent: false
})
----
|`nodeFilter`
a|`function` - Filters which node not to use for a request. +
_Default:_
[source,js]
----
function defaultNodeFilter (node) {
// avoid master only nodes
if (node.roles.master === true &&
node.roles.data === false &&
node.roles.ingest === false) {
return false
}
return true
}
----
|`nodeSelector`
a|`function` - custom selection strategy. +
_Options:_ `'round-robin'`, `'random'`, custom function +
_Default:_ `'round-robin'` +
_Custom function example:_
[source,js]
----
function nodeSelector (connections) {
const index = calculateIndex()
return connections[index]
}
----
|`generateRequestId`
a|`function` - function to generate the request id for every request, it takes
two parameters, the request parameters and options. +
By default it generates an incremental integer for every request. +
_Custom function example:_
[source,js]
----
function generateRequestId (params, options) {
// your id generation logic
// must be syncronous
return 'id'
}
----
|`name`
|`string, symbol` - 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:_ `{}`
|`context`
|`object` - A custom object that you can use for observability in yoru events.
It will be merged with the API level context option. +
_Default:_ `null`
|`cloud`
a|`object` - Custom configuration for connecting to
https://cloud.elastic.co[Elastic Cloud]. See https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/auth-reference.html[Authentication]
for more details. +
_Default:_ `null` +
_Cloud configuration example:_
[source,js]
----
const client = new Client({
cloud: {
id: 'name:bG9jYWxob3N0JGFiY2QkZWZnaA=='
},
auth: {
username: 'elastic',
password: 'changeme'
}
})
----
|===
[discrete]
=== Advanced configuration
If you need to customize the client behavior heavily, you are in the right
place! The client allows you to customize the following internals:
* `Transport` class
* `ConnectionPool` class
* `Connection` class
* `Serializer` class
[discrete]
=== `Transport`
This class is responsible for performing the request to {es} and handling
errors, it also handles the sniffing.
[source,js]
----
const { Client, Transport } = require('@elastic/elasticsearch')
class MyTransport extends Transport {
request (params, options, callback) {
// your code
}
}
const client = new Client({
Transport: MyTransport
})
----
Sometimes you need to inject a small snippet of your code and then continue to
use the usual client code. In such cases, call `super.method`:
[source,js]
----
class MyTransport extends Transport {
request (params, options, callback) {
// your code
return super.request(params, options, callback)
}
}
----
[discrete]
=== `ConnectionPool`
This class is responsible for keeping in memory all the {es} Connection that we
are using. There is a single Connection for every node. The connection pool
handles the resurrection strategies and the updates of the pool.
[source,js]
----
const { Client, ConnectionPool } = require('@elastic/elasticsearch')
class MyConnectionPool extends ConnectionPool {
markAlive (connection) {
// your code
super.markAlive(connection)
}
}
const client = new Client({
ConnectionPool: MyConnectionPool
})
----
[discrete]
=== `Connection`
This class represents a single node, it holds every information we have on the
node, such as roles, id, URL, custom headers and so on. The actual HTTP request
is performed here, this means that if you want to swap the default HTTP client
(Node.js core), you should override the `request` method of this class.
[source,js]
----
const { Client, Connection } = require('@elastic/elasticsearch')
class MyConnection extends Connection {
request (params, callback) {
// your code
}
}
const client = new Client({
Connection: MyConnection
})
----
[discrete]
=== `Serializer`
This class is responsible for the serialization of every request, it offers the
following methods:
* `serialize(object: any): string;` serializes request objects.
* `deserialize(json: string): any;` deserializes response strings.
* `ndserialize(array: any[]): string;` serializes bulk request objects.
* `qserialize(object: any): string;` serializes request query parameters.
[source,js]
----
const { Client, Serializer } = require('@elastic/elasticsearch')
class MySerializer extends Serializer {
serialize (object) {
// your code
}
}
const client = new Client({
Serializer: MySerializer
})
----

View File

@ -57,7 +57,7 @@ async function run () {
})
// stream async iteration, available in Node.js ≥ 10
let payload = ''
var payload = ''
body.setEncoding('utf8')
for await (const chunk of body) {
payload += chunk
@ -65,7 +65,7 @@ async function run () {
console.log(JSON.parse(payload))
// classic stream callback style
let payload = ''
var payload = ''
body.setEncoding('utf8')
body.on('data', chunk => { payload += chunk })
body.on('error', console.log)
@ -101,4 +101,4 @@ fastify.post('/search/:index', async (req, reply) => {
})
fastify.listen(3000)
----
----

View File

@ -38,7 +38,7 @@ async function run () {
date: new Date()
}, {
id: 2,
text: 'Winter is coming',
text: 'Witer is coming',
user: 'ned',
date: new Date()
}, {

View File

@ -1,51 +0,0 @@
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# coverage output
coverage.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules
jspm_packages
# Optional npm cache directory
.npm
# Optional REPL history
.node_repl_history
# mac files
.DS_Store
# vim swap files
*.swp
#Jetbrains editor folder
.idea
.vercel

View File

@ -1,65 +0,0 @@
# Elasticsearch proxy example
This folder contains an example of how to build a lightweight proxy
between your frontend code and Elasticsearch if you don't
have a more sophisticated backend in place yet.
> **IMPORTANT:** This is not a production ready code and it is only for demonstration purposes,
> we make no guarantees on it's security and stability.
This project is designed to be deployed on [Vercel](https://vercel.com/), a cloud platform
for static sites and Serverless Functions. You can use other functions providers,
such as [Google Cloud functions](https://cloud.google.com/functions).
## Project structure
The project comes with four endpoints:
- `/api/search`: runs a search, requires `'read'` permission
- `/api/autocomplete`: runs an autocomplete suggestion, requires `'read'` permission
- `/api/index`: indexes or updates a document, requires `'write'` permission
- `/api/delete`: deletes a document, requires `'write'` permission
Inside `utils/authorize.js` you can find the authorization logic for the endpoints.
In each endpoint you should configure the `INDEX` variable.
## How to use
Create an account on Vercel, then create a deployment on Elastic Cloud. If you
don't have an account on Elastic Cloud, you can create one with a free 14-day trial
of the [Elasticsearch Service](https://www.elastic.co/elasticsearch/service).
### Configure Elasticsearch
Once you have created a deployment on Elastic Cloud copy the generated Cloud Id and the credentials.
Then open `utils/prepare-elasticsearch.js` and fill your credentials. The script generates
an [Api Key](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html)
that you can use for authenticating your request. Based on the configuration of the Api Key, you will be able
to perform different operation on the specified indices or index pattern.
### Configure Vercel
Install the [Vercel CLI](https://vercel.com/docs/cli) to bootstrap the project,
or read the [quickstart](https://vercel.com/docs) documentation.
If you are using the CLI, bootstrap the project by running `vercel`. Test the project locally
with `vercel dev`, and deploy it with `vercel deploy`.
Configure the `ELASTIC_CLOUD_ID` [environment varible](https://vercel.com/docs/environment-variables) as well.
The Api Key is passed from the frontend app via a `Authorization` header as `Bearer` token and is
used to authorize the API calls to the endpoints as well.
Additional configuration, such as CORS, can be added to [`vercel.json`](https://vercel.com/docs/configuration).
## Authentication
If you are using Elasticsearch only for search purposes, such as a search box, you can create
an Api Key with `read` permissions and store it in your frontend app. Then you can send it
via `Authorization` header to the proxy and run your searches.
If you need to ingest data as well, it's more secure to have a strong authentication in your application.
For such cases, use an external authentication service, such as [Auth0](https://auth0.com/)
or [Magic Link](https://magic.link/). Then create a different Api Key with `read` and `write`
permissions for authenticated users, that will not be stored in the frontend app.
## License
This software is licensed under the [Apache 2 license](../../LICENSE).

View File

@ -1,105 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// IMPORTANT: this is not a production ready code & purely for demonstration purposes,
// we make no guarantees on it's security and stability
// NOTE: to make this endpoint work, you should create an ApiKey with 'read' permissions
'use strict'
const { Client } = require('@elastic/elasticsearch')
const authorize = require('../utils/authorize')
const INDEX = '<index-name>'
const client = new Client({
cloud: {
id: process.env.ELASTIC_CLOUD_ID
}
})
module.exports = async (req, res) => {
const [err, token] = authorize(req)
if (err) {
res.status(401)
res.json(err)
return
}
if (typeof req.query.q !== 'string') {
res.status(400)
res.json({
error: 'Bad Request',
message: 'Missing parameter "query.q"',
statusCode: 400
})
return
}
if (req.query.q.length < 3) {
res.status(400)
res.json({
error: 'Bad Request',
message: 'The length of "query.q" should be at least 3',
statusCode: 400
})
return
}
try {
const response = await client.search({
index: INDEX,
// You could directly send from the browser
// the Elasticsearch's query DSL, but it will
// expose you to the risk that a malicious user
// could overload your cluster by crafting
// expensive queries.
body: {
_source: ['id', 'url', 'name'], // the fields you want to show in the autocompletion
size: 0,
// https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters-completion.html
suggest: {
suggestions: {
prefix: req.query.q,
completion: {
field: 'suggest',
size: 5
}
}
}
}
}, {
headers: {
Authorization: `ApiKey ${token}`
}
})
// It might be useful to configure http control caching headers
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
// res.setHeader('stale-while-revalidate', '30')
res.json(response.body)
} catch (err) {
res.status(err.statusCode || 500)
res.json({
error: err.name,
message: err.message,
statusCode: err.statusCode || 500
})
}
}

View File

@ -1,74 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// IMPORTANT: this is not a production ready code & purely for demonstration purposes,
// we make no guarantees on it's security and stability
// NOTE: to make this endpoint work, you should create an ApiKey with 'write' permissions
'use strict'
const { Client } = require('@elastic/elasticsearch')
const authorize = require('../utils/authorize')
const INDEX = '<index-name>'
const client = new Client({
cloud: {
id: process.env.ELASTIC_CLOUD_ID
}
})
module.exports = async (req, res) => {
const [err, token] = authorize(req)
if (err) {
res.status(401)
res.json(err)
return
}
if (typeof req.query.id !== 'string' && req.query.id.length === 0) {
res.status(400)
res.json({
error: 'Bad Request',
message: 'Missing document id',
statusCode: 400
})
return
}
try {
const response = await client.delete({
index: INDEX,
id: req.query.id
}, {
headers: {
Authorization: `ApiKey ${token}`
}
})
res.json(response.body)
} catch (err) {
res.status(err.statusCode || 500)
res.json({
error: err.name,
message: err.message,
statusCode: err.statusCode || 500
})
}
}

View File

@ -1,76 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// IMPORTANT: this is not a production ready code & purely for demonstration purposes,
// we make no guarantees on it's security and stability
// NOTE: to make this endpoint work, you should create an ApiKey with 'write' permissions
'use strict'
const { Client } = require('@elastic/elasticsearch')
const authorize = require('../utils/authorize')
const INDEX = '<index-name>'
const client = new Client({
cloud: {
id: process.env.ELASTIC_CLOUD_ID
}
})
module.exports = async (req, res) => {
const [err, token] = authorize(req)
if (err) {
res.status(401)
res.json(err)
return
}
if (typeof req.body !== 'object') {
res.status(400)
res.json({
error: 'Bad Request',
message: 'The document should be an object',
statusCode: 400
})
return
}
try {
const response = await client.index({
index: INDEX,
id: req.query.id,
body: req.body
}, {
headers: {
Authorization: `ApiKey ${token}`
}
})
res.status(response.statusCode)
res.json(response.body)
} catch (err) {
res.status(err.statusCode || 500)
res.json({
error: err.name,
message: err.message,
statusCode: err.statusCode || 500
})
}
}

View File

@ -1,86 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// IMPORTANT: this is not a production ready code & purely for demonstration purposes,
// we make no guarantees on it's security and stability
// NOTE: to make this endpoint work, you should create an ApiKey with 'read' permissions
'use strict'
const { Client } = require('@elastic/elasticsearch')
const authorize = require('../utils/authorize')
const INDEX = '<index-name>'
const client = new Client({
cloud: {
id: process.env.ELASTIC_CLOUD_ID
}
})
module.exports = async (req, res) => {
const [err, token] = authorize(req)
if (err) {
res.status(401)
res.json(err)
return
}
if (typeof req.body.text !== 'string') {
res.status(400)
res.json({
error: 'Bad Request',
message: 'Missing parameter "body.text"',
statusCode: 400
})
return
}
try {
const response = await client.search({
index: INDEX,
// You could directly send from the browser
// the Elasticsearch's query DSL, but it will
// expose you to the risk that a malicious user
// could overload your cluster by crafting
// expensive queries.
body: {
query: {
match: { field: req.body.text }
}
}
}, {
headers: {
Authorization: `ApiKey ${token}`
}
})
// It might be useful to configure http control caching headers
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
// res.setHeader('stale-while-revalidate', '30')
res.json(response.body)
} catch (err) {
res.status(err.statusCode || 500)
res.json({
error: err.name,
message: err.message,
statusCode: err.statusCode || 500
})
}
}

View File

@ -1,19 +0,0 @@
{
"name": "proxy-example",
"version": "1.0.0",
"private": true,
"description": "",
"main": "index.js",
"scripts": {
"test": "standard"
},
"keywords": [],
"author": "Tomas Della Vedova",
"license": "Apache-2.0",
"dependencies": {
"@elastic/elasticsearch": "^7.10.0"
},
"devDependencies": {
"standard": "^16.0.3"
}
}

View File

@ -1,54 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// IMPORTANT: this is not a production ready code & purely for demonstration purposes,
// we make no guarantees on it's security and stability
'use strict'
module.exports = (req) => {
const auth = req.headers.authorization
if (typeof auth !== 'string') {
return [{
error: 'Unauthorized',
message: 'Missing authorization header',
statusCode: 401
}, null]
}
const [type, token] = req.headers.authorization.split(' ')
if (type !== 'Bearer') {
return [{
error: 'Unauthorized',
message: 'Bad authorization type',
statusCode: 401
}, null]
}
if (token.length === 0) {
return [{
error: 'Unauthorized',
message: 'Bad authorization token',
statusCode: 401
}, null]
}
return [null, token]
}

View File

@ -1,68 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
const { Client } = require('@elastic/elasticsearch')
// Your Cloud Id
const cloudId = ''
// Your admin username
const username = ''
// Your admin password
const password = ''
// The indices or index patterns you will need to access
const indexNames = ['my-index-name-or-pattern']
// see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-privileges.html#privileges-list-indices
const privileges = ['read']
async function generateApiKeys (opts) {
const client = new Client({
cloud: {
id: cloudId
},
auth: {
username,
password
}
})
const { body } = await client.security.createApiKey({
body: {
name: 'elasticsearch-proxy',
role_descriptors: {
'elasticsearch-proxy-users': {
index: [{
names: indexNames,
privileges
}]
}
}
}
})
return Buffer.from(`${body.id}:${body.api_key}`).toString('base64')
}
generateApiKeys()
.then(console.log)
.catch(err => {
console.error(err)
process.exit(1)
})

View File

@ -1,13 +0,0 @@
{
"headers": [
{
"source": "/api/(.*)",
"headers": [
{ "key": "Access-Control-Allow-Credentials", "value": "true" },
{ "key": "Access-Control-Allow-Origin", "value": "*" },
{ "key": "Access-Control-Allow-Methods", "value": "GET,OPTIONS,PATCH,DELETE,POST,PUT" },
{ "key": "Access-Control-Allow-Headers", "value": "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version" }
]
}
]
}

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