Compare commits

..

23 Commits

Author SHA1 Message Date
c8aae67cd6 Integration test: Fix yaml parser and crash on failure (#1423)
* Fix yaml parser and crash on failure

* Log response in case of ResponseError

* Updated cleanup

* Updated skip list

* Updated skip list

* Updated skip list
2021-03-24 07:54:49 +01:00
886289e3f5 API generation 2021-03-23 18:36:34 +01:00
111da7e529 API generation 2021-03-22 11:54:16 +01:00
d615692b9f fix(TransportRequestPromise): add finally method to TransportRequestP… (#1415)
* fix(TransportRequestPromise): add finally method to TransportRequestPromise interface

* fix(TransportRequestPromise): add finally method to transportReturn object

* fix(TransportRequestPromise): add finally method tests
2021-03-22 11:53:17 +01:00
ace70aea08 Fix test bundler (#1417) (#1418)
* Updated .gitignore

* Fix parcel build

* Updated .gitignore

Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
2021-03-22 11:53:07 +01:00
7b21f92ceb API generation 2021-02-19 08:32:33 +01:00
d506222d02 Remove linter ignore configuration 2021-02-19 08:30:35 +01:00
6c2d4acac6 Remove Node.js v8 support (#1402) 2021-02-19 08:30:33 +01:00
496b2bb6d1 Updated ci configuration 2021-02-18 16:42:14 +01:00
f38db62ab3 Bumped v7.12.0-canary.3 2021-02-18 16:37:52 +01:00
5a25b7cba2 [helpers] add support for transport options to all helpers (#1400)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-02-18 16:36:22 +01:00
e1d7134398 Bumped v7.12.0-canary.2 2021-02-17 09:59:47 +01:00
31b4d41dc5 API generation 2021-02-17 09:58:01 +01:00
252bab6476 API generation 2021-02-11 08:26:02 +01:00
88b787bf38 Changelog for 7.11 (#1401) 2021-02-11 08:24:05 +01:00
f4f7c733d1 API generation 2021-02-09 09:57:02 +01:00
20b7e93475 Fix CI (#1399) 2021-02-09 08:16:54 +01:00
176d823593 Added Elasticsearch proxy example (#1398)
Co-authored-by: István Zoltán Szabó <istvan.szabo@elastic.co>
2021-02-09 08:15:07 +01:00
7448cd3d24 Updated CI conf 2021-02-09 08:15:07 +01:00
eeacdffd45 [7.x][DOCS] Adds Configuration section to Node.JS docs (#1396) 2021-02-01 15:43:27 +01:00
5eab7e9c75 [Backport 7.x] Prereleases in meta header should be displayed as p (#1390)
Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
2021-01-19 08:11:57 +01:00
2be23c0946 API generation 2021-01-18 17:19:22 +01:00
86660ddf4f Added script for releasing canary package (#1338) 2020-12-17 17:35:00 +01:00
136 changed files with 2654 additions and 1866 deletions

View File

@ -1,12 +1,11 @@
---
STACK_VERSION:
- 7.11.0-SNAPSHOT
- 7.12.0-SNAPSHOT
NODE_JS_VERSION:
- 14
- 12
- 10
- 8
TEST_SUITE:
- free

View File

@ -40,31 +40,6 @@ 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
@ -86,7 +61,7 @@ jobs:
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.11.0-SNAPSHOT
stack-version: 7.12.0-SNAPSHOT
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1

1
.gitignore vendored
View File

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

View File

@ -70,3 +70,7 @@ 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 `v8`.
NOTE: The minimum supported version of Node.js is `v10`.
The client versioning follows the Elastc Stack versioning, this means that
major, minor, and patch releases are done following a precise schedule that

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)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_async_search' + '/' + encodeURIComponent(id)
@ -89,15 +89,15 @@ AsyncSearchApi.prototype.status = function asyncSearchStatusApi (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)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_async_search' + '/' + 'status' + '/' + encodeURIComponent(id)
@ -115,10 +115,10 @@ AsyncSearchApi.prototype.status = function asyncSearchStatusApi (params, options
AsyncSearchApi.prototype.submit = function asyncSearchSubmitApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name)
@ -61,10 +61,10 @@ AutoscalingApi.prototype.deleteAutoscalingPolicy = function autoscalingDeleteAut
AutoscalingApi.prototype.getAutoscalingCapacity = function autoscalingGetAutoscalingCapacityApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_autoscaling' + '/' + 'capacity'
@ -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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name)

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)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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', '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', 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', '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' }
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)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, nodeId, node_id, ...querystring } = params
let { method, body, nodeId, node_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, fields, ...querystring } = params
let { method, body, fields, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, repository, ...querystring } = params
let { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, threadPoolPatterns, thread_pool_patterns, ...querystring } = params
let { method, body, threadPoolPatterns, thread_pool_patterns, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, datafeedId, datafeed_id, ...querystring } = params
let { method, body, datafeedId, datafeed_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, jobId, job_id, ...querystring } = params
let { method, body, jobId, job_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, modelId, model_id, ...querystring } = params
let { method, body, modelId, model_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, transformId, transform_id, ...querystring } = params
let { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, scrollId, scroll_id, ...querystring } = params
let { method, body, scrollId, scroll_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, metric, index, ...querystring } = params
let { method, body, metric, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, nodeId, node_id, ...querystring } = params
let { method, body, nodeId, node_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, index, type, ...querystring } = params
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, indexUuid, index_uuid, ...querystring } = params
let { method, body, indexUuid, index_uuid, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, indexUuid, index_uuid, ...querystring } = params
let { method, body, indexUuid, index_uuid, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, index, type, ...querystring } = params
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, taskId, task_id, ...querystring } = params
let { method, body, taskId, task_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_eql' + '/' + 'search' + '/' + encodeURIComponent(id)
@ -85,23 +85,50 @@ 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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_eql' + '/' + 'search'
@ -116,4 +143,8 @@ 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)
}
var { method, body, id, index, type, ...querystring } = params
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, index, type, ...querystring } = params
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, index, type, ...querystring } = params
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain'

59
api/api/features.js Normal file
View File

