@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.
Files changed (49) hide show
  1. package/README.md +2 -0
  2. package/api/api/async_search.submit.js +4 -0
  3. package/api/api/autoscaling.delete_autoscaling_policy.js +78 -0
  4. package/api/api/autoscaling.get_autoscaling_policy.js +78 -0
  5. package/api/api/autoscaling.put_autoscaling_policy.js +82 -0
  6. package/api/api/bulk.js +4 -0
  7. package/api/api/cluster.delete_component_template.js +1 -1
  8. package/api/api/cluster.delete_voting_config_exclusions.js +79 -0
  9. package/api/api/cluster.exists_component_template.js +86 -0
  10. package/api/api/cluster.get_component_template.js +1 -1
  11. package/api/api/cluster.post_voting_config_exclusions.js +82 -0
  12. package/api/api/cluster.put_component_template.js +1 -1
  13. package/api/api/delete_by_query.js +4 -0
  14. package/api/api/eql.search.js +1 -1
  15. package/api/api/exists.js +4 -0
  16. package/api/api/exists_source.js +4 -0
  17. package/api/api/explain.js +4 -0
  18. package/api/api/get.js +4 -0
  19. package/api/api/get_source.js +4 -0
  20. package/api/api/indices.delete_index_template.js +86 -0
  21. package/api/api/indices.exists_index_template.js +88 -0
  22. package/api/api/indices.get_index_template.js +87 -0
  23. package/api/api/indices.put_index_template.js +91 -0
  24. package/api/api/indices.simulate_index_template.js +87 -0
  25. package/api/api/mget.js +4 -0
  26. package/api/api/ml.delete_data_frame_analytics.js +2 -1
  27. package/api/api/ml.validate.js +1 -0
  28. package/api/api/ml.validate_detector.js +1 -0
  29. package/api/api/search.js +4 -0
  30. package/api/api/searchable_snapshots.clear_cache.js +83 -0
  31. package/api/api/searchable_snapshots.mount.js +94 -0
  32. package/api/api/searchable_snapshots.repository_stats.js +78 -0
  33. package/api/api/searchable_snapshots.stats.js +77 -0
  34. package/api/api/snapshot.cleanup_repository.js +1 -1
  35. package/api/api/tasks.cancel.js +2 -0
  36. package/api/api/update.js +4 -0
  37. package/api/api/update_by_query.js +4 -0
  38. package/api/index.js +39 -1
  39. package/api/requestParams.d.ts +119 -3
  40. package/index.d.ts +156 -16
  41. package/index.js +9 -2
  42. package/lib/Connection.js +8 -2
  43. package/lib/Helpers.d.ts +22 -5
  44. package/lib/Helpers.js +328 -32
  45. package/lib/Transport.js +30 -15
  46. package/lib/pool/BaseConnectionPool.js +2 -0
  47. package/lib/pool/CloudConnectionPool.js +1 -1
  48. package/lib/pool/ConnectionPool.js +12 -2
  49. package/package.json +21 -13
