@elastic/elasticsearch 7.7.0-rc.2 → 7.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/api/api/async_search.submit.js +4 -0
- package/api/api/autoscaling.delete_autoscaling_policy.js +78 -0
- package/api/api/autoscaling.get_autoscaling_policy.js +78 -0
- package/api/api/autoscaling.put_autoscaling_policy.js +82 -0
- package/api/api/bulk.js +4 -0
- package/api/api/cluster.delete_component_template.js +1 -1
- package/api/api/cluster.delete_voting_config_exclusions.js +79 -0
- package/api/api/cluster.exists_component_template.js +86 -0
- package/api/api/cluster.get_component_template.js +1 -1
- package/api/api/cluster.post_voting_config_exclusions.js +82 -0
- package/api/api/cluster.put_component_template.js +1 -1
- package/api/api/delete_by_query.js +4 -0
- package/api/api/eql.search.js +1 -1
- package/api/api/exists.js +4 -0
- package/api/api/exists_source.js +4 -0
- package/api/api/explain.js +4 -0
- package/api/api/get.js +4 -0
- package/api/api/get_source.js +4 -0
- package/api/api/indices.delete_index_template.js +86 -0
- package/api/api/indices.exists_index_template.js +88 -0
- package/api/api/indices.get_index_template.js +87 -0
- package/api/api/indices.put_index_template.js +91 -0
- package/api/api/indices.simulate_index_template.js +87 -0
- package/api/api/mget.js +4 -0
- package/api/api/ml.delete_data_frame_analytics.js +2 -1
- package/api/api/ml.validate.js +1 -0
- package/api/api/ml.validate_detector.js +1 -0
- package/api/api/search.js +4 -0
- package/api/api/searchable_snapshots.clear_cache.js +83 -0
- package/api/api/searchable_snapshots.mount.js +94 -0
- package/api/api/searchable_snapshots.repository_stats.js +78 -0
- package/api/api/searchable_snapshots.stats.js +77 -0
- package/api/api/snapshot.cleanup_repository.js +1 -1
- package/api/api/tasks.cancel.js +2 -0
- package/api/api/update.js +4 -0
- package/api/api/update_by_query.js +4 -0
- package/api/index.js +39 -1
- package/api/requestParams.d.ts +119 -3
- package/index.d.ts +156 -16
- package/index.js +9 -2
- package/lib/Connection.js +8 -2
- package/lib/Helpers.d.ts +22 -5
- package/lib/Helpers.js +328 -32
- package/lib/Transport.js +30 -15
- package/lib/pool/BaseConnectionPool.js +2 -0
- package/lib/pool/CloudConnectionPool.js +1 -1
- package/lib/pool/ConnectionPool.js +12 -2
- package/package.json +21 -13
package/README.md
CHANGED
|
@@ -52,6 +52,7 @@ We recommend that you write a lightweight proxy that uses this client instead.
|
|
|
52
52
|
## Documentation
|
|
53
53
|
|
|
54
54
|
- [Introduction](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/introduction.html)
|
|
55
|
+
- [Changelog](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/changelog-client.html)
|
|
55
56
|
- [Usage](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-usage.html)
|
|
56
57
|
- [Client configuration](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-configuration.html)
|
|
57
58
|
- [API reference](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html)
|
|
@@ -62,6 +63,7 @@ We recommend that you write a lightweight proxy that uses this client instead.
|
|
|
62
63
|
- [Extend the client](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/extend-client.html)
|
|
63
64
|
- [Client helpers](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-helpers.html)
|
|
64
65
|
- [Typescript support](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/typescript.html)
|
|
66
|
+
- [Testing](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-testing.html)
|
|
65
67
|
- [Examples](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/examples.html)
|
|
66
68
|
|
|
67
69
|
## Quick start
|
|
@@ -38,7 +38,9 @@ function buildAsyncSearchSubmit (opts) {
|
|
|
38
38
|
'sort',
|
|
39
39
|
'_source',
|
|
40
40
|
'_source_excludes',
|
|
41
|
+
'_source_exclude',
|
|
41
42
|
'_source_includes',
|
|
43
|
+
'_source_include',
|
|
42
44
|
'terminate_after',
|
|
43
45
|
'stats',
|
|
44
46
|
'suggest_field',
|
|
@@ -71,7 +73,9 @@ function buildAsyncSearchSubmit (opts) {
|
|
|
71
73
|
expandWildcards: 'expand_wildcards',
|
|
72
74
|
searchType: 'search_type',
|
|
73
75
|
_sourceExcludes: '_source_excludes',
|
|
76
|
+
_sourceExclude: '_source_exclude',
|
|
74
77
|
_sourceIncludes: '_source_includes',
|
|
78
|
+
_sourceInclude: '_source_include',
|
|
75
79
|
terminateAfter: 'terminate_after',
|
|
76
80
|
suggestField: 'suggest_field',
|
|
77
81
|
suggestMode: 'suggest_mode',
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
+
// See the LICENSE file in the project root for more information
|
|
4
|
+
|
|
5
|
+
'use strict'
|
|
6
|
+
|
|
7
|
+
/* eslint camelcase: 0 */
|
|
8
|
+
/* eslint no-unused-vars: 0 */
|
|
9
|
+
|
|
10
|
+
function buildAutoscalingDeleteAutoscalingPolicy (opts) {
|
|
11
|
+
// eslint-disable-next-line no-unused-vars
|
|
12
|
+
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
|
13
|
+
|
|
14
|
+
const acceptedQuerystring = [
|
|
15
|
+
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
const snakeCase = {
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Perform a autoscaling.delete_autoscaling_policy request
|
|
24
|
+
* Deletes an autoscaling policy.
|
|
25
|
+
* https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-delete-autoscaling-policy.html
|
|
26
|
+
*/
|
|
27
|
+
return function autoscalingDeleteAutoscalingPolicy (params, options, callback) {
|
|
28
|
+
options = options || {}
|
|
29
|
+
if (typeof options === 'function') {
|
|
30
|
+
callback = options
|
|
31
|
+
options = {}
|
|
32
|
+
}
|
|
33
|
+
if (typeof params === 'function' || params == null) {
|
|
34
|
+
callback = params
|
|
35
|
+
params = {}
|
|
36
|
+
options = {}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// check required parameters
|
|
40
|
+
if (params['name'] == null) {
|
|
41
|
+
const err = new ConfigurationError('Missing required parameter: name')
|
|
42
|
+
return handleError(err, callback)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// validate headers object
|
|
46
|
+
if (options.headers != null && typeof options.headers !== 'object') {
|
|
47
|
+
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
|
48
|
+
return handleError(err, callback)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
var warnings = []
|
|
52
|
+
var { method, body, name, ...querystring } = params
|
|
53
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
|
54
|
+
|
|
55
|
+
var ignore = options.ignore
|
|
56
|
+
if (typeof ignore === 'number') {
|
|
57
|
+
options.ignore = [ignore]
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
var path = ''
|
|
61
|
+
|
|
62
|
+
if (method == null) method = 'DELETE'
|
|
63
|
+
path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name)
|
|
64
|
+
|
|
65
|
+
// build request object
|
|
66
|
+
const request = {
|
|
67
|
+
method,
|
|
68
|
+
path,
|
|
69
|
+
body: body || '',
|
|
70
|
+
querystring
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
options.warnings = warnings.length === 0 ? null : warnings
|
|
74
|
+
return makeRequest(request, options, callback)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
module.exports = buildAutoscalingDeleteAutoscalingPolicy
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
+
// See the LICENSE file in the project root for more information
|
|
4
|
+
|
|
5
|
+
'use strict'
|
|
6
|
+
|
|
7
|
+
/* eslint camelcase: 0 */
|
|
8
|
+
/* eslint no-unused-vars: 0 */
|
|
9
|
+
|
|
10
|
+
function buildAutoscalingGetAutoscalingPolicy (opts) {
|
|
11
|
+
// eslint-disable-next-line no-unused-vars
|
|
12
|
+
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
|
13
|
+
|
|
14
|
+
const acceptedQuerystring = [
|
|
15
|
+
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
const snakeCase = {
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Perform a autoscaling.get_autoscaling_policy request
|
|
24
|
+
* Retrieves an autoscaling policy.
|
|
25
|
+
* https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-policy.html
|
|
26
|
+
*/
|
|
27
|
+
return function autoscalingGetAutoscalingPolicy (params, options, callback) {
|
|
28
|
+
options = options || {}
|
|
29
|
+
if (typeof options === 'function') {
|
|
30
|
+
callback = options
|
|
31
|
+
options = {}
|
|
32
|
+
}
|
|
33
|
+
if (typeof params === 'function' || params == null) {
|
|
34
|
+
callback = params
|
|
35
|
+
params = {}
|
|
36
|
+
options = {}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// check required parameters
|
|
40
|
+
if (params['name'] == null) {
|
|
41
|
+
const err = new ConfigurationError('Missing required parameter: name')
|
|
42
|
+
return handleError(err, callback)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// validate headers object
|
|
46
|
+
if (options.headers != null && typeof options.headers !== 'object') {
|
|
47
|
+
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
|
48
|
+
return handleError(err, callback)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
var warnings = []
|
|
52
|
+
var { method, body, name, ...querystring } = params
|
|
53
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
|
54
|
+
|
|
55
|
+
var ignore = options.ignore
|
|
56
|
+
if (typeof ignore === 'number') {
|
|
57
|
+
options.ignore = [ignore]
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
var path = ''
|
|
61
|
+
|
|
62
|
+
if (method == null) method = 'GET'
|
|
63
|
+
path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name)
|
|
64
|
+
|
|
65
|
+
// build request object
|
|
66
|
+
const request = {
|
|
67
|
+
method,
|
|
68
|
+
path,
|
|
69
|
+
body: null,
|
|
70
|
+
querystring
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
options.warnings = warnings.length === 0 ? null : warnings
|
|
74
|
+
return makeRequest(request, options, callback)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
module.exports = buildAutoscalingGetAutoscalingPolicy
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
+
// See the LICENSE file in the project root for more information
|
|
4
|
+
|
|
5
|
+
'use strict'
|
|
6
|
+
|
|
7
|
+
/* eslint camelcase: 0 */
|
|
8
|
+
/* eslint no-unused-vars: 0 */
|
|
9
|
+
|
|
10
|
+
function buildAutoscalingPutAutoscalingPolicy (opts) {
|
|
11
|
+
// eslint-disable-next-line no-unused-vars
|
|
12
|
+
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
|
13
|
+
|
|
14
|
+
const acceptedQuerystring = [
|
|
15
|
+
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
const snakeCase = {
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Perform a autoscaling.put_autoscaling_policy request
|
|
24
|
+
* Creates a new autoscaling policy.
|
|
25
|
+
* https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-put-autoscaling-policy.html
|
|
26
|
+
*/
|
|
27
|
+
return function autoscalingPutAutoscalingPolicy (params, options, callback) {
|
|
28
|
+
options = options || {}
|
|
29
|
+
if (typeof options === 'function') {
|
|
30
|
+
callback = options
|
|
31
|
+
options = {}
|
|
32
|
+
}
|
|
33
|
+
if (typeof params === 'function' || params == null) {
|
|
34
|
+
callback = params
|
|
35
|
+
params = {}
|
|
36
|
+
options = {}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// check required parameters
|
|
40
|
+
if (params['name'] == null) {
|
|
41
|
+
const err = new ConfigurationError('Missing required parameter: name')
|
|
42
|
+
return handleError(err, callback)
|
|
43
|
+
}
|
|
44
|
+
if (params['body'] == null) {
|
|
45
|
+
const err = new ConfigurationError('Missing required parameter: body')
|
|
46
|
+
return handleError(err, callback)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// validate headers object
|
|
50
|
+
if (options.headers != null && typeof options.headers !== 'object') {
|
|
51
|
+
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
|
52
|
+
return handleError(err, callback)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
var warnings = []
|
|
56
|
+
var { method, body, name, ...querystring } = params
|
|
57
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
|
58
|
+
|
|
59
|
+
var ignore = options.ignore
|
|
60
|
+
if (typeof ignore === 'number') {
|
|
61
|
+
options.ignore = [ignore]
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var path = ''
|
|
65
|
+
|
|
66
|
+
if (method == null) method = 'PUT'
|
|
67
|
+
path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name)
|
|
68
|
+
|
|
69
|
+
// build request object
|
|
70
|
+
const request = {
|
|
71
|
+
method,
|
|
72
|
+
path,
|
|
73
|
+
body: body || '',
|
|
74
|
+
querystring
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
options.warnings = warnings.length === 0 ? null : warnings
|
|
78
|
+
return makeRequest(request, options, callback)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
module.exports = buildAutoscalingPutAutoscalingPolicy
|
package/api/api/bulk.js
CHANGED
|
@@ -19,7 +19,9 @@ function buildBulk (opts) {
|
|
|
19
19
|
'type',
|
|
20
20
|
'_source',
|
|
21
21
|
'_source_excludes',
|
|
22
|
+
'_source_exclude',
|
|
22
23
|
'_source_includes',
|
|
24
|
+
'_source_include',
|
|
23
25
|
'pipeline',
|
|
24
26
|
'pretty',
|
|
25
27
|
'human',
|
|
@@ -31,7 +33,9 @@ function buildBulk (opts) {
|
|
|
31
33
|
const snakeCase = {
|
|
32
34
|
waitForActiveShards: 'wait_for_active_shards',
|
|
33
35
|
_sourceExcludes: '_source_excludes',
|
|
36
|
+
_sourceExclude: '_source_exclude',
|
|
34
37
|
_sourceIncludes: '_source_includes',
|
|
38
|
+
_sourceInclude: '_source_include',
|
|
35
39
|
errorTrace: 'error_trace',
|
|
36
40
|
filterPath: 'filter_path'
|
|
37
41
|
}
|
|
@@ -30,7 +30,7 @@ function buildClusterDeleteComponentTemplate (opts) {
|
|
|
30
30
|
/**
|
|
31
31
|
* Perform a cluster.delete_component_template request
|
|
32
32
|
* Deletes a component template
|
|
33
|
-
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-
|
|
33
|
+
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html
|
|
34
34
|
*/
|
|
35
35
|
return function clusterDeleteComponentTemplate (params, options, callback) {
|
|
36
36
|
options = options || {}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
+
// See the LICENSE file in the project root for more information
|
|
4
|
+
|
|
5
|
+
'use strict'
|
|
6
|
+
|
|
7
|
+
/* eslint camelcase: 0 */
|
|
8
|
+
/* eslint no-unused-vars: 0 */
|
|
9
|
+
|
|
10
|
+
function buildClusterDeleteVotingConfigExclusions (opts) {
|
|
11
|
+
// eslint-disable-next-line no-unused-vars
|
|
12
|
+
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
|
13
|
+
|
|
14
|
+
const acceptedQuerystring = [
|
|
15
|
+
'wait_for_removal',
|
|
16
|
+
'pretty',
|
|
17
|
+
'human',
|
|
18
|
+
'error_trace',
|
|
19
|
+
'source',
|
|
20
|
+
'filter_path'
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
const snakeCase = {
|
|
24
|
+
waitForRemoval: 'wait_for_removal',
|
|
25
|
+
errorTrace: 'error_trace',
|
|
26
|
+
filterPath: 'filter_path'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Perform a cluster.delete_voting_config_exclusions request
|
|
31
|
+
* Clears cluster voting config exclusions.
|
|
32
|
+
* https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html
|
|
33
|
+
*/
|
|
34
|
+
return function clusterDeleteVotingConfigExclusions (params, options, callback) {
|
|
35
|
+
options = options || {}
|
|
36
|
+
if (typeof options === 'function') {
|
|
37
|
+
callback = options
|
|
38
|
+
options = {}
|
|
39
|
+
}
|
|
40
|
+
if (typeof params === 'function' || params == null) {
|
|
41
|
+
callback = params
|
|
42
|
+
params = {}
|
|
43
|
+
options = {}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// validate headers object
|
|
47
|
+
if (options.headers != null && typeof options.headers !== 'object') {
|
|
48
|
+
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
|
49
|
+
return handleError(err, callback)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
var warnings = []
|
|
53
|
+
var { method, body, ...querystring } = params
|
|
54
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
|
55
|
+
|
|
56
|
+
var ignore = options.ignore
|
|
57
|
+
if (typeof ignore === 'number') {
|
|
58
|
+
options.ignore = [ignore]
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
var path = ''
|
|
62
|
+
|
|
63
|
+
if (method == null) method = 'DELETE'
|
|
64
|
+
path = '/' + '_cluster' + '/' + 'voting_config_exclusions'
|
|
65
|
+
|
|
66
|
+
// build request object
|
|
67
|
+
const request = {
|
|
68
|
+
method,
|
|
69
|
+
path,
|
|
70
|
+
body: body || '',
|
|
71
|
+
querystring
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
options.warnings = warnings.length === 0 ? null : warnings
|
|
75
|
+
return makeRequest(request, options, callback)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
module.exports = buildClusterDeleteVotingConfigExclusions
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
+
// See the LICENSE file in the project root for more information
|
|
4
|
+
|
|
5
|
+
'use strict'
|
|
6
|
+
|
|
7
|
+
/* eslint camelcase: 0 */
|
|
8
|
+
/* eslint no-unused-vars: 0 */
|
|
9
|
+
|
|
10
|
+
function buildClusterExistsComponentTemplate (opts) {
|
|
11
|
+
// eslint-disable-next-line no-unused-vars
|
|
12
|
+
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
|
13
|
+
|
|
14
|
+
const acceptedQuerystring = [
|
|
15
|
+
'master_timeout',
|
|
16
|
+
'local',
|
|
17
|
+
'pretty',
|
|
18
|
+
'human',
|
|
19
|
+
'error_trace',
|
|
20
|
+
'source',
|
|
21
|
+
'filter_path'
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
const snakeCase = {
|
|
25
|
+
masterTimeout: 'master_timeout',
|
|
26
|
+
errorTrace: 'error_trace',
|
|
27
|
+
filterPath: 'filter_path'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Perform a cluster.exists_component_template request
|
|
32
|
+
* Returns information about whether a particular component template exist
|
|
33
|
+
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html
|
|
34
|
+
*/
|
|
35
|
+
return function clusterExistsComponentTemplate (params, options, callback) {
|
|
36
|
+
options = options || {}
|
|
37
|
+
if (typeof options === 'function') {
|
|
38
|
+
callback = options
|
|
39
|
+
options = {}
|
|
40
|
+
}
|
|
41
|
+
if (typeof params === 'function' || params == null) {
|
|
42
|
+
callback = params
|
|
43
|
+
params = {}
|
|
44
|
+
options = {}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// check required parameters
|
|
48
|
+
if (params['name'] == null) {
|
|
49
|
+
const err = new ConfigurationError('Missing required parameter: name')
|
|
50
|
+
return handleError(err, callback)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// validate headers object
|
|
54
|
+
if (options.headers != null && typeof options.headers !== 'object') {
|
|
55
|
+
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
|
56
|
+
return handleError(err, callback)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var warnings = []
|
|
60
|
+
var { method, body, name, ...querystring } = params
|
|
61
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
|
62
|
+
|
|
63
|
+
var ignore = options.ignore
|
|
64
|
+
if (typeof ignore === 'number') {
|
|
65
|
+
options.ignore = [ignore]
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
var path = ''
|
|
69
|
+
|
|
70
|
+
if (method == null) method = 'HEAD'
|
|
71
|
+
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
|
|
72
|
+
|
|
73
|
+
// build request object
|
|
74
|
+
const request = {
|
|
75
|
+
method,
|
|
76
|
+
path,
|
|
77
|
+
body: null,
|
|
78
|
+
querystring
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
options.warnings = warnings.length === 0 ? null : warnings
|
|
82
|
+
return makeRequest(request, options, callback)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
module.exports = buildClusterExistsComponentTemplate
|
|
@@ -30,7 +30,7 @@ function buildClusterGetComponentTemplate (opts) {
|
|
|
30
30
|
/**
|
|
31
31
|
* Perform a cluster.get_component_template request
|
|
32
32
|
* Returns one or more component templates
|
|
33
|
-
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-
|
|
33
|
+
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html
|
|
34
34
|
*/
|
|
35
35
|
return function clusterGetComponentTemplate (params, options, callback) {
|
|
36
36
|
options = options || {}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
+
// See the LICENSE file in the project root for more information
|
|
4
|
+
|
|
5
|
+
'use strict'
|
|
6
|
+
|
|
7
|
+
/* eslint camelcase: 0 */
|
|
8
|
+
/* eslint no-unused-vars: 0 */
|
|
9
|
+
|
|
10
|
+
function buildClusterPostVotingConfigExclusions (opts) {
|
|
11
|
+
// eslint-disable-next-line no-unused-vars
|
|
12
|
+
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
|
13
|
+
|
|
14
|
+
const acceptedQuerystring = [
|
|
15
|
+
'node_ids',
|
|
16
|
+
'node_names',
|
|
17
|
+
'timeout',
|
|
18
|
+
'pretty',
|
|
19
|
+
'human',
|
|
20
|
+
'error_trace',
|
|
21
|
+
'source',
|
|
22
|
+
'filter_path'
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
const snakeCase = {
|
|
26
|
+
nodeIds: 'node_ids',
|
|
27
|
+
nodeNames: 'node_names',
|
|
28
|
+
errorTrace: 'error_trace',
|
|
29
|
+
filterPath: 'filter_path'
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Perform a cluster.post_voting_config_exclusions request
|
|
34
|
+
* Updates the cluster voting config exclusions by node ids or node names.
|
|
35
|
+
* https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html
|
|
36
|
+
*/
|
|
37
|
+
return function clusterPostVotingConfigExclusions (params, options, callback) {
|
|
38
|
+
options = options || {}
|
|
39
|
+
if (typeof options === 'function') {
|
|
40
|
+
callback = options
|
|
41
|
+
options = {}
|
|
42
|
+
}
|
|
43
|
+
if (typeof params === 'function' || params == null) {
|
|
44
|
+
callback = params
|
|
45
|
+
params = {}
|
|
46
|
+
options = {}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// validate headers object
|
|
50
|
+
if (options.headers != null && typeof options.headers !== 'object') {
|
|
51
|
+
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
|
52
|
+
return handleError(err, callback)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
var warnings = []
|
|
56
|
+
var { method, body, ...querystring } = params
|
|
57
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
|
58
|
+
|
|
59
|
+
var ignore = options.ignore
|
|
60
|
+
if (typeof ignore === 'number') {
|
|
61
|
+
options.ignore = [ignore]
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var path = ''
|
|
65
|
+
|
|
66
|
+
if (method == null) method = 'POST'
|
|
67
|
+
path = '/' + '_cluster' + '/' + 'voting_config_exclusions'
|
|
68
|
+
|
|
69
|
+
// build request object
|
|
70
|
+
const request = {
|
|
71
|
+
method,
|
|
72
|
+
path,
|
|
73
|
+
body: body || '',
|
|
74
|
+
querystring
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
options.warnings = warnings.length === 0 ? null : warnings
|
|
78
|
+
return makeRequest(request, options, callback)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
module.exports = buildClusterPostVotingConfigExclusions
|
|
@@ -31,7 +31,7 @@ function buildClusterPutComponentTemplate (opts) {
|
|
|
31
31
|
/**
|
|
32
32
|
* Perform a cluster.put_component_template request
|
|
33
33
|
* Creates or updates a component template
|
|
34
|
-
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-
|
|
34
|
+
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html
|
|
35
35
|
*/
|
|
36
36
|
return function clusterPutComponentTemplate (params, options, callback) {
|
|
37
37
|
options = options || {}
|
|
@@ -33,7 +33,9 @@ function buildDeleteByQuery (opts) {
|
|
|
33
33
|
'sort',
|
|
34
34
|
'_source',
|
|
35
35
|
'_source_excludes',
|
|
36
|
+
'_source_exclude',
|
|
36
37
|
'_source_includes',
|
|
38
|
+
'_source_include',
|
|
37
39
|
'terminate_after',
|
|
38
40
|
'stats',
|
|
39
41
|
'version',
|
|
@@ -62,7 +64,9 @@ function buildDeleteByQuery (opts) {
|
|
|
62
64
|
searchTimeout: 'search_timeout',
|
|
63
65
|
maxDocs: 'max_docs',
|
|
64
66
|
_sourceExcludes: '_source_excludes',
|
|
67
|
+
_sourceExclude: '_source_exclude',
|
|
65
68
|
_sourceIncludes: '_source_includes',
|
|
69
|
+
_sourceInclude: '_source_include',
|
|
66
70
|
terminateAfter: 'terminate_after',
|
|
67
71
|
requestCache: 'request_cache',
|
|
68
72
|
waitForActiveShards: 'wait_for_active_shards',
|
package/api/api/eql.search.js
CHANGED
|
@@ -22,7 +22,7 @@ function buildEqlSearch (opts) {
|
|
|
22
22
|
/**
|
|
23
23
|
* Perform a eql.search request
|
|
24
24
|
* Returns results matching a query expressed in Event Query Language (EQL)
|
|
25
|
-
* https://www.elastic.co/guide/en/elasticsearch/reference/current/eql.html
|
|
25
|
+
* https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html
|
|
26
26
|
*/
|
|
27
27
|
return function eqlSearch (params, options, callback) {
|
|
28
28
|
options = options || {}
|
package/api/api/exists.js
CHANGED
|
@@ -19,7 +19,9 @@ function buildExists (opts) {
|
|
|
19
19
|
'routing',
|
|
20
20
|
'_source',
|
|
21
21
|
'_source_excludes',
|
|
22
|
+
'_source_exclude',
|
|
22
23
|
'_source_includes',
|
|
24
|
+
'_source_include',
|
|
23
25
|
'version',
|
|
24
26
|
'version_type',
|
|
25
27
|
'pretty',
|
|
@@ -32,7 +34,9 @@ function buildExists (opts) {
|
|
|
32
34
|
const snakeCase = {
|
|
33
35
|
storedFields: 'stored_fields',
|
|
34
36
|
_sourceExcludes: '_source_excludes',
|
|
37
|
+
_sourceExclude: '_source_exclude',
|
|
35
38
|
_sourceIncludes: '_source_includes',
|
|
39
|
+
_sourceInclude: '_source_include',
|
|
36
40
|
versionType: 'version_type',
|
|
37
41
|
errorTrace: 'error_trace',
|
|
38
42
|
filterPath: 'filter_path'
|
package/api/api/exists_source.js
CHANGED
|
@@ -18,7 +18,9 @@ function buildExistsSource (opts) {
|
|
|
18
18
|
'routing',
|
|
19
19
|
'_source',
|
|
20
20
|
'_source_excludes',
|
|
21
|
+
'_source_exclude',
|
|
21
22
|
'_source_includes',
|
|
23
|
+
'_source_include',
|
|
22
24
|
'version',
|
|
23
25
|
'version_type',
|
|
24
26
|
'pretty',
|
|
@@ -30,7 +32,9 @@ function buildExistsSource (opts) {
|
|
|
30
32
|
|
|
31
33
|
const snakeCase = {
|
|
32
34
|
_sourceExcludes: '_source_excludes',
|
|
35
|
+
_sourceExclude: '_source_exclude',
|
|
33
36
|
_sourceIncludes: '_source_includes',
|
|
37
|
+
_sourceInclude: '_source_include',
|
|
34
38
|
versionType: 'version_type',
|
|
35
39
|
errorTrace: 'error_trace',
|
|
36
40
|
filterPath: 'filter_path'
|
package/api/api/explain.js
CHANGED
|
@@ -23,7 +23,9 @@ function buildExplain (opts) {
|
|
|
23
23
|
'routing',
|
|
24
24
|
'_source',
|
|
25
25
|
'_source_excludes',
|
|
26
|
+
'_source_exclude',
|
|
26
27
|
'_source_includes',
|
|
28
|
+
'_source_include',
|
|
27
29
|
'pretty',
|
|
28
30
|
'human',
|
|
29
31
|
'error_trace',
|
|
@@ -36,7 +38,9 @@ function buildExplain (opts) {
|
|
|
36
38
|
defaultOperator: 'default_operator',
|
|
37
39
|
storedFields: 'stored_fields',
|
|
38
40
|
_sourceExcludes: '_source_excludes',
|
|
41
|
+
_sourceExclude: '_source_exclude',
|
|
39
42
|
_sourceIncludes: '_source_includes',
|
|
43
|
+
_sourceInclude: '_source_include',
|
|
40
44
|
errorTrace: 'error_trace',
|
|
41
45
|
filterPath: 'filter_path'
|
|
42
46
|
}
|