Compare commits

...

22 Commits
7.x ... v7.9.1

Author SHA1 Message Date
537b5b0de9 Bumped v7.9.1 2020-09-23 15:06:08 +02:00
d24fff058e API generation 2020-09-23 11:45:00 +02:00
bd7b38b24e Improve child performances (#1314) 2020-09-23 11:43:25 +02:00
bd8892c37d Improved cleanup yaml tests (#1306) 2020-09-23 11:40:34 +02:00
360fe7b442 Fixed code generation 2020-09-23 11:40:20 +02:00
59203811dd Avoid the release of Zalgo (#1295) 2020-09-23 11:39:54 +02:00
457c30eb89 Fix maxRetries request option handling (#1296) 2020-09-23 11:39:45 +02:00
8c1646a662 Fix RequestOptions.body type to include null (#1300)
Fixes #1291
2020-09-23 11:39:37 +02:00
9d747121e8 Helper param fix (#1284)
Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
2020-09-23 11:39:16 +02:00
2907a84334 Bumped v7.9.0 2020-08-19 17:56:57 +02:00
d966a06a62 API generation 2020-08-19 17:54:32 +02:00
4bca80bafc API generation 2020-08-03 12:02:03 +02:00
080c3af904 Generate response type as boolean if the request is HEAD only (#1275) 2020-08-03 11:54:42 +02:00
14536d6855 API generation 2020-07-29 08:32:03 +02:00
11b4cea493 Bumped v7.9.0-rc.2 2020-07-20 16:48:44 +02:00
3673255959 API generation 2020-07-20 14:10:27 +02:00
e0fc57766d Fix errors in type definitions (#1263) 2020-07-20 14:03:13 +02:00
9c2ec755d3 Bumped v7.9.0-rc.1 2020-07-17 08:46:29 +02:00
a221a84a58 Updated ci configuration 2020-07-17 08:12:53 +02:00
7d78dceed5 Fixed type test 2020-07-15 15:48:58 +02:00
c3832dc081 Updated ci configuration 2020-07-15 15:44:17 +02:00
af5c978131 API generation 2020-07-15 15:43:04 +02:00
399 changed files with 16421 additions and 33191 deletions

View File

@ -1,6 +1,6 @@
---
STACK_VERSION:
- 7.x-SNAPSHOT
- 7.9.0-SNAPSHOT
NODE_JS_VERSION:
- 14

View File

@ -86,7 +86,7 @@ jobs:
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.x-SNAPSHOT
stack-version: 7.9.0-SNAPSHOT
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
@ -101,6 +101,49 @@ jobs:
run: |
npm run test:integration:helpers
bundler-support:
name: Bundler support
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 8.0.0-SNAPSHOT
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install
run: |
npm install
npm install --prefix test/bundlers/parcel-test
npm install --prefix test/bundlers/rollup-test
npm install --prefix test/bundlers/webpack-test
- name: Build
run: |
npm run build --prefix test/bundlers/parcel-test
npm run build --prefix test/bundlers/rollup-test
npm run build --prefix test/bundlers/webpack-test
- name: Run bundle
run: |
npm start --prefix test/bundlers/parcel-test
npm start --prefix test/bundlers/rollup-test
npm start --prefix test/bundlers/webpack-test
code-coverage:
name: Code coverage
runs-on: ubuntu-latest

4
.gitignore vendored
View File

@ -56,3 +56,7 @@ elasticsearch*
test/benchmarks/macro/fixtures/*
*-junit.xml
.cache
test/bundlers/**/bundle.js

View File

@ -1,78 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildAsyncSearchDelete (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
]
const snakeCase = {
}
/**
* Perform a async_search.delete request
* Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
*/
return function asyncSearchDelete (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_async_search' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildAsyncSearchDelete

View File

@ -1,82 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildAsyncSearchGet (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'wait_for_completion_timeout',
'keep_alive',
'typed_keys'
]
const snakeCase = {
waitForCompletionTimeout: 'wait_for_completion_timeout',
keepAlive: 'keep_alive',
typedKeys: 'typed_keys'
}
/**
* Perform a async_search.get request
* Retrieves the results of a previously submitted async search request given its ID.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
*/
return function asyncSearchGet (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_async_search' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildAsyncSearchGet

114
api/api/async_search.js Normal file
View File

@ -0,0 +1,114 @@
/*
* 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', 'wait_for_completion_timeout', 'keep_alive', 'typed_keys', 'keep_on_completion', 'batched_reduce_size', 'request_cache', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'explain', 'stored_fields', 'docvalue_fields', 'from', 'ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'search_type', 'size', 'sort', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'terminate_after', 'stats', 'suggest_field', 'suggest_mode', 'suggest_size', 'suggest_text', 'timeout', 'track_scores', 'track_total_hits', 'allow_partial_search_results', 'version', 'seq_no_primary_term', 'max_concurrent_shard_requests']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletionTimeout: 'wait_for_completion_timeout', keepAlive: 'keep_alive', typedKeys: 'typed_keys', keepOnCompletion: 'keep_on_completion', batchedReduceSize: 'batched_reduce_size', requestCache: 'request_cache', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', storedFields: 'stored_fields', docvalueFields: 'docvalue_fields', ignoreUnavailable: 'ignore_unavailable', ignoreThrottled: 'ignore_throttled', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', terminateAfter: 'terminate_after', suggestField: 'suggest_field', suggestMode: 'suggest_mode', suggestSize: 'suggest_size', suggestText: 'suggest_text', trackScores: 'track_scores', trackTotalHits: 'track_total_hits', allowPartialSearchResults: 'allow_partial_search_results', seqNoPrimaryTerm: 'seq_no_primary_term', maxConcurrentShardRequests: 'max_concurrent_shard_requests' }
function AsyncSearchApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
AsyncSearchApi.prototype.delete = function asyncSearchDeleteApi (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)
}
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_async_search' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
AsyncSearchApi.prototype.get = function asyncSearchGetApi (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)
}
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_async_search' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
AsyncSearchApi.prototype.submit = function asyncSearchSubmitApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_async_search'
} else {
if (method == null) method = 'POST'
path = '/' + '_async_search'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = AsyncSearchApi

View File

@ -1,143 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildAsyncSearchSubmit (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'wait_for_completion_timeout',
'keep_on_completion',
'keep_alive',
'batched_reduce_size',
'request_cache',
'analyzer',
'analyze_wildcard',
'default_operator',
'df',
'explain',
'stored_fields',
'docvalue_fields',
'from',
'ignore_unavailable',
'ignore_throttled',
'allow_no_indices',
'expand_wildcards',
'lenient',
'preference',
'q',
'routing',
'search_type',
'size',
'sort',
'_source',
'_source_excludes',
'_source_includes',
'terminate_after',
'stats',
'suggest_field',
'suggest_mode',
'suggest_size',
'suggest_text',
'timeout',
'track_scores',
'track_total_hits',
'allow_partial_search_results',
'typed_keys',
'version',
'seq_no_primary_term',
'max_concurrent_shard_requests'
]
const snakeCase = {
waitForCompletionTimeout: 'wait_for_completion_timeout',
keepOnCompletion: 'keep_on_completion',
keepAlive: 'keep_alive',
batchedReduceSize: 'batched_reduce_size',
requestCache: 'request_cache',
analyzeWildcard: 'analyze_wildcard',
defaultOperator: 'default_operator',
storedFields: 'stored_fields',
docvalueFields: 'docvalue_fields',
ignoreUnavailable: 'ignore_unavailable',
ignoreThrottled: 'ignore_throttled',
allowNoIndices: 'allow_no_indices',
expandWildcards: 'expand_wildcards',
searchType: 'search_type',
_sourceExcludes: '_source_excludes',
_sourceIncludes: '_source_includes',
terminateAfter: 'terminate_after',
suggestField: 'suggest_field',
suggestMode: 'suggest_mode',
suggestSize: 'suggest_size',
suggestText: 'suggest_text',
trackScores: 'track_scores',
trackTotalHits: 'track_total_hits',
allowPartialSearchResults: 'allow_partial_search_results',
typedKeys: 'typed_keys',
seqNoPrimaryTerm: 'seq_no_primary_term',
maxConcurrentShardRequests: 'max_concurrent_shard_requests'
}
/**
* Perform a async_search.submit request
* Executes a search request asynchronously.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
*/
return function asyncSearchSubmit (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_async_search'
} else {
if (method == null) method = 'POST'
path = '/' + '_async_search'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildAsyncSearchSubmit

View File

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

View File

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

View File

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

147
api/api/autoscaling.js Normal file
View File

@ -0,0 +1,147 @@
/*
* 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 AutoscalingApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
AutoscalingApi.prototype.deleteAutoscalingPolicy = function autoscalingDeleteAutoscalingPolicyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
AutoscalingApi.prototype.getAutoscalingDecision = function autoscalingGetAutoscalingDecisionApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_autoscaling' + '/' + 'decision'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
AutoscalingApi.prototype.getAutoscalingPolicy = function autoscalingGetAutoscalingPolicyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
AutoscalingApi.prototype.putAutoscalingPolicy = function autoscalingPutAutoscalingPolicyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(AutoscalingApi.prototype, {
delete_autoscaling_policy: { get () { return this.deleteAutoscalingPolicy } },
get_autoscaling_decision: { get () { return this.getAutoscalingDecision } },
get_autoscaling_policy: { get () { return this.getAutoscalingPolicy } },
put_autoscaling_policy: { get () { return this.putAutoscalingPolicy } }
})
module.exports = AutoscalingApi

View File

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

View File

@ -1,109 +1,70 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildBulk (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['wait_for_active_shards', 'refresh', 'routing', 'timeout', 'type', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'pipeline', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { waitForActiveShards: 'wait_for_active_shards', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = [
'wait_for_active_shards',
'refresh',
'routing',
'timeout',
'type',
'_source',
'_source_excludes',
'_source_includes',
'pipeline',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
function bulkApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
const snakeCase = {
waitForActiveShards: 'wait_for_active_shards',
_sourceExcludes: '_source_excludes',
_sourceIncludes: '_source_includes',
errorTrace: 'error_trace',
filterPath: 'filter_path'
// check required parameters
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
/**
* Perform a bulk request
* Allows to perform multiple index/update/delete operations in a single request.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html
*/
return function bulk (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['body'] == null) {
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params['type'] != null && (params['index'] == null)) {
const err = new ConfigurationError('Missing required parameter of the url: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_bulk'
} else if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_bulk'
} else {
if (method == null) method = 'POST'
path = '/' + '_bulk'
}
// build request object
const request = {
method,
path,
bulkBody: body,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
// check required url components
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
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_bulk'
} else if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_bulk'
} else {
if (method == null) method = 'POST'
path = '/' + '_bulk'
}
// build request object
const request = {
method,
path,
bulkBody: body,
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = buildBulk
module.exports = bulkApi

View File

@ -1,90 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatAliases (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'format',
'local',
'h',
'help',
's',
'v',
'expand_wildcards',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
expandWildcards: 'expand_wildcards',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.aliases request
* Shows information about currently configured aliases to indices including filter and routing infos.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html
*/
return function catAliases (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'aliases' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'aliases'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatAliases

View File

@ -1,91 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatAllocation (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'format',
'bytes',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.allocation request
* Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html
*/
return function catAllocation (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, nodeId, node_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'allocation' + '/' + encodeURIComponent(node_id || nodeId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'allocation'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatAllocation

View File

@ -1,87 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatCount (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'format',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.count request
* Provides quick access to the document count of the entire cluster, or individual indices.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html
*/
return function catCount (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'count' + '/' + encodeURIComponent(index)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'count'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatCount

View File

@ -1,89 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatFielddata (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'format',
'bytes',
'h',
'help',
's',
'v',
'fields',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.fielddata request
* Shows how much heap memory is currently being used by fielddata on every data node in the cluster.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html
*/
return function catFielddata (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, fields, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((fields) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'fielddata' + '/' + encodeURIComponent(fields)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'fielddata'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatFielddata

View File

@ -1,84 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatHealth (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'format',
'h',
'help',
's',
'time',
'ts',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.health request
* Returns a concise representation of the cluster health.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html
*/
return function catHealth (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'health'
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatHealth

View File

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

View File

@ -1,98 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatIndices (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'format',
'bytes',
'local',
'master_timeout',
'h',
'health',
'help',
'pri',
's',
'time',
'v',
'include_unloaded_segments',
'expand_wildcards',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
includeUnloadedSegments: 'include_unloaded_segments',
expandWildcards: 'expand_wildcards',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.indices request
* Returns information about indices: number of primaries and replicas, document counts, disk size, ...
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html
*/
return function catIndices (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'indices' + '/' + encodeURIComponent(index)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'indices'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatIndices

648
api/api/cat.js Normal file
View File

@ -0,0 +1,648 @@
/*
* 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 = ['format', 'local', 'h', 'help', 's', 'v', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'bytes', 'master_timeout', 'fields', 'time', 'ts', 'health', 'pri', 'include_unloaded_segments', 'full_id', 'active_only', 'detailed', 'index', 'ignore_unavailable', 'node_id', 'actions', 'parent_task', 'size', 'allow_no_match', 'allow_no_datafeeds', 'allow_no_jobs', 'from']
const snakeCase = { expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', includeUnloadedSegments: 'include_unloaded_segments', fullId: 'full_id', activeOnly: 'active_only', ignoreUnavailable: 'ignore_unavailable', nodeId: 'node_id', parentTask: 'parent_task', allowNoMatch: 'allow_no_match', allowNoDatafeeds: 'allow_no_datafeeds', allowNoJobs: 'allow_no_jobs' }
function CatApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
CatApi.prototype.aliases = function catAliasesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'aliases' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'aliases'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, 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
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'allocation' + '/' + encodeURIComponent(node_id || nodeId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'allocation'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.count = function catCountApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'count' + '/' + encodeURIComponent(index)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'count'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.fielddata = function catFielddataApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, fields, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((fields) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'fielddata' + '/' + encodeURIComponent(fields)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'fielddata'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.health = function catHealthApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'health'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.help = function catHelpApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.indices = function catIndicesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'indices' + '/' + encodeURIComponent(index)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'indices'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.master = function catMasterApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'master'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.nodeattrs = function catNodeattrsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'nodeattrs'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.nodes = function catNodesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'nodes'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.pendingTasks = function catPendingTasksApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'pending_tasks'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.plugins = function catPluginsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'plugins'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.recovery = function catRecoveryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'recovery' + '/' + encodeURIComponent(index)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'recovery'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.repositories = function catRepositoriesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'repositories'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.segments = function catSegmentsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'segments' + '/' + encodeURIComponent(index)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'segments'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.shards = function catShardsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'shards' + '/' + encodeURIComponent(index)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'shards'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.snapshots = function catSnapshotsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((repository) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'snapshots' + '/' + encodeURIComponent(repository)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'snapshots'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.tasks = function catTasksApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'tasks'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.templates = function catTemplatesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'templates' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'templates'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, 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
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((thread_pool_patterns || threadPoolPatterns) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'thread_pool' + '/' + encodeURIComponent(thread_pool_patterns || threadPoolPatterns)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'thread_pool'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.mlDataFrameAnalytics = function catMlDataFrameAnalyticsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((id) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'data_frame' + '/' + 'analytics'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.mlDatafeeds = function catMlDatafeedsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, datafeedId, datafeed_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((datafeed_id || datafeedId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.mlJobs = function catMlJobsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, jobId, job_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((job_id || jobId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'anomaly_detectors'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, 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
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((model_id || modelId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models' + '/' + encodeURIComponent(model_id || modelId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.transforms = function catTransformsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((transform_id || transformId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'transforms'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(CatApi.prototype, {
pending_tasks: { get () { return this.pendingTasks } },
thread_pool: { get () { return this.threadPool } },
ml_data_frame_analytics: { get () { return this.mlDataFrameAnalytics } },
ml_datafeeds: { get () { return this.mlDatafeeds } },
ml_jobs: { get () { return this.mlJobs } },
ml_trained_models: { get () { return this.mlTrainedModels } }
})
module.exports = CatApi

View File

@ -1,85 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatMaster (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'format',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.master request
* Returns information about the master node.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html
*/
return function catMaster (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'master'
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatMaster

View File

@ -1,85 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatMlDataFrameAnalytics (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'allow_no_match',
'bytes',
'format',
'h',
'help',
's',
'time',
'v'
]
const snakeCase = {
allowNoMatch: 'allow_no_match'
}
/**
* Perform a cat.ml_data_frame_analytics request
* Gets configuration and usage information about data frame analytics jobs.
* http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-dfanalytics.html
*/
return function catMlDataFrameAnalytics (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((id) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'data_frame' + '/' + 'analytics'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatMlDataFrameAnalytics

View File

@ -1,84 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatMlDatafeeds (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'allow_no_datafeeds',
'format',
'h',
'help',
's',
'time',
'v'
]
const snakeCase = {
allowNoDatafeeds: 'allow_no_datafeeds'
}
/**
* Perform a cat.ml_datafeeds request
* Gets configuration and usage information about datafeeds.
* http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-datafeeds.html
*/
return function catMlDatafeeds (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, datafeedId, datafeed_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((datafeed_id || datafeedId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatMlDatafeeds

View File

@ -1,85 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatMlJobs (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'allow_no_jobs',
'bytes',
'format',
'h',
'help',
's',
'time',
'v'
]
const snakeCase = {
allowNoJobs: 'allow_no_jobs'
}
/**
* Perform a cat.ml_jobs request
* Gets configuration and usage information about anomaly detection jobs.
* http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-anomaly-detectors.html
*/
return function catMlJobs (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, jobId, job_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((job_id || jobId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'anomaly_detectors'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatMlJobs

View File

@ -1,87 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatMlTrainedModels (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'allow_no_match',
'from',
'size',
'bytes',
'format',
'h',
'help',
's',
'time',
'v'
]
const snakeCase = {
allowNoMatch: 'allow_no_match'
}
/**
* Perform a cat.ml_trained_models request
* Gets configuration and usage information about inference trained models.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-trained-model.html
*/
return function catMlTrainedModels (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, modelId, model_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((model_id || modelId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models' + '/' + encodeURIComponent(model_id || modelId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatMlTrainedModels

View File

@ -1,85 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatNodeattrs (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'format',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.nodeattrs request
* Returns information about custom node attributes.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html
*/
return function catNodeattrs (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'nodeattrs'
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatNodeattrs

View File

@ -1,89 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatNodes (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'bytes',
'format',
'full_id',
'local',
'master_timeout',
'h',
'help',
's',
'time',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
fullId: 'full_id',
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.nodes request
* Returns basic statistics about performance of cluster nodes.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html
*/
return function catNodes (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'nodes'
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatNodes

View File

@ -1,86 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatPendingTasks (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'format',
'local',
'master_timeout',
'h',
'help',
's',
'time',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.pending_tasks request
* Returns a concise representation of the cluster pending tasks.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html
*/
return function catPendingTasks (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'pending_tasks'
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatPendingTasks

View File

@ -1,85 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatPlugins (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'format',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.plugins request
* Returns information about installed plugins across nodes node.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html
*/
return function catPlugins (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'plugins'
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatPlugins

View File

@ -1,93 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatRecovery (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'format',
'active_only',
'bytes',
'detailed',
'h',
'help',
'index',
's',
'time',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
activeOnly: 'active_only',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.recovery request
* Returns information about index shard recoveries, both on-going completed.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html
*/
return function catRecovery (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'recovery' + '/' + encodeURIComponent(index)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'recovery'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatRecovery

View File

@ -1,85 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatRepositories (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'format',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.repositories request
* Returns information about snapshot repositories registered in the cluster.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html
*/
return function catRepositories (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'repositories'
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatRepositories

View File

@ -1,88 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatSegments (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'format',
'bytes',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.segments request
* Provides low-level information about the segments in the shards of an index.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html
*/
return function catSegments (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'segments' + '/' + encodeURIComponent(index)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'segments'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatSegments

View File

@ -1,92 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatShards (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'format',
'bytes',
'local',
'master_timeout',
'h',
'help',
's',
'time',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.shards request
* Provides a detailed view of shard allocation on nodes.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html
*/
return function catShards (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'shards' + '/' + encodeURIComponent(index)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'shards'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatShards

View File

@ -1,92 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatSnapshots (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'format',
'ignore_unavailable',
'master_timeout',
'h',
'help',
's',
'time',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
ignoreUnavailable: 'ignore_unavailable',
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.snapshots request
* Returns all snapshots in a specific repository.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html
*/
return function catSnapshots (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((repository) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'snapshots' + '/' + encodeURIComponent(repository)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'snapshots'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatSnapshots

View File

@ -1,89 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatTasks (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'format',
'node_id',
'actions',
'detailed',
'parent_task',
'h',
'help',
's',
'time',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
nodeId: 'node_id',
parentTask: 'parent_task',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.tasks request
* Returns information about the tasks currently executing on one or more nodes in the cluster.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html
*/
return function catTasks (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'tasks'
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatTasks

View File

@ -1,90 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatTemplates (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'format',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.templates request
* Returns information about existing templates.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html
*/
return function catTemplates (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'templates' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'templates'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatTemplates

View File

@ -1,92 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatThreadPool (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'format',
'size',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cat.thread_pool request
* Returns cluster-wide thread pool statistics per node.
By default the active, queue and rejected statistics are returned for all thread pools.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html
*/
return function catThreadPool (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, threadPoolPatterns, thread_pool_patterns, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((thread_pool_patterns || threadPoolPatterns) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'thread_pool' + '/' + encodeURIComponent(thread_pool_patterns || threadPoolPatterns)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'thread_pool'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatThreadPool

View File

@ -1,86 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatTransforms (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'from',
'size',
'allow_no_match',
'format',
'h',
'help',
's',
'time',
'v'
]
const snakeCase = {
allowNoMatch: 'allow_no_match'
}
/**
* Perform a cat.transforms request
* Gets configuration and usage information about transforms.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-transforms.html
*/
return function catTransforms (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((transform_id || transformId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'transforms'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatTransforms

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

403
api/api/ccr.js Normal file
View File

@ -0,0 +1,403 @@
/*
* 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', 'wait_for_active_shards']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', waitForActiveShards: 'wait_for_active_shards' }
function CcrApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
CcrApi.prototype.deleteAutoFollowPattern = function ccrDeleteAutoFollowPatternApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.follow = function ccrFollowApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'follow'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.followInfo = function ccrFollowInfoApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'info'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.followStats = function ccrFollowStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'stats'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.forgetFollower = function ccrForgetFollowerApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'forget_follower'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.getAutoFollowPattern = function ccrGetAutoFollowPatternApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'GET'
path = '/' + '_ccr' + '/' + 'auto_follow'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.pauseAutoFollowPattern = function ccrPauseAutoFollowPatternApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'POST'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name) + '/' + 'pause'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.pauseFollow = function ccrPauseFollowApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'pause_follow'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.putAutoFollowPattern = function ccrPutAutoFollowPatternApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.resumeAutoFollowPattern = function ccrResumeAutoFollowPatternApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'POST'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name) + '/' + 'resume'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.resumeFollow = function ccrResumeFollowApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'resume_follow'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.stats = function ccrStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_ccr' + '/' + 'stats'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.unfollow = function ccrUnfollowApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'unfollow'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(CcrApi.prototype, {
delete_auto_follow_pattern: { get () { return this.deleteAutoFollowPattern } },
follow_info: { get () { return this.followInfo } },
follow_stats: { get () { return this.followStats } },
forget_follower: { get () { return this.forgetFollower } },
get_auto_follow_pattern: { get () { return this.getAutoFollowPattern } },
pause_auto_follow_pattern: { get () { return this.pauseAutoFollowPattern } },
pause_follow: { get () { return this.pauseFollow } },
put_auto_follow_pattern: { get () { return this.putAutoFollowPattern } },
resume_auto_follow_pattern: { get () { return this.resumeAutoFollowPattern } },
resume_follow: { get () { return this.resumeFollow } }
})
module.exports = CcrApi

View File

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

View File

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

View File

@ -1,82 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCcrPutAutoFollowPattern (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
]
const snakeCase = {
}
/**
* Perform a ccr.put_auto_follow_pattern request
* Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html
*/
return function ccrPutAutoFollowPattern (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['name'] == null) {
const err = new ConfigurationError('Missing required parameter: name')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCcrPutAutoFollowPattern

View File

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

View File

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

View File

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

View File

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

View File

@ -1,82 +1,55 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClearScroll (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
function clearScrollApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
var { method, body, scrollId, scroll_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((scroll_id || scrollId) != null) {
if (method == null) method = 'DELETE'
path = '/' + '_search' + '/' + 'scroll' + '/' + encodeURIComponent(scroll_id || scrollId)
} else {
if (method == null) method = 'DELETE'
path = '/' + '_search' + '/' + 'scroll'
}
/**
* Perform a clear_scroll request
* Explicitly clears the search context for a scroll.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#_clear_scroll_api
*/
return function clearScroll (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, scrollId, scroll_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((scroll_id || scrollId) != null) {
if (method == null) method = 'DELETE'
path = '/' + '_search' + '/' + 'scroll' + '/' + encodeURIComponent(scroll_id || scrollId)
} else {
if (method == null) method = 'DELETE'
path = '/' + '_search' + '/' + 'scroll'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = buildClearScroll
module.exports = clearScrollApi

View File

@ -1,81 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterAllocationExplain (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'include_yes_decisions',
'include_disk_info',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
includeYesDecisions: 'include_yes_decisions',
includeDiskInfo: 'include_disk_info',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cluster.allocation_explain request
* Provides explanations for shard allocations in the cluster.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html
*/
return function clusterAllocationExplain (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_cluster' + '/' + 'allocation' + '/' + 'explain'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildClusterAllocationExplain

View File

@ -1,86 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterDeleteComponentTemplate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'timeout',
'master_timeout',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cluster.delete_component_template request
* Deletes a component template
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html
*/
return function clusterDeleteComponentTemplate (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['name'] == null) {
const err = new ConfigurationError('Missing required parameter: name')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildClusterDeleteComponentTemplate

View File

@ -1,79 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterDeleteVotingConfigExclusions (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'wait_for_removal',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
waitForRemoval: 'wait_for_removal',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cluster.delete_voting_config_exclusions request
* Clears cluster voting config exclusions.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html
*/
return function clusterDeleteVotingConfigExclusions (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_cluster' + '/' + 'voting_config_exclusions'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildClusterDeleteVotingConfigExclusions

View File

@ -1,86 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterExistsComponentTemplate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'master_timeout',
'local',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cluster.exists_component_template request
* Returns information about whether a particular component template exist
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html
*/
return function clusterExistsComponentTemplate (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['name'] == null) {
const err = new ConfigurationError('Missing required parameter: name')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'HEAD'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildClusterExistsComponentTemplate

View File

@ -1,85 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterGetComponentTemplate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'master_timeout',
'local',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cluster.get_component_template request
* Returns one or more component templates
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html
*/
return function clusterGetComponentTemplate (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'GET'
path = '/' + '_component_template'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildClusterGetComponentTemplate

View File

@ -1,84 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterGetSettings (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'flat_settings',
'master_timeout',
'timeout',
'include_defaults',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
flatSettings: 'flat_settings',
masterTimeout: 'master_timeout',
includeDefaults: 'include_defaults',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cluster.get_settings request
* Returns cluster settings.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html
*/
return function clusterGetSettings (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'settings'
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildClusterGetSettings

View File

@ -1,101 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterHealth (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'expand_wildcards',
'level',
'local',
'master_timeout',
'timeout',
'wait_for_active_shards',
'wait_for_nodes',
'wait_for_events',
'wait_for_no_relocating_shards',
'wait_for_no_initializing_shards',
'wait_for_status',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
expandWildcards: 'expand_wildcards',
masterTimeout: 'master_timeout',
waitForActiveShards: 'wait_for_active_shards',
waitForNodes: 'wait_for_nodes',
waitForEvents: 'wait_for_events',
waitForNoRelocatingShards: 'wait_for_no_relocating_shards',
waitForNoInitializingShards: 'wait_for_no_initializing_shards',
waitForStatus: 'wait_for_status',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cluster.health request
* Returns basic information about the health of the cluster.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html
*/
return function clusterHealth (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'health' + '/' + encodeURIComponent(index)
} else {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'health'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildClusterHealth

420
api/api/cluster.js Normal file
View File

@ -0,0 +1,420 @@
/*
* 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 = ['include_yes_decisions', 'include_disk_info', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'timeout', 'master_timeout', 'wait_for_removal', 'local', 'flat_settings', 'include_defaults', 'expand_wildcards', 'level', 'wait_for_active_shards', 'wait_for_nodes', 'wait_for_events', 'wait_for_no_relocating_shards', 'wait_for_no_initializing_shards', 'wait_for_status', 'node_ids', 'node_names', 'create', 'dry_run', 'explain', 'retry_failed', 'metric', 'wait_for_metadata_version', 'wait_for_timeout', 'ignore_unavailable', 'allow_no_indices']
const snakeCase = { includeYesDecisions: 'include_yes_decisions', includeDiskInfo: 'include_disk_info', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', waitForRemoval: 'wait_for_removal', flatSettings: 'flat_settings', includeDefaults: 'include_defaults', expandWildcards: 'expand_wildcards', waitForActiveShards: 'wait_for_active_shards', waitForNodes: 'wait_for_nodes', waitForEvents: 'wait_for_events', waitForNoRelocatingShards: 'wait_for_no_relocating_shards', waitForNoInitializingShards: 'wait_for_no_initializing_shards', waitForStatus: 'wait_for_status', nodeIds: 'node_ids', nodeNames: 'node_names', dryRun: 'dry_run', retryFailed: 'retry_failed', waitForMetadataVersion: 'wait_for_metadata_version', waitForTimeout: 'wait_for_timeout', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices' }
function ClusterApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
ClusterApi.prototype.allocationExplain = function clusterAllocationExplainApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_cluster' + '/' + 'allocation' + '/' + 'explain'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.deleteComponentTemplate = function clusterDeleteComponentTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.deleteVotingConfigExclusions = function clusterDeleteVotingConfigExclusionsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_cluster' + '/' + 'voting_config_exclusions'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.existsComponentTemplate = function clusterExistsComponentTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'HEAD'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.getComponentTemplate = function clusterGetComponentTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'GET'
path = '/' + '_component_template'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.getSettings = function clusterGetSettingsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'settings'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.health = function clusterHealthApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'health' + '/' + encodeURIComponent(index)
} else {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'health'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.pendingTasks = function clusterPendingTasksApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'pending_tasks'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.postVotingConfigExclusions = function clusterPostVotingConfigExclusionsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'POST'
path = '/' + '_cluster' + '/' + 'voting_config_exclusions'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.putComponentTemplate = function clusterPutComponentTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.putSettings = function clusterPutSettingsApi (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)
}
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_cluster' + '/' + 'settings'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.remoteInfo = function clusterRemoteInfoApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_remote' + '/' + 'info'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.reroute = function clusterRerouteApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'POST'
path = '/' + '_cluster' + '/' + 'reroute'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
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)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: metric')
return handleError(err, callback)
}
var { method, body, metric, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((metric) != null && (index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index)
} else if ((metric) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric)
} else {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'state'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, 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
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'stats' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'stats'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(ClusterApi.prototype, {
allocation_explain: { get () { return this.allocationExplain } },
delete_component_template: { get () { return this.deleteComponentTemplate } },
delete_voting_config_exclusions: { get () { return this.deleteVotingConfigExclusions } },
exists_component_template: { get () { return this.existsComponentTemplate } },
get_component_template: { get () { return this.getComponentTemplate } },
get_settings: { get () { return this.getSettings } },
pending_tasks: { get () { return this.pendingTasks } },
post_voting_config_exclusions: { get () { return this.postVotingConfigExclusions } },
put_component_template: { get () { return this.putComponentTemplate } },
put_settings: { get () { return this.putSettings } },
remote_info: { get () { return this.remoteInfo } }
})
module.exports = ClusterApi

View File

@ -1,81 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterPendingTasks (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'local',
'master_timeout',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cluster.pending_tasks request
* Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html
*/
return function clusterPendingTasks (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'pending_tasks'
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildClusterPendingTasks

View File

@ -1,82 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterPostVotingConfigExclusions (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'node_ids',
'node_names',
'timeout',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
nodeIds: 'node_ids',
nodeNames: 'node_names',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cluster.post_voting_config_exclusions request
* Updates the cluster voting config exclusions by node ids or node names.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html
*/
return function clusterPostVotingConfigExclusions (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'POST'
path = '/' + '_cluster' + '/' + 'voting_config_exclusions'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildClusterPostVotingConfigExclusions

View File

@ -1,91 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterPutComponentTemplate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'create',
'timeout',
'master_timeout',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cluster.put_component_template request
* Creates or updates a component template
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html
*/
return function clusterPutComponentTemplate (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['name'] == null) {
const err = new ConfigurationError('Missing required parameter: name')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildClusterPutComponentTemplate

View File

@ -1,88 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterPutSettings (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'flat_settings',
'master_timeout',
'timeout',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
flatSettings: 'flat_settings',
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cluster.put_settings request
* Updates the cluster settings.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html
*/
return function clusterPutSettings (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['body'] == null) {
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_cluster' + '/' + 'settings'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildClusterPutSettings

View File

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

View File

@ -1,86 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterReroute (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'dry_run',
'explain',
'retry_failed',
'metric',
'master_timeout',
'timeout',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
dryRun: 'dry_run',
retryFailed: 'retry_failed',
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cluster.reroute request
* Allows to manually change the allocation of individual shards in the cluster.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html
*/
return function clusterReroute (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'POST'
path = '/' + '_cluster' + '/' + 'reroute'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildClusterReroute

View File

@ -1,106 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterState (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'local',
'master_timeout',
'flat_settings',
'wait_for_metadata_version',
'wait_for_timeout',
'ignore_unavailable',
'allow_no_indices',
'expand_wildcards',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
flatSettings: 'flat_settings',
waitForMetadataVersion: 'wait_for_metadata_version',
waitForTimeout: 'wait_for_timeout',
ignoreUnavailable: 'ignore_unavailable',
allowNoIndices: 'allow_no_indices',
expandWildcards: 'expand_wildcards',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cluster.state request
* Returns a comprehensive information about the state of the cluster.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html
*/
return function clusterState (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required url components
if (params['index'] != null && (params['metric'] == null)) {
const err = new ConfigurationError('Missing required parameter of the url: metric')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, metric, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((metric) != null && (index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index)
} else if ((metric) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric)
} else {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'state'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildClusterState

View File

@ -1,85 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'flat_settings',
'timeout',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
flatSettings: 'flat_settings',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a cluster.stats request
* Returns high-level overview of cluster statistics.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html
*/
return function clusterStats (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, nodeId, node_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'stats' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'stats'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildClusterStats

View File

@ -1,113 +1,64 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCount (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'min_score', 'preference', 'routing', 'q', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'lenient', 'terminate_after', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { ignoreUnavailable: 'ignore_unavailable', ignoreThrottled: 'ignore_throttled', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', minScore: 'min_score', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', terminateAfter: 'terminate_after', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = [
'ignore_unavailable',
'ignore_throttled',
'allow_no_indices',
'expand_wildcards',
'min_score',
'preference',
'routing',
'q',
'analyzer',
'analyze_wildcard',
'default_operator',
'df',
'lenient',
'terminate_after',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
function countApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
const snakeCase = {
ignoreUnavailable: 'ignore_unavailable',
ignoreThrottled: 'ignore_throttled',
allowNoIndices: 'allow_no_indices',
expandWildcards: 'expand_wildcards',
minScore: 'min_score',
analyzeWildcard: 'analyze_wildcard',
defaultOperator: 'default_operator',
terminateAfter: 'terminate_after',
errorTrace: 'error_trace',
filterPath: 'filter_path'
// check required url components
if (params['type'] != null && (params['index'] == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
/**
* Perform a count request
* Returns number of documents matching a query.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html
*/
return function count (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
var { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
// check required url components
if (params['type'] != null && (params['index'] == null)) {
const err = new ConfigurationError('Missing required parameter of the url: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_count'
} else if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_count'
} else {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_count'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_count'
} else if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_count'
} else {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_count'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = buildCount
module.exports = countApi

View File

@ -1,107 +1,69 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCreate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['wait_for_active_shards', 'refresh', 'routing', 'timeout', 'version', 'version_type', 'pipeline', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { waitForActiveShards: 'wait_for_active_shards', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = [
'wait_for_active_shards',
'refresh',
'routing',
'timeout',
'version',
'version_type',
'pipeline',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
function createApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
const snakeCase = {
waitForActiveShards: 'wait_for_active_shards',
versionType: 'version_type',
errorTrace: 'error_trace',
filterPath: 'filter_path'
// check required parameters
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
/**
* Perform a create request
* Creates a new document in the index.
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
Returns a 409 response when a document with a same ID already exists in the index.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html
*/
return function create (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_create'
} else {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_create' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_create'
} else {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_create' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = buildCreate
module.exports = createApi

View File

@ -1,88 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildDanglingIndicesDeleteDanglingIndex (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'accept_data_loss',
'timeout',
'master_timeout',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
acceptDataLoss: 'accept_data_loss',
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a dangling_indices.delete_dangling_index request
* Deletes the specified dangling index
* https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html
*/
return function danglingIndicesDeleteDanglingIndex (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['index_uuid'] == null && params['indexUuid'] == null) {
const err = new ConfigurationError('Missing required parameter: index_uuid or indexUuid')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, indexUuid, index_uuid, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_dangling' + '/' + encodeURIComponent(index_uuid || indexUuid)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildDanglingIndicesDeleteDanglingIndex

View File

@ -1,88 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildDanglingIndicesImportDanglingIndex (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'accept_data_loss',
'timeout',
'master_timeout',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
acceptDataLoss: 'accept_data_loss',
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
/**
* Perform a dangling_indices.import_dangling_index request
* Imports the specified dangling index
* https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html
*/
return function danglingIndicesImportDanglingIndex (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['index_uuid'] == null && params['indexUuid'] == null) {
const err = new ConfigurationError('Missing required parameter: index_uuid or indexUuid')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, indexUuid, index_uuid, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'POST'
path = '/' + '_dangling' + '/' + encodeURIComponent(index_uuid || indexUuid)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildDanglingIndicesImportDanglingIndex

115
api/api/dangling_indices.js Normal file
View File

@ -0,0 +1,115 @@
/*
* 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 = ['accept_data_loss', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { acceptDataLoss: 'accept_data_loss', masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' }
function DanglingIndicesApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
DanglingIndicesApi.prototype.deleteDanglingIndex = function danglingIndicesDeleteDanglingIndexApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
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
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_dangling' + '/' + encodeURIComponent(index_uuid || indexUuid)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
DanglingIndicesApi.prototype.importDanglingIndex = function danglingIndicesImportDanglingIndexApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
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
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'POST'
path = '/' + '_dangling' + '/' + encodeURIComponent(index_uuid || indexUuid)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
DanglingIndicesApi.prototype.listDanglingIndices = function danglingIndicesListDanglingIndicesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_dangling'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(DanglingIndicesApi.prototype, {
delete_dangling_index: { get () { return this.deleteDanglingIndex } },
import_dangling_index: { get () { return this.importDanglingIndex } },
list_dangling_indices: { get () { return this.listDanglingIndices } }
})
module.exports = DanglingIndicesApi

View File

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

View File

@ -1,104 +1,65 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildDelete (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['wait_for_active_shards', 'refresh', 'routing', 'timeout', 'if_seq_no', 'if_primary_term', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { waitForActiveShards: 'wait_for_active_shards', ifSeqNo: 'if_seq_no', ifPrimaryTerm: 'if_primary_term', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = [
'wait_for_active_shards',
'refresh',
'routing',
'timeout',
'if_seq_no',
'if_primary_term',
'version',
'version_type',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
function deleteApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
const snakeCase = {
waitForActiveShards: 'wait_for_active_shards',
ifSeqNo: 'if_seq_no',
ifPrimaryTerm: 'if_primary_term',
versionType: 'version_type',
errorTrace: 'error_trace',
filterPath: 'filter_path'
// check required parameters
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
/**
* Perform a delete request
* Removes a document from the index.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html
*/
return function _delete (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
// check required parameters
if (params['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'DELETE'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
if (method == null) method = 'DELETE'
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'DELETE'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
if (method == null) method = 'DELETE'
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = buildDelete
module.exports = deleteApi

View File

@ -1,147 +1,71 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildDeleteByQuery (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'default_operator', 'df', 'from', 'ignore_unavailable', 'allow_no_indices', 'conflicts', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'scroll', 'search_type', 'search_timeout', 'size', 'max_docs', 'sort', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'terminate_after', 'stats', 'version', 'request_cache', 'refresh', 'timeout', 'wait_for_active_shards', 'scroll_size', 'wait_for_completion', 'requests_per_second', 'slices', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', searchTimeout: 'search_timeout', maxDocs: 'max_docs', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', terminateAfter: 'terminate_after', requestCache: 'request_cache', waitForActiveShards: 'wait_for_active_shards', scrollSize: 'scroll_size', waitForCompletion: 'wait_for_completion', requestsPerSecond: 'requests_per_second', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = [
'analyzer',
'analyze_wildcard',
'default_operator',
'df',
'from',
'ignore_unavailable',
'allow_no_indices',
'conflicts',
'expand_wildcards',
'lenient',
'preference',
'q',
'routing',
'scroll',
'search_type',
'search_timeout',
'size',
'max_docs',
'sort',
'_source',
'_source_excludes',
'_source_includes',
'terminate_after',
'stats',
'version',
'request_cache',
'refresh',
'timeout',
'wait_for_active_shards',
'scroll_size',
'wait_for_completion',
'requests_per_second',
'slices',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
function deleteByQueryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
const snakeCase = {
analyzeWildcard: 'analyze_wildcard',
defaultOperator: 'default_operator',
ignoreUnavailable: 'ignore_unavailable',
allowNoIndices: 'allow_no_indices',
expandWildcards: 'expand_wildcards',
searchType: 'search_type',
searchTimeout: 'search_timeout',
maxDocs: 'max_docs',
_sourceExcludes: '_source_excludes',
_sourceIncludes: '_source_includes',
terminateAfter: 'terminate_after',
requestCache: 'request_cache',
waitForActiveShards: 'wait_for_active_shards',
scrollSize: 'scroll_size',
waitForCompletion: 'wait_for_completion',
requestsPerSecond: 'requests_per_second',
errorTrace: 'error_trace',
filterPath: 'filter_path'
// check required parameters
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
/**
* Perform a delete_by_query request
* Deletes documents matching the provided query.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html
*/
return function deleteByQuery (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['index'] == null) {
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params['type'] != null && (params['index'] == null)) {
const err = new ConfigurationError('Missing required parameter of the url: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_delete_by_query'
} else {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_delete_by_query'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
// check required url components
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
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_delete_by_query'
} else {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_delete_by_query'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = buildDeleteByQuery
module.exports = deleteByQueryApi

View File

@ -1,89 +1,60 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildDeleteByQueryRethrottle (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['requests_per_second', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { requestsPerSecond: 'requests_per_second', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = [
'requests_per_second',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
function deleteByQueryRethrottleApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
const snakeCase = {
requestsPerSecond: 'requests_per_second',
errorTrace: 'error_trace',
filterPath: 'filter_path'
// check required parameters
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) {
const err = new this[kConfigurationError]('Missing required parameter: requests_per_second or requestsPerSecond')
return handleError(err, callback)
}
/**
* Perform a delete_by_query_rethrottle request
* Changes the number of requests per second for a particular Delete By Query operation.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html
*/
return function deleteByQueryRethrottle (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
var { method, body, taskId, task_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
// check required parameters
if (params['task_id'] == null && params['taskId'] == null) {
const err = new ConfigurationError('Missing required parameter: task_id or taskId')
return handleError(err, callback)
}
if (params['requests_per_second'] == null && params['requestsPerSecond'] == null) {
const err = new ConfigurationError('Missing required parameter: requests_per_second or requestsPerSecond')
return handleError(err, callback)
}
var path = ''
if (method == null) method = 'POST'
path = '/' + '_delete_by_query' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_rethrottle'
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, taskId, task_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'POST'
path = '/' + '_delete_by_query' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_rethrottle'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = buildDeleteByQueryRethrottle
module.exports = deleteByQueryRethrottleApi

View File

@ -1,86 +1,56 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildDeleteScript (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = [
'timeout',
'master_timeout',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
function deleteScriptApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
// check required parameters
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
/**
* Perform a delete_script request
* Deletes a script.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html
*/
return function deleteScript (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
// check required parameters
if (params['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_scripts' + '/' + encodeURIComponent(id)
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_scripts' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = buildDeleteScript
module.exports = deleteScriptApi

View File

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

View File

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

View File

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

173
api/api/enrich.js Normal file
View File

@ -0,0 +1,173 @@
/*
* 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', 'wait_for_completion']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletion: 'wait_for_completion' }
function EnrichApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
EnrichApi.prototype.deletePolicy = function enrichDeletePolicyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
EnrichApi.prototype.executePolicy = function enrichExecutePolicyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name) + '/' + '_execute'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
EnrichApi.prototype.getPolicy = function enrichGetPolicyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'GET'
path = '/' + '_enrich' + '/' + 'policy'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
EnrichApi.prototype.putPolicy = function enrichPutPolicyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'PUT'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
EnrichApi.prototype.stats = function enrichStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_enrich' + '/' + '_stats'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(EnrichApi.prototype, {
delete_policy: { get () { return this.deletePolicy } },
execute_policy: { get () { return this.executePolicy } },
get_policy: { get () { return this.getPolicy } },
put_policy: { get () { return this.putPolicy } }
})
module.exports = EnrichApi

View File

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

View File

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

View File

@ -1,78 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildEqlDelete (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
]
const snakeCase = {
}
/**
* Perform a eql.delete request
* Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html
*/
return function eqlDelete (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_eql' + '/' + 'search' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildEqlDelete

View File

@ -1,80 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildEqlGet (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'wait_for_completion_timeout',
'keep_alive'
]
const snakeCase = {
waitForCompletionTimeout: 'wait_for_completion_timeout',
keepAlive: 'keep_alive'
}
/**
* Perform a eql.get request
* Returns async results from previously executed Event Query Language (EQL) search
* https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html
*/
return function eqlGet (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_eql' + '/' + 'search' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildEqlGet

119
api/api/eql.js Normal file
View File

@ -0,0 +1,119 @@
/*
* 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', 'wait_for_completion_timeout', 'keep_alive', 'keep_on_completion']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletionTimeout: 'wait_for_completion_timeout', keepAlive: 'keep_alive', keepOnCompletion: 'keep_on_completion' }
function EqlApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
EqlApi.prototype.delete = function eqlDeleteApi (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)
}
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_eql' + '/' + 'search' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
EqlApi.prototype.get = function eqlGetApi (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)
}
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_eql' + '/' + 'search' + '/' + 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) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_eql' + '/' + 'search'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = EqlApi

View File

@ -1,86 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildEqlSearch (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'wait_for_completion_timeout',
'keep_on_completion',
'keep_alive'
]
const snakeCase = {
waitForCompletionTimeout: 'wait_for_completion_timeout',
keepOnCompletion: 'keep_on_completion',
keepAlive: 'keep_alive'
}
/**
* Perform a eql.search request
* Returns results matching a query expressed in Event Query Language (EQL)
* https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html
*/
return function eqlSearch (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['index'] == null) {
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_eql' + '/' + 'search'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildEqlSearch

View File

@ -1,106 +1,65 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildExists (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = [
'stored_fields',
'preference',
'realtime',
'refresh',
'routing',
'_source',
'_source_excludes',
'_source_includes',
'version',
'version_type',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
function existsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
const snakeCase = {
storedFields: 'stored_fields',
_sourceExcludes: '_source_excludes',
_sourceIncludes: '_source_includes',
versionType: 'version_type',
errorTrace: 'error_trace',
filterPath: 'filter_path'
// check required parameters
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
/**
* Perform a exists request
* Returns information about whether a document exists in an index.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
*/
return function exists (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
// check required parameters
if (params['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = buildExists
module.exports = existsApi

View File

@ -1,113 +1,74 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildExistsSource (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = [
'preference',
'realtime',
'refresh',
'routing',
'_source',
'_source_excludes',
'_source_includes',
'version',
'version_type',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
function existsSourceApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
const snakeCase = {
_sourceExcludes: '_source_excludes',
_sourceIncludes: '_source_includes',
versionType: 'version_type',
errorTrace: 'error_trace',
filterPath: 'filter_path'
// check required parameters
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
/**
* Perform a exists_source request
* Returns information about whether a document source exists in an index.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
*/
return function existsSource (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
// check required url components
if (params['id'] != null && (params['type'] == null || params['index'] == null)) {
const err = new ConfigurationError('Missing required parameter of the url: type, index')
return handleError(err, callback)
} else if (params['type'] != null && (params['index'] == null)) {
const err = new ConfigurationError('Missing required parameter of the url: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
} else {
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
// check required url components
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)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
} else {
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = buildExistsSource
module.exports = existsSourceApi

View File

@ -1,109 +1,65 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildExplain (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['analyze_wildcard', 'analyzer', 'default_operator', 'df', 'stored_fields', 'lenient', 'preference', 'q', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = [
'analyze_wildcard',
'analyzer',
'default_operator',
'df',
'stored_fields',
'lenient',
'preference',
'q',
'routing',
'_source',
'_source_excludes',
'_source_includes',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
function explainApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
const snakeCase = {
analyzeWildcard: 'analyze_wildcard',
defaultOperator: 'default_operator',
storedFields: 'stored_fields',
_sourceExcludes: '_source_excludes',
_sourceIncludes: '_source_includes',
errorTrace: 'error_trace',
filterPath: 'filter_path'
// check required parameters
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
/**
* Perform a explain request
* Returns information about why a specific matches (or doesn't match) a query.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html
*/
return function explain (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
// check required parameters
if (params['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain'
} else {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain'
} else {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = buildExplain
module.exports = explainApi

View File

@ -1,91 +1,55 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildFieldCaps (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['fields', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'include_unmapped', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', includeUnmapped: 'include_unmapped', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = [
'fields',
'ignore_unavailable',
'allow_no_indices',
'expand_wildcards',
'include_unmapped',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
function fieldCapsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
const snakeCase = {
ignoreUnavailable: 'ignore_unavailable',
allowNoIndices: 'allow_no_indices',
expandWildcards: 'expand_wildcards',
includeUnmapped: 'include_unmapped',
errorTrace: 'error_trace',
filterPath: 'filter_path'
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_field_caps'
} else {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_field_caps'
}
/**
* Perform a field_caps request
* Returns the information about the capabilities of fields among multiple indices.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html
*/
return function fieldCaps (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_field_caps'
} else {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_field_caps'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = buildFieldCaps
module.exports = fieldCapsApi

View File

@ -1,106 +1,65 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildGet (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = [
'stored_fields',
'preference',
'realtime',
'refresh',
'routing',
'_source',
'_source_excludes',
'_source_includes',
'version',
'version_type',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
function getApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
const snakeCase = {
storedFields: 'stored_fields',
_sourceExcludes: '_source_excludes',
_sourceIncludes: '_source_includes',
versionType: 'version_type',
errorTrace: 'error_trace',
filterPath: 'filter_path'
// check required parameters
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
/**
* Perform a get request
* Returns a document.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
*/
return function get (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
// check required parameters
if (params['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = buildGet
module.exports = getApi

View File

@ -1,85 +1,56 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildGetScript (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
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' }
const acceptedQuerystring = [
'master_timeout',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
function getScriptApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
// check required parameters
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
/**
* Perform a get_script request
* Returns a script.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html
*/
return function getScript (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
// check required parameters
if (params['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_scripts' + '/' + encodeURIComponent(id)
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_scripts' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = buildGetScript
module.exports = getScriptApi

View File

@ -1,77 +1,50 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildGetScriptContext (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
function getScriptContextApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_script_context'
// build request object
const request = {
method,
path,
body: null,
querystring
}
/**
* Perform a get_script_context request
* Returns all script contexts.
* https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-contexts.html
*/
return function getScriptContext (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_script_context'
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
return this.transport.request(request, options, callback)
}
module.exports = buildGetScriptContext
module.exports = getScriptContextApi

View File

@ -1,77 +1,50 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildGetScriptLanguages (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
function getScriptLanguagesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_script_language'
// build request object
const request = {
method,
path,
body: null,
querystring
}
/**
* Perform a get_script_languages request
* Returns available script types, languages and contexts
* https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html
*/
return function getScriptLanguages (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if (method == null) method = 'GET'
path = '/' + '_script_language'
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
return this.transport.request(request, options, callback)
}
module.exports = buildGetScriptLanguages
module.exports = getScriptLanguagesApi

View File

@ -1,104 +1,65 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildGetSource (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = [
'preference',
'realtime',
'refresh',
'routing',
'_source',
'_source_excludes',
'_source_includes',
'version',
'version_type',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
function getSourceApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
const snakeCase = {
_sourceExcludes: '_source_excludes',
_sourceIncludes: '_source_includes',
versionType: 'version_type',
errorTrace: 'error_trace',
filterPath: 'filter_path'
// check required parameters
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
/**
* Perform a get_source request
* Returns the source of a document.
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
*/
return function getSource (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
// check required parameters
if (params['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
} else {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
var path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
} else {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = buildGetSource
module.exports = getSourceApi

View File

@ -1,90 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildGraphExplore (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'routing',
'timeout'
]
const snakeCase = {
}
/**
* Perform a graph.explore request
* Explore extracted and summarized information about the documents and terms in an index.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html
*/
return function graphExplore (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['index'] == null) {
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
// check required url components
if (params['type'] != null && (params['index'] == null)) {
const err = new ConfigurationError('Missing required parameter of the url: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_graph' + '/' + 'explore'
} else {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_graph' + '/' + 'explore'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildGraphExplore

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