@@ -0,0 +1,94 @@
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 buildSearchableSnapshotsMount (opts) {
11
+ // eslint-disable-next-line no-unused-vars
12
+ const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
13
+
14
+ const acceptedQuerystring = [
15
+ 'master_timeout',
16
+ 'wait_for_completion'
17
+ ]
18
+
19
+ const snakeCase = {
20
+ masterTimeout: 'master_timeout',
21
+ waitForCompletion: 'wait_for_completion'
22
+ }
23
+
24
+ /**
25
+ * Perform a searchable_snapshots.mount request
26
+ * Mount a snapshot as a searchable index.
27
+ * https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-api-mount-snapshot.html
28
+ */
29
+ return function searchableSnapshotsMount (params, options, callback) {
30
+ options = options || {}
31
+ if (typeof options === 'function') {
32
+ callback = options
33
+ options = {}
34
+ }
35
+ if (typeof params === 'function' || params == null) {
36
+ callback = params
37
+ params = {}
38
+ options = {}
39
+ }
40
+
41
+ // check required parameters
42
+ if (params['repository'] == null) {
43
+ const err = new ConfigurationError('Missing required parameter: repository')
44
+ return handleError(err, callback)
45
+ }
46
+ if (params['snapshot'] == null) {
47
+ const err = new ConfigurationError('Missing required parameter: snapshot')
48
+ return handleError(err, callback)
49
+ }
50
+ if (params['body'] == null) {
51
+ const err = new ConfigurationError('Missing required parameter: body')
52
+ return handleError(err, callback)
53
+ }
54
+
55
+ // check required url components
56
+ if (params['snapshot'] != null && (params['repository'] == null)) {
57
+ const err = new ConfigurationError('Missing required parameter of the url: repository')
58
+ return handleError(err, callback)
59
+ }
60
+
61
+ // validate headers object
62
+ if (options.headers != null && typeof options.headers !== 'object') {
63
+ const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
64
+ return handleError(err, callback)
65
+ }
66
+
67
+ var warnings = []
68
+ var { method, body, repository, snapshot, ...querystring } = params
69
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
70
+
71
+ var ignore = options.ignore
72
+ if (typeof ignore === 'number') {
73
+ options.ignore = [ignore]
74
+ }
75
+
76
+ var path = ''
77
+
78
+ if (method == null) method = 'POST'
79
+ path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) + '/' + '_mount'
80
+
81
+ // build request object
82
+ const request = {
83
+ method,
84
+ path,
85
+ body: body || '',
86
+ querystring
87
+ }
88
+
89
+ options.warnings = warnings.length === 0 ? null : warnings
90
+ return makeRequest(request, options, callback)
91
+ }
92
+ }
93
+
94
+ module.exports = buildSearchableSnapshotsMount
@@ -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 buildSearchableSnapshotsRepositoryStats (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 searchable_snapshots.repository_stats request
24
+ * Retrieve usage statistics about a snapshot repository.
25
+ * https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-repository-stats.html
26
+ */
27
+ return function searchableSnapshotsRepositoryStats (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['repository'] == null) {
41
+ const err = new ConfigurationError('Missing required parameter: repository')
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, repository, ...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 = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_stats'
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 = buildSearchableSnapshotsRepositoryStats
@@ -0,0 +1,77 @@
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 buildSearchableSnapshotsStats (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 searchable_snapshots.stats request
24
+ * Retrieve various statistics about searchable snapshots.
25
+ * https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-api-stats.html
26
+ */
27
+ return function searchableSnapshotsStats (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
+ // validate headers object
40
+ if (options.headers != null && typeof options.headers !== 'object') {
41
+ const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
42
+ return handleError(err, callback)
43
+ }
44
+
45
+ var warnings = []
46
+ var { method, body, index, ...querystring } = params
47
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
48
+
49
+ var ignore = options.ignore
50
+ if (typeof ignore === 'number') {
51
+ options.ignore = [ignore]
52
+ }
53
+
54
+ var path = ''
55
+
56
+ if ((index) != null) {
57
+ if (method == null) method = 'GET'
58
+ path = '/' + encodeURIComponent(index) + '/' + '_searchable_snapshots' + '/' + 'stats'
59
+ } else {
60
+ if (method == null) method = 'GET'
61
+ path = '/' + '_searchable_snapshots' + '/' + 'stats'
62
+ }
63
+
64
+ // build request object
65
+ const request = {
66
+ method,
67
+ path,
68
+ body: null,
69
+ querystring
70
+ }
71
+
72
+ options.warnings = warnings.length === 0 ? null : warnings
73
+ return makeRequest(request, options, callback)
74
+ }
75
+ }
76
+
77
+ module.exports = buildSearchableSnapshotsStats
@@ -30,7 +30,7 @@ function buildSnapshotCleanupRepository (opts) {
30
30
  /**
31
31
  * Perform a snapshot.cleanup_repository request
32
32
  * Removes stale data from repository.
33
- * https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html
33
+ * https://www.elastic.co/guide/en/elasticsearch/reference/master/clean-up-snapshot-repo-api.html
34
34
  */
35
35
  return function snapshotCleanupRepository (params, options, callback) {
36
36
  options = options || {}
@@ -15,6 +15,7 @@ function buildTasksCancel (opts) {
15
15
  'nodes',
16
16
  'actions',
17
17
  'parent_task_id',
18
+ 'wait_for_completion',
18
19
  'pretty',
19
20
  'human',
20
21
  'error_trace',
@@ -24,6 +25,7 @@ function buildTasksCancel (opts) {
24
25
 
25
26
  const snakeCase = {
26
27
  parentTaskId: 'parent_task_id',
28
+ waitForCompletion: 'wait_for_completion',
27
29
  errorTrace: 'error_trace',
28
30
  filterPath: 'filter_path'
29
31
  }
package/api/api/update.js CHANGED
@@ -15,7 +15,9 @@ function buildUpdate (opts) {
15
15
  'wait_for_active_shards',
16
16
  '_source',
17
17
  '_source_excludes',
18
+ '_source_exclude',
18
19
  '_source_includes',
20
+ '_source_include',
19
21
  'lang',
20
22
  'refresh',
21
23
  'retry_on_conflict',
@@ -33,7 +35,9 @@ function buildUpdate (opts) {
33
35
  const snakeCase = {
34
36
  waitForActiveShards: 'wait_for_active_shards',
35
37
  _sourceExcludes: '_source_excludes',
38
+ _sourceExclude: '_source_exclude',
36
39
  _sourceIncludes: '_source_includes',
40
+ _sourceInclude: '_source_include',
37
41
  retryOnConflict: 'retry_on_conflict',
38
42
  ifSeqNo: 'if_seq_no',
39
43
  ifPrimaryTerm: 'if_primary_term',
@@ -34,7 +34,9 @@ function buildUpdateByQuery (opts) {
34
34
  'sort',
35
35
  '_source',
36
36
  '_source_excludes',
37
+ '_source_exclude',
37
38
  '_source_includes',
39
+ '_source_include',
38
40
  'terminate_after',
39
41
  'stats',
40
42
  'version',
@@ -64,7 +66,9 @@ function buildUpdateByQuery (opts) {
64
66
  searchTimeout: 'search_timeout',
65
67
  maxDocs: 'max_docs',
66
68
  _sourceExcludes: '_source_excludes',
69
+ _sourceExclude: '_source_exclude',
67
70
  _sourceIncludes: '_source_includes',
71
+ _sourceInclude: '_source_include',
68
72
  terminateAfter: 'terminate_after',
69
73
  versionType: 'version_type',
70
74
  requestCache: 'request_cache',
package/api/index.js CHANGED
@@ -27,8 +27,14 @@ function ESAPI (opts) {
27
27
  submit: lazyLoad('async_search.submit', opts)
28
28
  },
29
29
  autoscaling: {
30
+ delete_autoscaling_policy: lazyLoad('autoscaling.delete_autoscaling_policy', opts),
31
+ deleteAutoscalingPolicy: lazyLoad('autoscaling.delete_autoscaling_policy', opts),
30
32
  get_autoscaling_decision: lazyLoad('autoscaling.get_autoscaling_decision', opts),
31
- getAutoscalingDecision: lazyLoad('autoscaling.get_autoscaling_decision', opts)
33
+ getAutoscalingDecision: lazyLoad('autoscaling.get_autoscaling_decision', opts),
34
+ get_autoscaling_policy: lazyLoad('autoscaling.get_autoscaling_policy', opts),
35
+ getAutoscalingPolicy: lazyLoad('autoscaling.get_autoscaling_policy', opts),
36
+ put_autoscaling_policy: lazyLoad('autoscaling.put_autoscaling_policy', opts),
37
+ putAutoscalingPolicy: lazyLoad('autoscaling.put_autoscaling_policy', opts)
32
38
  },
33
39
  bulk: lazyLoad('bulk', opts),
34
40
  cat: {
@@ -96,6 +102,10 @@ function ESAPI (opts) {
96
102
  allocationExplain: lazyLoad('cluster.allocation_explain', opts),
97
103
  delete_component_template: lazyLoad('cluster.delete_component_template', opts),
98
104
  deleteComponentTemplate: lazyLoad('cluster.delete_component_template', opts),
105
+ delete_voting_config_exclusions: lazyLoad('cluster.delete_voting_config_exclusions', opts),
106
+ deleteVotingConfigExclusions: lazyLoad('cluster.delete_voting_config_exclusions', opts),
107
+ exists_component_template: lazyLoad('cluster.exists_component_template', opts),
108
+ existsComponentTemplate: lazyLoad('cluster.exists_component_template', opts),
99
109
  get_component_template: lazyLoad('cluster.get_component_template', opts),
100
110
  getComponentTemplate: lazyLoad('cluster.get_component_template', opts),
101
111
  get_settings: lazyLoad('cluster.get_settings', opts),
@@ -103,6 +113,8 @@ function ESAPI (opts) {
103
113
  health: lazyLoad('cluster.health', opts),
104
114
  pending_tasks: lazyLoad('cluster.pending_tasks', opts),
105
115
  pendingTasks: lazyLoad('cluster.pending_tasks', opts),
116
+ post_voting_config_exclusions: lazyLoad('cluster.post_voting_config_exclusions', opts),
117
+ postVotingConfigExclusions: lazyLoad('cluster.post_voting_config_exclusions', opts),
106
118
  put_component_template: lazyLoad('cluster.put_component_template', opts),
107
119
  putComponentTemplate: lazyLoad('cluster.put_component_template', opts),
108
120
  put_settings: lazyLoad('cluster.put_settings', opts),
@@ -188,11 +200,15 @@ function ESAPI (opts) {
188
200
  deleteAlias: lazyLoad('indices.delete_alias', opts),
189
201
  delete_data_stream: lazyLoad('indices.delete_data_stream', opts),
190
202
  deleteDataStream: lazyLoad('indices.delete_data_stream', opts),
203
+ delete_index_template: lazyLoad('indices.delete_index_template', opts),
204
+ deleteIndexTemplate: lazyLoad('indices.delete_index_template', opts),
191
205
  delete_template: lazyLoad('indices.delete_template', opts),
192
206
  deleteTemplate: lazyLoad('indices.delete_template', opts),
193
207
  exists: lazyLoad('indices.exists', opts),
194
208
  exists_alias: lazyLoad('indices.exists_alias', opts),
195
209
  existsAlias: lazyLoad('indices.exists_alias', opts),
210
+ exists_index_template: lazyLoad('indices.exists_index_template', opts),
211
+ existsIndexTemplate: lazyLoad('indices.exists_index_template', opts),
196
212
  exists_template: lazyLoad('indices.exists_template', opts),
197
213
  existsTemplate: lazyLoad('indices.exists_template', opts),
198
214
  exists_type: lazyLoad('indices.exists_type', opts),
@@ -209,6 +225,8 @@ function ESAPI (opts) {
209
225
  getDataStreams: lazyLoad('indices.get_data_streams', opts),
210
226
  get_field_mapping: lazyLoad('indices.get_field_mapping', opts),
211
227
  getFieldMapping: lazyLoad('indices.get_field_mapping', opts),
228
+ get_index_template: lazyLoad('indices.get_index_template', opts),
229
+ getIndexTemplate: lazyLoad('indices.get_index_template', opts),
212
230
  get_mapping: lazyLoad('indices.get_mapping', opts),
213
231
  getMapping: lazyLoad('indices.get_mapping', opts),
214
232
  get_settings: lazyLoad('indices.get_settings', opts),
@@ -220,6 +238,8 @@ function ESAPI (opts) {
220
238
  open: lazyLoad('indices.open', opts),
221
239
  put_alias: lazyLoad('indices.put_alias', opts),
222
240
  putAlias: lazyLoad('indices.put_alias', opts),
241
+ put_index_template: lazyLoad('indices.put_index_template', opts),
242
+ putIndexTemplate: lazyLoad('indices.put_index_template', opts),
223
243
  put_mapping: lazyLoad('indices.put_mapping', opts),
224
244
  putMapping: lazyLoad('indices.put_mapping', opts),
225
245
  put_settings: lazyLoad('indices.put_settings', opts),
@@ -235,6 +255,8 @@ function ESAPI (opts) {
235
255
  shard_stores: lazyLoad('indices.shard_stores', opts),
236
256
  shardStores: lazyLoad('indices.shard_stores', opts),
237
257
  shrink: lazyLoad('indices.shrink', opts),
258
+ simulate_index_template: lazyLoad('indices.simulate_index_template', opts),
259
+ simulateIndexTemplate: lazyLoad('indices.simulate_index_template', opts),
238
260
  split: lazyLoad('indices.split', opts),
239
261
  stats: lazyLoad('indices.stats', opts),
240
262
  unfreeze: lazyLoad('indices.unfreeze', opts),
@@ -442,6 +464,22 @@ function ESAPI (opts) {
442
464
  searchShards: lazyLoad('search_shards', opts),
443
465
  search_template: lazyLoad('search_template', opts),
444
466
  searchTemplate: lazyLoad('search_template', opts),
467
+ searchable_snapshots: {
468
+ clear_cache: lazyLoad('searchable_snapshots.clear_cache', opts),
469
+ clearCache: lazyLoad('searchable_snapshots.clear_cache', opts),
470
+ mount: lazyLoad('searchable_snapshots.mount', opts),
471
+ repository_stats: lazyLoad('searchable_snapshots.repository_stats', opts),
472
+ repositoryStats: lazyLoad('searchable_snapshots.repository_stats', opts),
473
+ stats: lazyLoad('searchable_snapshots.stats', opts)
474
+ },
475
+ searchableSnapshots: {
476
+ clear_cache: lazyLoad('searchable_snapshots.clear_cache', opts),
477
+ clearCache: lazyLoad('searchable_snapshots.clear_cache', opts),
478
+ mount: lazyLoad('searchable_snapshots.mount', opts),
479
+ repository_stats: lazyLoad('searchable_snapshots.repository_stats', opts),
480
+ repositoryStats: lazyLoad('searchable_snapshots.repository_stats', opts),
481
+ stats: lazyLoad('searchable_snapshots.stats', opts)
482
+ },
445
483
  security: {
446
484
  authenticate: lazyLoad('security.authenticate', opts),
447
485
  change_password: lazyLoad('security.change_password', opts),