@ -0,0 +1,59 @@
/*
* 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)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, index, type, ...querystring } = params
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, index, type, ...querystring } = params
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, policy, ...querystring } = params
let { method, body, policy, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, policy, ...querystring } = params
let { method, body, policy, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, policy, ...querystring } = params
let { method, body, policy, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, index, type, ...querystring } = params
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)

View File

@ -35,25 +35,25 @@ IndicesApi.prototype.addBlock = function indicesAddBlockApi (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)
}
if (params['block'] == null) {
if (params.block == null) {
const err = new this[kConfigurationError]('Missing required parameter: block')
return handleError(err, callback)
}
// check required url components
if (params['block'] != null && (params['index'] == null)) {
if (params.block != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, block, ...querystring } = params
let { method, body, index, block, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_block' + '/' + encodeURIComponent(block)
@ -71,10 +71,10 @@ IndicesApi.prototype.addBlock = function indicesAddBlockApi (params, options, ca
IndicesApi.prototype.analyze = function indicesAnalyzeApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_analyze'
@ -97,10 +97,10 @@ IndicesApi.prototype.analyze = function indicesAnalyzeApi (params, options, call
IndicesApi.prototype.clearCache = function indicesClearCacheApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_cache' + '/' + 'clear'
@ -124,25 +124,25 @@ IndicesApi.prototype.clone = function indicesCloneApi (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['target'] == null) {
if (params.target == null) {
const err = new this[kConfigurationError]('Missing required parameter: target')
return handleError(err, callback)
}
// check required url components
if (params['target'] != null && (params['index'] == null)) {
if (params.target != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, target, ...querystring } = params
let { method, body, index, target, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_clone' + '/' + encodeURIComponent(target)
@ -161,15 +161,15 @@ IndicesApi.prototype.close = function indicesCloseApi (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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_close'
@ -188,15 +188,15 @@ IndicesApi.prototype.create = function indicesCreateApi (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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index)
@ -215,15 +215,15 @@ IndicesApi.prototype.delete = function indicesDeleteApi (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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + encodeURIComponent(index)
@ -242,25 +242,25 @@ IndicesApi.prototype.deleteAlias = function indicesDeleteAliasApi (params, optio
;[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['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['index'] == null)) {
if (params.name != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, name, ...querystring } = params
let { method, body, index, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (name) != null) {
if (method == null) method = 'DELETE'
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
@ -284,15 +284,15 @@ IndicesApi.prototype.deleteIndexTemplate = function indicesDeleteIndexTemplateAp
;[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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_index_template' + '/' + encodeURIComponent(name)
@ -311,15 +311,15 @@ IndicesApi.prototype.deleteTemplate = function indicesDeleteTemplateApi (params,
;[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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_template' + '/' + encodeURIComponent(name)
@ -338,15 +338,15 @@ IndicesApi.prototype.exists = function indicesExistsApi (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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index)
@ -365,15 +365,15 @@ IndicesApi.prototype.existsAlias = function indicesExistsAliasApi (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)
}
var { method, body, name, index, ...querystring } = params
let { method, body, name, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (name) != null) {
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
@ -397,15 +397,15 @@ IndicesApi.prototype.existsIndexTemplate = function indicesExistsIndexTemplateAp
;[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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'HEAD'
path = '/' + '_index_template' + '/' + encodeURIComponent(name)
@ -424,15 +424,15 @@ IndicesApi.prototype.existsTemplate = function indicesExistsTemplateApi (params,
;[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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'HEAD'
path = '/' + '_template' + '/' + encodeURIComponent(name)
@ -451,25 +451,25 @@ IndicesApi.prototype.existsType = function indicesExistsTypeApi (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['type'] == null) {
if (params.type == null) {
const err = new this[kConfigurationError]('Missing required parameter: type')
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)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type)
@ -487,10 +487,10 @@ IndicesApi.prototype.existsType = function indicesExistsTypeApi (params, options
IndicesApi.prototype.flush = function indicesFlushApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_flush'
@ -513,10 +513,10 @@ IndicesApi.prototype.flush = function indicesFlushApi (params, options, callback
IndicesApi.prototype.flushSynced = function indicesFlushSyncedApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_flush' + '/' + 'synced'
@ -534,10 +534,10 @@ IndicesApi.prototype.flushSynced = function indicesFlushSyncedApi (params, optio
IndicesApi.prototype.forcemerge = function indicesForcemergeApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_forcemerge'
@ -561,15 +561,15 @@ IndicesApi.prototype.get = function indicesGetApi (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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index)
@ -587,10 +587,10 @@ IndicesApi.prototype.get = function indicesGetApi (params, options, callback) {
IndicesApi.prototype.getAlias = function indicesGetAliasApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, index, ...querystring } = params
let { method, body, name, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (name) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
@ -620,15 +620,15 @@ IndicesApi.prototype.getFieldMapping = function indicesGetFieldMappingApi (param
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['fields'] == null) {
if (params.fields == null) {
const err = new this[kConfigurationError]('Missing required parameter: fields')
return handleError(err, callback)
}
var { method, body, fields, index, type, ...querystring } = params
let { method, body, fields, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null && (fields) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields)
@ -657,10 +657,10 @@ IndicesApi.prototype.getFieldMapping = function indicesGetFieldMappingApi (param
IndicesApi.prototype.getIndexTemplate = function indicesGetIndexTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_index_template' + '/' + encodeURIComponent(name)
@ -683,10 +683,10 @@ IndicesApi.prototype.getIndexTemplate = function indicesGetIndexTemplateApi (par
IndicesApi.prototype.getMapping = function indicesGetMappingApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type)
@ -715,10 +715,10 @@ IndicesApi.prototype.getMapping = function indicesGetMappingApi (params, options
IndicesApi.prototype.getSettings = function indicesGetSettingsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, name, ...querystring } = params
let { method, body, index, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (name) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_settings' + '/' + encodeURIComponent(name)
@ -747,10 +747,10 @@ IndicesApi.prototype.getSettings = function indicesGetSettingsApi (params, optio
IndicesApi.prototype.getTemplate = function indicesGetTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_template' + '/' + encodeURIComponent(name)
@ -773,10 +773,10 @@ IndicesApi.prototype.getTemplate = function indicesGetTemplateApi (params, optio
IndicesApi.prototype.getUpgrade = function indicesGetUpgradeApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_upgrade'
@ -795,15 +795,15 @@ IndicesApi.prototype.open = function indicesOpenApi (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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_open'
@ -822,25 +822,25 @@ IndicesApi.prototype.putAlias = function indicesPutAliasApi (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)
}
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['index'] == null)) {
if (params.name != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, name, ...querystring } = params
let { method, body, index, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (name) != null) {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
@ -864,19 +864,19 @@ IndicesApi.prototype.putIndexTemplate = function indicesPutIndexTemplateApi (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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_index_template' + '/' + encodeURIComponent(name)
@ -895,15 +895,15 @@ IndicesApi.prototype.putMapping = function indicesPutMappingApi (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)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mapping'
@ -945,15 +945,15 @@ IndicesApi.prototype.putSettings = function indicesPutSettingsApi (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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_settings'
@ -977,19 +977,19 @@ IndicesApi.prototype.putTemplate = function indicesPutTemplateApi (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)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_template' + '/' + encodeURIComponent(name)
@ -1007,10 +1007,10 @@ IndicesApi.prototype.putTemplate = function indicesPutTemplateApi (params, optio
IndicesApi.prototype.recovery = function indicesRecoveryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_recovery'
@ -1033,10 +1033,10 @@ IndicesApi.prototype.recovery = function indicesRecoveryApi (params, options, ca
IndicesApi.prototype.refresh = function indicesRefreshApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_refresh'
@ -1060,15 +1060,15 @@ IndicesApi.prototype.resolveIndex = function indicesResolveIndexApi (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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_resolve' + '/' + 'index' + '/' + encodeURIComponent(name)
@ -1087,21 +1087,21 @@ IndicesApi.prototype.rollover = function indicesRolloverApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['alias'] == null) {
if (params.alias == null) {
const err = new this[kConfigurationError]('Missing required parameter: alias')
return handleError(err, callback)
}
// check required url components
if ((params['new_index'] != null || params['newIndex'] != null) && (params['alias'] == null)) {
if ((params.new_index != null || params.newIndex != null) && (params.alias == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: alias')
return handleError(err, callback)
}
var { method, body, alias, newIndex, new_index, ...querystring } = params
let { method, body, alias, newIndex, new_index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((alias) != null && (new_index || newIndex) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(alias) + '/' + '_rollover' + '/' + encodeURIComponent(new_index || newIndex)
@ -1124,10 +1124,10 @@ IndicesApi.prototype.rollover = function indicesRolloverApi (params, options, ca
IndicesApi.prototype.segments = function indicesSegmentsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_segments'
@ -1150,10 +1150,10 @@ IndicesApi.prototype.segments = function indicesSegmentsApi (params, options, ca
IndicesApi.prototype.shardStores = function indicesShardStoresApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_shard_stores'
@ -1177,25 +1177,25 @@ IndicesApi.prototype.shrink = function indicesShrinkApi (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)
}
if (params['target'] == null) {
if (params.target == null) {
const err = new this[kConfigurationError]('Missing required parameter: target')
return handleError(err, callback)
}
// check required url components
if (params['target'] != null && (params['index'] == null)) {
if (params.target != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, target, ...querystring } = params
let { method, body, index, target, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_shrink' + '/' + encodeURIComponent(target)
@ -1214,15 +1214,15 @@ IndicesApi.prototype.simulateIndexTemplate = function indicesSimulateIndexTempla
;[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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_index_template' + '/' + '_simulate_index' + '/' + encodeURIComponent(name)
@ -1240,10 +1240,10 @@ IndicesApi.prototype.simulateIndexTemplate = function indicesSimulateIndexTempla
IndicesApi.prototype.simulateTemplate = function indicesSimulateTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((name) != null) {
if (method == null) method = 'POST'
path = '/' + '_index_template' + '/' + '_simulate' + '/' + encodeURIComponent(name)
@ -1267,25 +1267,25 @@ IndicesApi.prototype.split = function indicesSplitApi (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['target'] == null) {
if (params.target == null) {
const err = new this[kConfigurationError]('Missing required parameter: target')
return handleError(err, callback)
}
// check required url components
if (params['target'] != null && (params['index'] == null)) {
if (params.target != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, target, ...querystring } = params
let { method, body, index, target, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_split' + '/' + encodeURIComponent(target)
@ -1303,10 +1303,10 @@ IndicesApi.prototype.split = function indicesSplitApi (params, options, callback
IndicesApi.prototype.stats = function indicesStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, metric, index, ...querystring } = params
let { method, body, metric, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (metric) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_stats' + '/' + encodeURIComponent(metric)
@ -1336,15 +1336,15 @@ IndicesApi.prototype.updateAliases = function indicesUpdateAliasesApi (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)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_aliases'
@ -1362,10 +1362,10 @@ IndicesApi.prototype.updateAliases = function indicesUpdateAliasesApi (params, o
IndicesApi.prototype.upgrade = function indicesUpgradeApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_upgrade'
@ -1384,15 +1384,15 @@ IndicesApi.prototype.validateQuery = function indicesValidateQueryApi (params, o
;[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)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_validate' + '/' + 'query'
@ -1419,15 +1419,15 @@ IndicesApi.prototype.createDataStream = function indicesCreateDataStreamApi (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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_data_stream' + '/' + encodeURIComponent(name)
@ -1445,10 +1445,10 @@ IndicesApi.prototype.createDataStream = function indicesCreateDataStreamApi (par
IndicesApi.prototype.dataStreamsStats = function indicesDataStreamsStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_data_stream' + '/' + encodeURIComponent(name) + '/' + '_stats'
@ -1472,15 +1472,15 @@ IndicesApi.prototype.deleteDataStream = function indicesDeleteDataStreamApi (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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_data_stream' + '/' + encodeURIComponent(name)
@ -1499,15 +1499,15 @@ IndicesApi.prototype.freeze = function indicesFreezeApi (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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_freeze'
@ -1525,10 +1525,10 @@ IndicesApi.prototype.freeze = function indicesFreezeApi (params, options, callba
IndicesApi.prototype.getDataStream = function indicesGetDataStreamApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_data_stream' + '/' + encodeURIComponent(name)
@ -1552,15 +1552,15 @@ IndicesApi.prototype.migrateToDataStream = function indicesMigrateToDataStreamAp
;[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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_data_stream' + '/' + '_migrate' + '/' + encodeURIComponent(name)
@ -1579,15 +1579,15 @@ IndicesApi.prototype.promoteDataStream = function indicesPromoteDataStreamApi (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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_data_stream' + '/' + '_promote' + '/' + encodeURIComponent(name)
@ -1606,15 +1606,15 @@ IndicesApi.prototype.reloadSearchAnalyzers = function indicesReloadSearchAnalyze
;[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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_reload_search_analyzers'
@ -1633,15 +1633,15 @@ IndicesApi.prototype.unfreeze = function indicesUnfreezeApi (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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_unfreeze'

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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_license' + '/' + 'start_trial'

125
api/api/logstash.js Normal file
View File

@ -0,0 +1,125 @@
/*
* 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)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, type, ...querystring } = params
let { method, body, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, nodeId, node_id, ...querystring } = params
let { method, body, nodeId, node_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, nodeId, node_id, metric, ...querystring } = params
let { method, body, nodeId, node_id, metric, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, nodeId, node_id, ...querystring } = params
let { method, body, nodeId, node_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, nodeId, node_id, metric, indexMetric, index_metric, ...querystring } = params
let { method, body, nodeId, node_id, metric, indexMetric, index_metric, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, nodeId, node_id, metric, ...querystring } = params
let { method, body, nodeId, node_id, metric, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, context, ...querystring } = params
let { method, body, id, context, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, taskId, task_id, ...querystring } = params
let { method, body, taskId, task_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
@ -172,29 +172,29 @@ RollupApi.prototype.rollup = function rollupRollupApi (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['rollup_index'] == null && params['rollupIndex'] == null) {
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) {
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)) {
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)
}
var { method, body, index, rollupIndex, rollup_index, ...querystring } = params
let { method, body, index, rollupIndex, rollup_index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_rollup' + '/' + encodeURIComponent(rollup_index || rollupIndex)
@ -213,25 +213,25 @@ RollupApi.prototype.rollupSearch = function rollupRollupSearchApi (params, optio
;[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)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_rollup_search'
@ -255,15 +255,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)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id) + '/' + '_start'
@ -282,15 +282,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)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, scrollId, scroll_id, ...querystring } = params
let { method, body, scrollId, scroll_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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', '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' }
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' }
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)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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']
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 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)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, repository, snapshot, ...querystring } = params
let { method, body, repository, snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, repository, ...querystring } = params
let { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, username, ...querystring } = params
let { method, body, username, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, ids, ...querystring } = params
let { method, body, ids, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, application, ...querystring } = params
let { method, body, application, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, realms, ...querystring } = params
let { method, body, realms, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, application, name, ...querystring } = params
let { method, body, application, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, username, ...querystring } = params
let { method, body, username, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, username, ...querystring } = params
let { method, body, username, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, username, ...querystring } = params
let { method, body, username, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, application, name, ...querystring } = params
let { method, body, application, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, username, ...querystring } = params
let { method, body, username, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, user, ...querystring } = params
let { method, body, user, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, username, ...querystring } = params
let { method, body, username, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, policyId, policy_id, ...querystring } = params
let { method, body, policyId, policy_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, policyId, policy_id, ...querystring } = params
let { method, body, policyId, policy_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, policyId, policy_id, ...querystring } = params
let { method, body, policyId, policy_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, policyId, policy_id, ...querystring } = params
let { method, body, policyId, policy_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, repository, ...querystring } = params
let { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, repository, snapshot, targetSnapshot, target_snapshot, ...querystring } = params
let { method, body, repository, snapshot, targetSnapshot, target_snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, repository, snapshot, ...querystring } = params
let { method, body, repository, snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, repository, ...querystring } = params
let { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, repository, snapshot, ...querystring } = params
let { method, body, repository, snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, repository, ...querystring } = params
let { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, repository, snapshot, ...querystring } = params
let { method, body, repository, snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, repository, ...querystring } = params
let { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, repository, snapshot, ...querystring } = params
let { method, body, repository, snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, repository, snapshot, ...querystring } = params
let { method, body, repository, snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, repository, ...querystring } = params
let { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, taskId, task_id, ...querystring } = params
let { method, body, taskId, task_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, taskId, task_id, ...querystring } = params
let { method, body, taskId, task_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, id, type, ...querystring } = params
let { method, body, index, id, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_termvectors'

65
api/api/text_structure.js Normal file
View File

@ -0,0 +1,65 @@
/*
* 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

@ -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)
}
var { method, body, transformId, transform_id, ...querystring } = params
let { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, transformId, transform_id, ...querystring } = params
let { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, transformId, transform_id, ...querystring } = params
let { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, transformId, transform_id, ...querystring } = params
let { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, transformId, transform_id, ...querystring } = params
let { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, transformId, transform_id, ...querystring } = params
let { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, transformId, transform_id, ...querystring } = params
let { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, index, type, ...querystring } = params
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, taskId, task_id, ...querystring } = params
let { method, body, taskId, task_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, watchId, watch_id, actionId, action_id, ...querystring } = params
let { method, body, watchId, watch_id, actionId, action_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, watchId, watch_id, ...querystring } = params
let { method, body, watchId, watch_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, watchId, watch_id, ...querystring } = params
let { method, body, watchId, watch_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(id)
@ -233,10 +233,10 @@ WatcherApi.prototype.putWatch = function watcherPutWatchApi (params, options, ca
WatcherApi.prototype.queryWatches = function watcherQueryWatchesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_watcher' + '/' + '_query' + '/' + 'watches'
@ -254,10 +254,10 @@ WatcherApi.prototype.queryWatches = function watcherQueryWatchesApi (params, opt
WatcherApi.prototype.start = function watcherStartApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_watcher' + '/' + '_start'
@ -275,10 +275,10 @@ WatcherApi.prototype.start = function watcherStartApi (params, options, callback
WatcherApi.prototype.stats = function watcherStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, metric, ...querystring } = params
let { method, body, metric, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((metric) != null) {
if (method == null) method = 'GET'
path = '/' + '_watcher' + '/' + 'stats' + '/' + encodeURIComponent(metric)
@ -301,10 +301,10 @@ WatcherApi.prototype.stats = function watcherStatsApi (params, options, callback
WatcherApi.prototype.stop = function watcherStopApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_watcher' + '/' + '_stop'

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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let 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)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_xpack' + '/' + 'usage'

View File

@ -33,6 +33,7 @@ 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')
@ -74,6 +75,7 @@ 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')
@ -84,6 +86,7 @@ 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')
@ -92,6 +95,7 @@ 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')
@ -105,6 +109,7 @@ 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')
@ -114,6 +119,7 @@ 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')
@ -123,6 +129,7 @@ function ESAPI (opts) {
this[kCat] = null
this[kCluster] = null
this[kDanglingIndices] = null
this[kFeatures] = null
this[kIndices] = null
this[kIngest] = null
this[kNodes] = null
@ -136,6 +143,7 @@ function ESAPI (opts) {
this[kGraph] = null
this[kIlm] = null
this[kLicense] = null
this[kLogstash] = null
this[kMigration] = null
this[kMl] = null
this[kMonitoring] = null
@ -145,6 +153,7 @@ function ESAPI (opts) {
this[kSlm] = null
this[kSql] = null
this[kSsl] = null
this[kTextStructure] = null
this[kTransform] = null
this[kWatcher] = null
this[kXpack] = null
@ -222,6 +231,14 @@ 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 } },
@ -343,6 +360,14 @@ 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) {
@ -417,6 +442,15 @@ 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) {

13
api/kibana.d.ts vendored
View File

@ -170,11 +170,15 @@ 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>>
@ -271,6 +275,11 @@ 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>>
@ -291,7 +300,6 @@ 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>>
@ -449,6 +457,9 @@ 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>>

View File

@ -299,6 +299,7 @@ export interface CatPlugins extends Generic {
master_timeout?: string;
h?: string | string[];
help?: boolean;
include_bootstrap?: boolean;
s?: string | string[];
v?: boolean;
}
@ -731,6 +732,10 @@ 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;
@ -795,6 +800,10 @@ 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[];
@ -1446,6 +1455,19 @@ 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;
@ -1546,24 +1568,6 @@ 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;
@ -2136,6 +2140,7 @@ 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;
}
@ -2180,6 +2185,7 @@ export interface SearchableSnapshotsMount<T = RequestBody> extends Generic {
snapshot: string;
master_timeout?: string;
wait_for_completion?: boolean;
storage?: string;
body: T;
}
@ -2189,6 +2195,7 @@ export interface SearchableSnapshotsRepositoryStats extends Generic {
export interface SearchableSnapshotsStats extends Generic {
index?: string | string[];
level?: 'cluster' | 'indices' | 'shards';
}
export interface SecurityAuthenticate extends Generic {
@ -2496,6 +2503,24 @@ 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;

View File

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

View File

@ -0,0 +1,120 @@
[[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
})
----

247
docs/basic-config.asciidoc Normal file
View File

@ -0,0 +1,247 @@
[[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,6 +1,57 @@
[[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

View File

@ -1,5 +1,5 @@
[[child-client]]
== Creating a child client
[[child]]
=== 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,371 +1,11 @@
[[client-configuration]]
== Client configuration
== Configuration
The client is designed to be easily configured for your needs. In the following
section, you can see the possible basic options that you can use to configure
it.
section, you can see the possible options that you can use to configure it.
[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 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'
}
})
----
|===
[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
})
----
* <<basic-config>>
* <<advanced-config>>
* <<child>>
* <<extend>>

View File

@ -57,7 +57,7 @@ async function run () {
})
// stream async iteration, available in Node.js ≥ 10
var payload = ''
let 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
var payload = ''
let payload = ''
body.setEncoding('utf8')
body.on('data', chunk => { payload += chunk })
body.on('error', console.log)

View File

@ -124,7 +124,7 @@ const client = new Client({ node: 'http://localhost:9200' })
// Scroll utility
async function * scrollSearch (params) {
var response = await client.search(params)
let response = await client.search(params)
while (true) {
const sourceHits = response.body.hits.hits

View File

@ -51,7 +51,7 @@ async function run () {
const data = body.rows.map(row => {
const obj = {}
for (var i = 0; i < row.length; i++) {
for (let i = 0; i < row.length; i++) {
obj[body.columns[i].name] = row[i]
}
return obj

View File

@ -1,5 +1,5 @@
[[extend-client]]
== Extend the client
[[extend]]
=== Extend the client
Sometimes you need to reuse the same logic, or you want to build a custom API to
allow you simplify your code. The easiest way to achieve that is by extending

View File

@ -8,11 +8,13 @@ include::installation.asciidoc[]
include::connecting.asciidoc[]
include::changelog.asciidoc[]
include::configuration.asciidoc[]
include::basic-config.asciidoc[]
include::advanced-config.asciidoc[]
include::child.asciidoc[]
include::extend.asciidoc[]
include::reference.asciidoc[]
include::breaking-changes.asciidoc[]
include::observability.asciidoc[]
include::child.asciidoc[]
include::extend.asciidoc[]
include::helpers.asciidoc[]
include::typescript.asciidoc[]
include::testing.asciidoc[]

View File

@ -24,7 +24,7 @@ To learn more about the supported major versions, please refer to the
[[nodejs-support]]
=== Node.js support
NOTE: The minimum supported version of Node.js is `v8`.
NOTE: The minimum supported version of Node.js is `v10`.
The client versioning follows the {stack} versioning, this means that
major, minor, and patch releases are done following a precise schedule that

View File

@ -1194,6 +1194,7 @@ client.cat.plugins({
master_timeout: string,
h: string | string[],
help: boolean,
include_bootstrap: boolean,
s: string | string[],
v: boolean
})
@ -1216,6 +1217,9 @@ link:{ref}/cat-plugins.html[Documentation] +
|`help`
|`boolean` - Return help information
|`include_bootstrap` or `includeBootstrap`
|`boolean` - Include bootstrap plugins in the response
|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by
@ -2998,6 +3002,23 @@ _Default:_ `5d`
|===
[discrete]
=== eql.getStatus
[source,ts]
----
client.eql.getStatus({
id: string
})
----
link:{ref}/eql-search-api.html[Documentation] +
[cols=2*]
|===
|`id`
|`string` - The async search ID
|===
[discrete]
=== eql.search
@ -3243,6 +3264,23 @@ _Default:_ `OR`
|===
[discrete]
=== features.getFeatures
[source,ts]
----
client.features.getFeatures({
master_timeout: string
})
----
link:{ref}/modules-snapshots.html[Documentation] +
[cols=2*]
|===
|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node
|===
[discrete]
=== fieldCaps
@ -3916,7 +3954,7 @@ link:{ref}/indices-open-close.html[Documentation] +
_Default:_ `open`
|`wait_for_active_shards` or `waitForActiveShards`
|`string` - Sets the number of active shards to wait for before the operation returns.
|`string` - Sets the number of active shards to wait for before the operation returns. Set to `index-setting` to wait according to the index setting `index.write.wait_for_active_shards`, or `all` to wait for all shards, or an integer. Defaults to `0`.
|===
@ -5941,6 +5979,61 @@ link:{ref}/start-trial.html[Documentation] +
|===
[discrete]
=== logstash.deletePipeline
[source,ts]
----
client.logstash.deletePipeline({
id: string
})
----
link:{ref}/logstash-api-delete-pipeline.html[Documentation] +
[cols=2*]
|===
|`id`
|`string` - The ID of the Pipeline
|===
[discrete]
=== logstash.getPipeline
[source,ts]
----
client.logstash.getPipeline({
id: string
})
----
link:{ref}/logstash-api-get-pipeline.html[Documentation] +
[cols=2*]
|===
|`id`
|`string` - A comma-separated list of Pipeline IDs
|===
[discrete]
=== logstash.putPipeline
[source,ts]
----
client.logstash.putPipeline({
id: string,
body: object
})
----
link:{ref}/logstash-api-put-pipeline.html[Documentation] +
[cols=2*]
|===
|`id`
|`string` - The ID of the Pipeline
|`body`
|`object` - The Pipeline to add or update
|===
[discrete]
=== mget
@ -6355,82 +6448,6 @@ link:{ref}/explain-dfanalytics.html[Documentation] +
|===
[discrete]
=== ml.findFileStructure
*Stability:* experimental
[source,ts]
----
client.ml.findFileStructure({
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: object
})
----
link:{ref}/ml-find-file-structure.html[Documentation] +
[cols=2*]
|===
|`lines_to_sample` or `linesToSample`
|`number` - How many lines of the file should be included in the analysis +
_Default:_ `1000`
|`line_merge_size_limit` or `lineMergeSizeLimit`
|`number` - Maximum number of characters permitted in a single message when lines are merged to create messages. +
_Default:_ `10000`
|`timeout`
|`string` - Timeout after which the analysis will be aborted +
_Default:_ `25s`
|`charset`
|`string` - Optional parameter to specify the character set of the file
|`format`
|`'ndjson' \| 'xml' \| 'delimited' \| 'semi_structured_text'` - Optional parameter to specify the high level file format
|`has_header_row` or `hasHeaderRow`
|`boolean` - Optional parameter to specify whether a delimited file includes the column names in its first row
|`column_names` or `columnNames`
|`string \| string[]` - Optional parameter containing a comma separated list of the column names for a delimited file
|`delimiter`
|`string` - Optional parameter to specify the delimiter character for a delimited file - must be a single character
|`quote`
|`string` - Optional parameter to specify the quote character for a delimited file - must be a single character
|`should_trim_fields` or `shouldTrimFields`
|`boolean` - Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them
|`grok_pattern` or `grokPattern`
|`string` - Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file
|`timestamp_field` or `timestampField`
|`string` - Optional parameter to specify the timestamp field in the file
|`timestamp_format` or `timestampFormat`
|`string` - Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format
|`explain`
|`boolean` - Whether to include a commentary on how the structure was derived
|`body`
|`object` - The contents of the file to be analyzed
|===
[discrete]
=== ml.flushJob
@ -8693,6 +8710,7 @@ client.search({
max_concurrent_shard_requests: number,
pre_filter_shard_size: number,
rest_total_hits_as_int: boolean,
min_compatible_shard_node: string,
body: object
})
----
@ -8839,6 +8857,9 @@ _Default:_ `5`
|`rest_total_hits_as_int` or `restTotalHitsAsInt`
|`boolean` - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
|`min_compatible_shard_node` or `minCompatibleShardNode`
|`string` - The minimum compatible version that all shards involved in search should have for this request to be successful
|`body`
|`object` - The search definition using the Query DSL
@ -9005,6 +9026,7 @@ client.searchableSnapshots.mount({
snapshot: string,
master_timeout: string,
wait_for_completion: boolean,
storage: string,
body: object
})
----
@ -9023,6 +9045,9 @@ link:{ref}/searchable-snapshots-api-mount-snapshot.html[Documentation] +
|`wait_for_completion` or `waitForCompletion`
|`boolean` - Should this request wait until the operation has completed before returning
|`storage`
|`string` - Selects the kind of local storage used to accelerate searches. Experimental, and defaults to `full_copy`
|`body`
|`object` - The restore configuration for mounting the snapshot as searchable
@ -9051,7 +9076,8 @@ link:{ref}/searchable-snapshots-apis.html[Documentation] +
[source,ts]
----
client.searchableSnapshots.stats({
index: string | string[]
index: string | string[],
level: 'cluster' | 'indices' | 'shards'
})
----
link:{ref}/searchable-snapshots-apis.html[Documentation] +
@ -9060,6 +9086,10 @@ link:{ref}/searchable-snapshots-apis.html[Documentation] +
|`index`
|`string \| string[]` - A comma-separated list of index names
|`level`
|`'cluster' \| 'indices' \| 'shards'` - Return stats aggregated at cluster, index or shard level +
_Default:_ `indices`
|===
[discrete]
@ -10318,6 +10348,82 @@ _Default:_ `true`
|===
[discrete]
=== textStructure.findStructure
*Stability:* experimental
[source,ts]
----
client.textStructure.findStructure({
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: object
})
----
link:{ref}/find-structure.html[Documentation] +
[cols=2*]
|===
|`lines_to_sample` or `linesToSample`
|`number` - How many lines of the file should be included in the analysis +
_Default:_ `1000`
|`line_merge_size_limit` or `lineMergeSizeLimit`
|`number` - Maximum number of characters permitted in a single message when lines are merged to create messages. +
_Default:_ `10000`
|`timeout`
|`string` - Timeout after which the analysis will be aborted +
_Default:_ `25s`
|`charset`
|`string` - Optional parameter to specify the character set of the file
|`format`
|`'ndjson' \| 'xml' \| 'delimited' \| 'semi_structured_text'` - Optional parameter to specify the high level file format
|`has_header_row` or `hasHeaderRow`
|`boolean` - Optional parameter to specify whether a delimited file includes the column names in its first row
|`column_names` or `columnNames`
|`string \| string[]` - Optional parameter containing a comma separated list of the column names for a delimited file
|`delimiter`
|`string` - Optional parameter to specify the delimiter character for a delimited file - must be a single character
|`quote`
|`string` - Optional parameter to specify the quote character for a delimited file - must be a single character
|`should_trim_fields` or `shouldTrimFields`
|`boolean` - Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them
|`grok_pattern` or `grokPattern`
|`string` - Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file
|`timestamp_field` or `timestampField`
|`string` - Optional parameter to specify the timestamp field in the file
|`timestamp_format` or `timestampFormat`
|`string` - Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format
|`explain`
|`boolean` - Whether to include a commentary on how the structure was derived
|`body`
|`object` - The contents of the file to be analyzed
|===
[discrete]
=== transform.deleteTransform

72
index.d.ts vendored
View File

@ -691,6 +691,14 @@ declare class Client {
get<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.EqlGet, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.EqlGet, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_status<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.EqlGetStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
get_status<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_status<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.EqlGetStatus, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_status<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.EqlGetStatus, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getStatus<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.EqlGetStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getStatus<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getStatus<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.EqlGetStatus, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getStatus<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.EqlGetStatus, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.EqlSearch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.EqlSearch<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
@ -712,6 +720,16 @@ declare class Client {
explain<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
explain<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Explain<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
explain<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Explain<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
features: {
get_features<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.FeaturesGetFeatures, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
get_features<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_features<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FeaturesGetFeatures, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_features<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FeaturesGetFeatures, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getFeatures<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.FeaturesGetFeatures, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getFeatures<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getFeatures<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FeaturesGetFeatures, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getFeatures<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FeaturesGetFeatures, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
}
field_caps<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.FieldCaps<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
field_caps<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
field_caps<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.FieldCaps<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
@ -1286,6 +1304,32 @@ declare class Client {
postStartTrial<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LicensePostStartTrial, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
postStartTrial<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LicensePostStartTrial, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
}
logstash: {
delete_pipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashDeletePipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
delete_pipeline<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
delete_pipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashDeletePipeline, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
delete_pipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashDeletePipeline, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
deletePipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashDeletePipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
deletePipeline<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
deletePipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashDeletePipeline, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
deletePipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashDeletePipeline, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_pipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashGetPipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
get_pipeline<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_pipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashGetPipeline, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_pipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashGetPipeline, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getPipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashGetPipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getPipeline<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getPipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashGetPipeline, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getPipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashGetPipeline, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
put_pipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashPutPipeline<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
put_pipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
put_pipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.LogstashPutPipeline<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
put_pipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.LogstashPutPipeline<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
putPipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashPutPipeline<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
putPipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
putPipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.LogstashPutPipeline<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
putPipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.LogstashPutPipeline<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
}
mget<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Mget<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
mget<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
mget<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Mget<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
@ -1417,14 +1461,6 @@ declare class Client {
explainDataFrameAnalytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
explainDataFrameAnalytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlExplainDataFrameAnalytics<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
explainDataFrameAnalytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlExplainDataFrameAnalytics<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
find_file_structure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params?: RequestParams.MlFindFileStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
find_file_structure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
find_file_structure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.MlFindFileStructure<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
find_file_structure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.MlFindFileStructure<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
findFileStructure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params?: RequestParams.MlFindFileStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
findFileStructure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
findFileStructure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.MlFindFileStructure<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
findFileStructure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.MlFindFileStructure<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
flush_job<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlFlushJob<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
flush_job<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
flush_job<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlFlushJob<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
@ -2432,6 +2468,26 @@ declare class Client {
termvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
termvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Termvectors<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
termvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Termvectors<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
text_structure: {
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.TextStructureFindStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.TextStructureFindStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
}
textStructure: {
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.TextStructureFindStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.TextStructureFindStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
}
transform: {
delete_transform<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.TransformDeleteTransform, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
delete_transform<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback

View File

@ -27,13 +27,17 @@ const debug = require('debug')('elasticsearch')
const Transport = require('./lib/Transport')
const Connection = require('./lib/Connection')
const { ConnectionPool, CloudConnectionPool } = require('./lib/pool')
// Helpers works only in Node.js >= 10
const Helpers = nodeMajor < 10 ? /* istanbul ignore next */ null : require('./lib/Helpers')
const Helpers = require('./lib/Helpers')
const Serializer = require('./lib/Serializer')
const errors = require('./lib/errors')
const { ConfigurationError } = errors
const { prepareHeaders } = Connection.internals
const clientVersion = require('./package.json').version
let clientVersion = require('./package.json').version
/* istanbul ignore next */
if (clientVersion.includes('-')) {
// clean prerelease
clientVersion = clientVersion.slice(0, clientVersion.indexOf('-')) + 'p'
}
const nodeVersion = process.versions.node
const kInitialOptions = Symbol('elasticsearchjs-initial-options')
@ -43,15 +47,6 @@ const kEventEmitter = Symbol('elasticsearchjs-event-emitter')
const ESAPI = require('./api')
/* istanbul ignore next */
if (nodeMajor < 10) {
process.emitWarning('You are using a version of Node.js that is currently in EOL. ' +
'The support for this version will be dropped in 7.12. ' +
'Please refer to https://ela.st/nodejs-support for additional information.',
'DeprecationWarning'
)
}
/* istanbul ignore next */
if (nodeMajor >= 10 && nodeMajor < 12) {
process.emitWarning('You are using a version of Node.js that will reach EOL in April 2021. ' +
@ -184,8 +179,6 @@ class Client extends ESAPI {
context: options.context
})
/* istanbul ignore else */
if (Helpers !== null) {
this.helpers = new Helpers({
client: this,
maxRetries: options.maxRetries,
@ -194,7 +187,6 @@ class Client extends ESAPI {
: null
})
}
}
get emit () {
return this[kEventEmitter].emit.bind(this[kEventEmitter])
@ -218,7 +210,7 @@ class Client extends ESAPI {
opts = {}
}
var [namespace, method] = name.split('.')
let [namespace, method] = name.split('.')
if (method == null) {
method = namespace
namespace = null

View File

@ -213,8 +213,8 @@ class Connection {
}
const paramsKeys = Object.keys(params)
for (var i = 0, len = paramsKeys.length; i < len; i++) {
var key = paramsKeys[i]
for (let i = 0, len = paramsKeys.length; i < len; i++) {
const key = paramsKeys[i]
if (key === 'path') {
request.pathname = resolve(request.pathname, params[key])
} else if (key === 'querystring' && !!params[key] === true) {

4
lib/Helpers.d.ts vendored
View File

@ -25,8 +25,8 @@ export default class Helpers {
search<TDocument = unknown, TRequestBody extends RequestBody = Record<string, any>>(params: Search<TRequestBody>, options?: TransportRequestOptions): Promise<TDocument[]>
scrollSearch<TDocument = unknown, TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: Search<TRequestBody>, options?: TransportRequestOptions): AsyncIterable<ScrollSearchResponse<TDocument, TResponse, TContext>>
scrollDocuments<TDocument = unknown, TRequestBody extends RequestBody = Record<string, any>>(params: Search<TRequestBody>, options?: TransportRequestOptions): AsyncIterable<TDocument>
msearch(options?: MsearchHelperOptions): MsearchHelper
bulk<TDocument = unknown>(options: BulkHelperOptions<TDocument>): BulkHelper<BulkStats>
msearch(options?: MsearchHelperOptions, reqOptions?: TransportRequestOptions): MsearchHelper
bulk<TDocument = unknown>(options: BulkHelperOptions<TDocument>, reqOptions?: TransportRequestOptions): BulkHelper<BulkStats>
}
export interface ScrollSearchResponse<TDocument = unknown, TResponse = Record<string, any>, TContext = Context> extends ApiResponse<TResponse, TContext> {

View File

@ -158,7 +158,7 @@ class Helpers {
*/
async * scrollDocuments (params, options) {
appendFilterPath('hits.hits._source', params, true)
for await (const { documents } of this.scrollSearch(params)) {
for await (const { documents } of this.scrollSearch(params, options)) {
for (const document of documents) {
yield document
}
@ -169,9 +169,10 @@ class Helpers {
* Creates a msearch helper instance. Once you configure it, you can use the provided
* `search` method to add new searches in the queue.
* @param {object} options - The configuration of the msearch operations.
* @param {object} reqOptions - The client optional configuration for this request.
* @return {object} The possible operations to run.
*/
msearch (options = {}) {
msearch (options = {}, reqOptions = {}) {
const client = this[kClient]
const {
operations = 5,
@ -378,7 +379,7 @@ class Helpers {
// This function never returns an error, if the msearch operation fails,
// the error is dispatched to all search executors.
function tryMsearch (msearchBody, callbacks, done) {
client.msearch(Object.assign({}, msearchOptions, { body: msearchBody }), (err, results) => {
client.msearch(Object.assign({}, msearchOptions, { body: msearchBody }), reqOptions, (err, results) => {
const retryBody = []
const retryCallbacks = []
if (err) {
@ -415,12 +416,16 @@ class Helpers {
* Creates a bulk helper instance. Once you configure it, you can pick which operation
* to execute with the given dataset, index, create, update, and delete.
* @param {object} options - The configuration of the bulk operation.
* @param {object} reqOptions - The client optional configuration for this request.
* @return {object} The possible operations to run with the datasource.
*/
bulk (options) {
bulk (options, reqOptions = {}) {
const client = this[kClient]
const { serialize, deserialize } = client.serializer
const reqOptions = this[kMetaHeader] !== null ? { headers: { 'x-elastic-client-meta': this[kMetaHeader] + ',h=bp' } } : {}
if (this[kMetaHeader] !== null) {
reqOptions.headers = reqOptions.headers || {}
reqOptions.headers['x-elastic-client-meta'] = this[kMetaHeader] + ',h=bp'
}
const {
datasource,
onDocument,
@ -545,7 +550,7 @@ class Helpers {
index: typeof refreshOnCompletion === 'string'
? refreshOnCompletion
: '_all'
})
}, reqOptions)
}
stats.time = Date.now() - startTime

View File

@ -27,8 +27,9 @@ const { SerializationError, DeserializationError } = require('./errors')
class Serializer {
serialize (object) {
debug('Serializing', object)
let json
try {
var json = JSON.stringify(object)
json = JSON.stringify(object)
} catch (err) {
throw new SerializationError(err.message, object)
}
@ -37,8 +38,9 @@ class Serializer {
deserialize (json) {
debug('Deserializing', json)
let object
try {
var object = sjson.parse(json)
object = sjson.parse(json)
} catch (err) {
throw new DeserializationError(err.message, json)
}
@ -50,8 +52,8 @@ class Serializer {
if (Array.isArray(array) === false) {
throw new SerializationError('The argument provided is not an array')
}
var ndjson = ''
for (var i = 0, len = array.length; i < len; i++) {
let ndjson = ''
for (let i = 0, len = array.length; i < len; i++) {
if (typeof array[i] === 'string') {
ndjson += array[i] + '\n'
} else {
@ -67,8 +69,8 @@ class Serializer {
if (typeof object === 'string') return object
// arrays should be serialized as comma separated list
const keys = Object.keys(object)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
for (let i = 0, len = keys.length; i < len; i++) {
const key = keys[i]
// elasticsearch will complain for keys without a value
if (object[key] === undefined) {
delete object[key]

1
lib/Transport.d.ts vendored
View File

@ -120,6 +120,7 @@ export interface TransportRequestCallback {
export interface TransportRequestPromise<T> extends Promise<T> {
abort: () => void;
finally(onFinally?: (() => void) | undefined | null): Promise<T>;
}
export interface TransportGetConnectionOptions {

View File

@ -91,7 +91,7 @@ class Transport {
callback = options
options = {}
}
var p = null
let p = null
// promises support
if (callback === undefined) {
@ -147,9 +147,10 @@ class Transport {
// the size of the stream, we risk to take too much memory.
// Furthermore, copying everytime the stream is very a expensive operation.
const maxRetries = isStream(params.body) || isStream(params.bulkBody)
? 0 : (typeof options.maxRetries === 'number' ? options.maxRetries : this.maxRetries)
? 0
: (typeof options.maxRetries === 'number' ? options.maxRetries : this.maxRetries)
const compression = options.compression !== undefined ? options.compression : this.compression
var request = { abort: noop }
let request = { abort: noop }
const transportReturn = {
then (onFulfilled, onRejected) {
return p.then(onFulfilled, onRejected)
@ -162,6 +163,9 @@ class Transport {
request.abort()
debug('Aborting request', params)
return this
},
finally (onFinally) {
return p.finally(onFinally)
}
}
@ -525,7 +529,7 @@ function defaultNodeFilter (node) {
}
function roundRobinSelector () {
var current = -1
let current = -1
return function _roundRobinSelector (connections) {
if (++current >= connections.length) {
current = 0
@ -540,8 +544,8 @@ function randomSelector (connections) {
}
function generateRequestId () {
var maxInt = 2147483647
var nextReqId = 0
const maxInt = 2147483647
let nextReqId = 0
return function genReqId (params, options) {
return (nextReqId = (nextReqId + 1) & maxInt)
}

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