@elastic/elasticsearch 7.13.0 → 7.16.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 CHANGED
@@ -28,7 +28,7 @@ npm install @elastic/elasticsearch
28
28
 
29
29
  ### Node.js support
30
30
 
31
- NOTE: The minimum supported version of Node.js is `v10`.
31
+ NOTE: The minimum supported version of Node.js is `v12`.
32
32
 
33
33
  The client versioning follows the Elastc Stack versioning, this means that
34
34
  major, minor, and patch releases are done following a precise schedule that
@@ -49,12 +49,13 @@ of `^7.10.0`).
49
49
 
50
50
  | Node.js Version | Node.js EOL date | End of support |
51
51
  | --------------- |------------------| ---------------------- |
52
- | `8.x` | `December 2019` | `7.11` (early 2021) |
53
- | `10.x` | `Apri 2021` | `7.12` (mid 2021) |
52
+ | `8.x` | `December 2019` | `7.11` (early 2021) |
53
+ | `10.x` | `April 2021` | `7.12` (mid 2021) |
54
54
 
55
55
  ### Compatibility
56
56
 
57
- The library is compatible with all Elasticsearch versions since 5.x, and you should use the same major version of the Elasticsearch instance that you are using.
57
+ Language clients are forward compatible; meaning that clients support communicating with greater or equal minor versions of Elasticsearch.
58
+ Elasticsearch language clients are only backwards compatible with default distributions and without guarantees made.
58
59
 
59
60
  | Elasticsearch Version | Client Version |
60
61
  | --------------------- |----------------|
@@ -23,8 +23,8 @@
23
23
  /* eslint no-unused-vars: 0 */
24
24
 
25
25
  const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26
- 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']
27
- 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' }
26
+ 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', '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']
27
+ 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', 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' }
28
28
 
29
29
  function deleteByQueryApi (params, options, callback) {
30
30
  ;[params, options, callback] = normalizeArguments(params, options, callback)
package/api/api/fleet.js CHANGED
@@ -23,8 +23,8 @@
23
23
  /* eslint no-unused-vars: 0 */
24
24
 
25
25
  const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26
- const acceptedQuerystring = ['wait_for_advance', 'wait_for_index', 'checkpoints', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
27
- const snakeCase = { waitForAdvance: 'wait_for_advance', waitForIndex: 'wait_for_index', errorTrace: 'error_trace', filterPath: 'filter_path' }
26
+ const acceptedQuerystring = ['wait_for_advance', 'wait_for_index', 'checkpoints', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_checkpoints', 'wait_for_checkpoints_timeout', 'allow_partial_search_results']
27
+ const snakeCase = { waitForAdvance: 'wait_for_advance', waitForIndex: 'wait_for_index', errorTrace: 'error_trace', filterPath: 'filter_path', waitForCheckpoints: 'wait_for_checkpoints', waitForCheckpointsTimeout: 'wait_for_checkpoints_timeout', allowPartialSearchResults: 'allow_partial_search_results' }
28
28
 
29
29
  function FleetApi (transport, ConfigurationError) {
30
30
  this.transport = transport
@@ -58,6 +58,65 @@ FleetApi.prototype.globalCheckpoints = function fleetGlobalCheckpointsApi (param
58
58
  return this.transport.request(request, options, callback)
59
59
  }
60
60
 
61
+ FleetApi.prototype.msearch = function fleetMsearchApi (params, options, callback) {
62
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
63
+
64
+ // check required parameters
65
+ if (params.body == null) {
66
+ const err = new this[kConfigurationError]('Missing required parameter: body')
67
+ return handleError(err, callback)
68
+ }
69
+
70
+ let { method, body, index, ...querystring } = params
71
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
72
+
73
+ let path = ''
74
+ if ((index) != null) {
75
+ if (method == null) method = body == null ? 'GET' : 'POST'
76
+ path = '/' + encodeURIComponent(index) + '/' + '_fleet' + '/' + '_fleet_msearch'
77
+ } else {
78
+ if (method == null) method = body == null ? 'GET' : 'POST'
79
+ path = '/' + '_fleet' + '/' + '_fleet_msearch'
80
+ }
81
+
82
+ // build request object
83
+ const request = {
84
+ method,
85
+ path,
86
+ bulkBody: body,
87
+ querystring
88
+ }
89
+
90
+ return this.transport.request(request, options, callback)
91
+ }
92
+
93
+ FleetApi.prototype.search = function fleetSearchApi (params, options, callback) {
94
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
95
+
96
+ // check required parameters
97
+ if (params.index == null) {
98
+ const err = new this[kConfigurationError]('Missing required parameter: index')
99
+ return handleError(err, callback)
100
+ }
101
+
102
+ let { method, body, index, ...querystring } = params
103
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
104
+
105
+ let path = ''
106
+ if (method == null) method = body == null ? 'GET' : 'POST'
107
+ path = '/' + encodeURIComponent(index) + '/' + '_fleet' + '/' + '_fleet_search'
108
+
109
+ // build request object
110
+ const request = {
111
+ method,
112
+ path,
113
+ body: body || '',
114
+ querystring
115
+ }
116
+
117
+ return this.transport.request(request, options, callback)
118
+ }
119
+
61
120
  Object.defineProperties(FleetApi.prototype, {
62
121
  global_checkpoints: { get () { return this.globalCheckpoints } }
63
122
  })
package/api/api/ilm.js CHANGED
@@ -23,8 +23,8 @@
23
23
  /* eslint no-unused-vars: 0 */
24
24
 
25
25
  const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26
- const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'only_managed', 'only_errors']
27
- const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', onlyManaged: 'only_managed', onlyErrors: 'only_errors' }
26
+ const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'only_managed', 'only_errors', 'dry_run']
27
+ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', onlyManaged: 'only_managed', onlyErrors: 'only_errors', dryRun: 'dry_run' }
28
28
 
29
29
  function IlmApi (transport, ConfigurationError) {
30
30
  this.transport = transport
@@ -132,6 +132,27 @@ IlmApi.prototype.getStatus = function ilmGetStatusApi (params, options, callback
132
132
  return this.transport.request(request, options, callback)
133
133
  }
134
134
 
135
+ IlmApi.prototype.migrateToDataTiers = function ilmMigrateToDataTiersApi (params, options, callback) {
136
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
137
+
138
+ let { method, body, ...querystring } = params
139
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
140
+
141
+ let path = ''
142
+ if (method == null) method = 'POST'
143
+ path = '/' + '_ilm' + '/' + 'migrate_to_data_tiers'
144
+
145
+ // build request object
146
+ const request = {
147
+ method,
148
+ path,
149
+ body: body || '',
150
+ querystring
151
+ }
152
+
153
+ return this.transport.request(request, options, callback)
154
+ }
155
+
135
156
  IlmApi.prototype.moveToStep = function ilmMoveToStepApi (params, options, callback) {
136
157
  ;[params, options, callback] = normalizeArguments(params, options, callback)
137
158
 
@@ -287,6 +308,7 @@ Object.defineProperties(IlmApi.prototype, {
287
308
  explain_lifecycle: { get () { return this.explainLifecycle } },
288
309
  get_lifecycle: { get () { return this.getLifecycle } },
289
310
  get_status: { get () { return this.getStatus } },
311
+ migrate_to_data_tiers: { get () { return this.migrateToDataTiers } },
290
312
  move_to_step: { get () { return this.moveToStep } },
291
313
  put_lifecycle: { get () { return this.putLifecycle } },
292
314
  remove_policy: { get () { return this.removePolicy } }
@@ -23,8 +23,8 @@
23
23
  /* eslint no-unused-vars: 0 */
24
24
 
25
25
  const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26
- const acceptedQuerystring = ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'index', 'fielddata', 'fields', 'query', 'request', 'wait_for_active_shards', 'include_type_name', 'local', 'flat_settings', 'include_defaults', 'force', 'wait_if_ongoing', 'flush', 'max_num_segments', 'only_expunge_deletes', 'create', 'cause', 'write_index_only', 'preserve_existing', 'order', 'detailed', 'active_only', 'dry_run', 'verbose', 'status', 'copy_settings', 'completion_fields', 'fielddata_fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments', 'forbid_closed_indices', 'wait_for_completion', 'only_ancient_segments', 'explain', 'q', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'lenient', 'rewrite', 'all_shards']
27
- const snakeCase = { masterTimeout: 'master_timeout', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', waitForActiveShards: 'wait_for_active_shards', includeTypeName: 'include_type_name', flatSettings: 'flat_settings', includeDefaults: 'include_defaults', waitIfOngoing: 'wait_if_ongoing', maxNumSegments: 'max_num_segments', onlyExpungeDeletes: 'only_expunge_deletes', writeIndexOnly: 'write_index_only', preserveExisting: 'preserve_existing', activeOnly: 'active_only', dryRun: 'dry_run', copySettings: 'copy_settings', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments', forbidClosedIndices: 'forbid_closed_indices', waitForCompletion: 'wait_for_completion', onlyAncientSegments: 'only_ancient_segments', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', allShards: 'all_shards' }
26
+ const acceptedQuerystring = ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'index', 'fielddata', 'fields', 'query', 'request', 'wait_for_active_shards', 'include_type_name', 'run_expensive_tasks', 'flush', 'local', 'flat_settings', 'include_defaults', 'force', 'wait_if_ongoing', 'max_num_segments', 'only_expunge_deletes', 'create', 'cause', 'write_index_only', 'preserve_existing', 'order', 'detailed', 'active_only', 'dry_run', 'verbose', 'status', 'copy_settings', 'completion_fields', 'fielddata_fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments', 'forbid_closed_indices', 'wait_for_completion', 'only_ancient_segments', 'explain', 'q', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'lenient', 'rewrite', 'all_shards']
27
+ const snakeCase = { masterTimeout: 'master_timeout', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', waitForActiveShards: 'wait_for_active_shards', includeTypeName: 'include_type_name', runExpensiveTasks: 'run_expensive_tasks', flatSettings: 'flat_settings', includeDefaults: 'include_defaults', waitIfOngoing: 'wait_if_ongoing', maxNumSegments: 'max_num_segments', onlyExpungeDeletes: 'only_expunge_deletes', writeIndexOnly: 'write_index_only', preserveExisting: 'preserve_existing', activeOnly: 'active_only', dryRun: 'dry_run', copySettings: 'copy_settings', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments', forbidClosedIndices: 'forbid_closed_indices', waitForCompletion: 'wait_for_completion', onlyAncientSegments: 'only_ancient_segments', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', allShards: 'all_shards' }
28
28
 
29
29
  function IndicesApi (transport, ConfigurationError) {
30
30
  this.transport = transport
@@ -414,6 +414,33 @@ IndicesApi.prototype.deleteTemplate = function indicesDeleteTemplateApi (params,
414
414
  return this.transport.request(request, options, callback)
415
415
  }
416
416
 
417
+ IndicesApi.prototype.diskUsage = function indicesDiskUsageApi (params, options, callback) {
418
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
419
+
420
+ // check required parameters
421
+ if (params.index == null) {
422
+ const err = new this[kConfigurationError]('Missing required parameter: index')
423
+ return handleError(err, callback)
424
+ }
425
+
426
+ let { method, body, index, ...querystring } = params
427
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
428
+
429
+ let path = ''
430
+ if (method == null) method = 'POST'
431
+ path = '/' + encodeURIComponent(index) + '/' + '_disk_usage'
432
+
433
+ // build request object
434
+ const request = {
435
+ method,
436
+ path,
437
+ body: body || '',
438
+ querystring
439
+ }
440
+
441
+ return this.transport.request(request, options, callback)
442
+ }
443
+
417
444
  IndicesApi.prototype.exists = function indicesExistsApi (params, options, callback) {
418
445
  ;[params, options, callback] = normalizeArguments(params, options, callback)
419
446
 
@@ -564,6 +591,33 @@ IndicesApi.prototype.existsType = function indicesExistsTypeApi (params, options
564
591
  return this.transport.request(request, options, callback)
565
592
  }
566
593
 
594
+ IndicesApi.prototype.fieldUsageStats = function indicesFieldUsageStatsApi (params, options, callback) {
595
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
596
+
597
+ // check required parameters
598
+ if (params.index == null) {
599
+ const err = new this[kConfigurationError]('Missing required parameter: index')
600
+ return handleError(err, callback)
601
+ }
602
+
603
+ let { method, body, index, ...querystring } = params
604
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
605
+
606
+ let path = ''
607
+ if (method == null) method = 'GET'
608
+ path = '/' + encodeURIComponent(index) + '/' + '_field_usage_stats'
609
+
610
+ // build request object
611
+ const request = {
612
+ method,
613
+ path,
614
+ body: null,
615
+ querystring
616
+ }
617
+
618
+ return this.transport.request(request, options, callback)
619
+ }
620
+
567
621
  IndicesApi.prototype.flush = function indicesFlushApi (params, options, callback) {
568
622
  ;[params, options, callback] = normalizeArguments(params, options, callback)
569
623
 
@@ -951,6 +1005,33 @@ IndicesApi.prototype.migrateToDataStream = function indicesMigrateToDataStreamAp
951
1005
  return this.transport.request(request, options, callback)
952
1006
  }
953
1007
 
1008
+ IndicesApi.prototype.modifyDataStream = function indicesModifyDataStreamApi (params, options, callback) {
1009
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
1010
+
1011
+ // check required parameters
1012
+ if (params.body == null) {
1013
+ const err = new this[kConfigurationError]('Missing required parameter: body')
1014
+ return handleError(err, callback)
1015
+ }
1016
+
1017
+ let { method, body, ...querystring } = params
1018
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1019
+
1020
+ let path = ''
1021
+ if (method == null) method = 'POST'
1022
+ path = '/' + '_data_stream' + '/' + '_modify'
1023
+
1024
+ // build request object
1025
+ const request = {
1026
+ method,
1027
+ path,
1028
+ body: body || '',
1029
+ querystring
1030
+ }
1031
+
1032
+ return this.transport.request(request, options, callback)
1033
+ }
1034
+
954
1035
  IndicesApi.prototype.open = function indicesOpenApi (params, options, callback) {
955
1036
  ;[params, options, callback] = normalizeArguments(params, options, callback)
956
1037
 
@@ -1665,10 +1746,12 @@ Object.defineProperties(IndicesApi.prototype, {
1665
1746
  delete_data_stream: { get () { return this.deleteDataStream } },
1666
1747
  delete_index_template: { get () { return this.deleteIndexTemplate } },
1667
1748
  delete_template: { get () { return this.deleteTemplate } },
1749
+ disk_usage: { get () { return this.diskUsage } },
1668
1750
  exists_alias: { get () { return this.existsAlias } },
1669
1751
  exists_index_template: { get () { return this.existsIndexTemplate } },
1670
1752
  exists_template: { get () { return this.existsTemplate } },
1671
1753
  exists_type: { get () { return this.existsType } },
1754
+ field_usage_stats: { get () { return this.fieldUsageStats } },
1672
1755
  flush_synced: { get () { return this.flushSynced } },
1673
1756
  get_alias: { get () { return this.getAlias } },
1674
1757
  get_data_stream: { get () { return this.getDataStream } },
@@ -1679,6 +1762,7 @@ Object.defineProperties(IndicesApi.prototype, {
1679
1762
  get_template: { get () { return this.getTemplate } },
1680
1763
  get_upgrade: { get () { return this.getUpgrade } },
1681
1764
  migrate_to_data_stream: { get () { return this.migrateToDataStream } },
1765
+ modify_data_stream: { get () { return this.modifyDataStream } },
1682
1766
  promote_data_stream: { get () { return this.promoteDataStream } },
1683
1767
  put_alias: { get () { return this.putAlias } },
1684
1768
  put_index_template: { get () { return this.putIndexTemplate } },
package/api/api/ingest.js CHANGED
@@ -23,8 +23,8 @@
23
23
  /* eslint no-unused-vars: 0 */
24
24
 
25
25
  const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26
- const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'summary', 'verbose']
27
- const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' }
26
+ const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'summary', 'if_version', 'verbose']
27
+ const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path', ifVersion: 'if_version' }
28
28
 
29
29
  function IngestApi (transport, ConfigurationError) {
30
30
  this.transport = transport
@@ -57,4 +57,51 @@ MigrationApi.prototype.deprecations = function migrationDeprecationsApi (params,
57
57
  return this.transport.request(request, options, callback)
58
58
  }
59
59
 
60
+ MigrationApi.prototype.getFeatureUpgradeStatus = function migrationGetFeatureUpgradeStatusApi (params, options, callback) {
61
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
62
+
63
+ let { method, body, ...querystring } = params
64
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
65
+
66
+ let path = ''
67
+ if (method == null) method = 'GET'
68
+ path = '/' + '_migration' + '/' + 'system_features'
69
+
70
+ // build request object
71
+ const request = {
72
+ method,
73
+ path,
74
+ body: null,
75
+ querystring
76
+ }
77
+
78
+ return this.transport.request(request, options, callback)
79
+ }
80
+
81
+ MigrationApi.prototype.postFeatureUpgrade = function migrationPostFeatureUpgradeApi (params, options, callback) {
82
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
83
+
84
+ let { method, body, ...querystring } = params
85
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
86
+
87
+ let path = ''
88
+ if (method == null) method = 'POST'
89
+ path = '/' + '_migration' + '/' + 'system_features'
90
+
91
+ // build request object
92
+ const request = {
93
+ method,
94
+ path,
95
+ body: body || '',
96
+ querystring
97
+ }
98
+
99
+ return this.transport.request(request, options, callback)
100
+ }
101
+
102
+ Object.defineProperties(MigrationApi.prototype, {
103
+ get_feature_upgrade_status: { get () { return this.getFeatureUpgradeStatus } },
104
+ post_feature_upgrade: { get () { return this.postFeatureUpgrade } }
105
+ })
106
+
60
107
  module.exports = MigrationApi
package/api/api/ml.js CHANGED
@@ -23,8 +23,8 @@
23
23
  /* eslint no-unused-vars: 0 */
24
24
 
25
25
  const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26
- const acceptedQuerystring = ['allow_no_match', 'allow_no_jobs', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'requests_per_second', 'allow_no_forecasts', 'wait_for_completion', 'lines_to_sample', 'line_merge_size_limit', 'charset', 'format', 'has_header_row', 'column_names', 'delimiter', 'quote', 'should_trim_fields', 'grok_pattern', 'timestamp_field', 'timestamp_format', 'explain', 'calc_interim', 'start', 'end', 'advance_time', 'skip_time', 'duration', 'expires_in', 'max_model_memory', 'expand', 'exclude_interim', 'from', 'size', 'anomaly_score', 'sort', 'desc', 'job_id', 'partition_field_value', 'exclude_generated', 'verbose', 'allow_no_datafeeds', 'influencer_score', 'top_n', 'bucket_span', 'overall_score', 'record_score', 'include', 'include_model_definition', 'decompress_definition', 'tags', 'reset_start', 'reset_end', 'ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'reassign', 'delete_intervening_results', 'enabled']
27
- const snakeCase = { allowNoMatch: 'allow_no_match', allowNoJobs: 'allow_no_jobs', errorTrace: 'error_trace', filterPath: 'filter_path', requestsPerSecond: 'requests_per_second', allowNoForecasts: 'allow_no_forecasts', waitForCompletion: 'wait_for_completion', linesToSample: 'lines_to_sample', lineMergeSizeLimit: 'line_merge_size_limit', hasHeaderRow: 'has_header_row', columnNames: 'column_names', shouldTrimFields: 'should_trim_fields', grokPattern: 'grok_pattern', timestampField: 'timestamp_field', timestampFormat: 'timestamp_format', calcInterim: 'calc_interim', advanceTime: 'advance_time', skipTime: 'skip_time', expiresIn: 'expires_in', maxModelMemory: 'max_model_memory', excludeInterim: 'exclude_interim', anomalyScore: 'anomaly_score', jobId: 'job_id', partitionFieldValue: 'partition_field_value', excludeGenerated: 'exclude_generated', allowNoDatafeeds: 'allow_no_datafeeds', influencerScore: 'influencer_score', topN: 'top_n', bucketSpan: 'bucket_span', overallScore: 'overall_score', recordScore: 'record_score', includeModelDefinition: 'include_model_definition', decompressDefinition: 'decompress_definition', resetStart: 'reset_start', resetEnd: 'reset_end', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', ignoreThrottled: 'ignore_throttled', expandWildcards: 'expand_wildcards', deleteInterveningResults: 'delete_intervening_results' }
26
+ const acceptedQuerystring = ['allow_no_match', 'allow_no_jobs', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'requests_per_second', 'allow_no_forecasts', 'wait_for_completion', 'lines_to_sample', 'line_merge_size_limit', 'charset', 'format', 'has_header_row', 'column_names', 'delimiter', 'quote', 'should_trim_fields', 'grok_pattern', 'timestamp_field', 'timestamp_format', 'explain', 'calc_interim', 'start', 'end', 'advance_time', 'skip_time', 'duration', 'expires_in', 'max_model_memory', 'expand', 'exclude_interim', 'from', 'size', 'anomaly_score', 'sort', 'desc', 'job_id', 'partition_field_value', 'exclude_generated', 'verbose', 'allow_no_datafeeds', 'influencer_score', 'top_n', 'bucket_span', 'overall_score', 'record_score', 'include', 'include_model_definition', 'decompress_definition', 'tags', 'reset_start', 'reset_end', 'ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'defer_definition_decompression', 'reassign', 'delete_intervening_results', 'enabled']
27
+ const snakeCase = { allowNoMatch: 'allow_no_match', allowNoJobs: 'allow_no_jobs', errorTrace: 'error_trace', filterPath: 'filter_path', requestsPerSecond: 'requests_per_second', allowNoForecasts: 'allow_no_forecasts', waitForCompletion: 'wait_for_completion', linesToSample: 'lines_to_sample', lineMergeSizeLimit: 'line_merge_size_limit', hasHeaderRow: 'has_header_row', columnNames: 'column_names', shouldTrimFields: 'should_trim_fields', grokPattern: 'grok_pattern', timestampField: 'timestamp_field', timestampFormat: 'timestamp_format', calcInterim: 'calc_interim', advanceTime: 'advance_time', skipTime: 'skip_time', expiresIn: 'expires_in', maxModelMemory: 'max_model_memory', excludeInterim: 'exclude_interim', anomalyScore: 'anomaly_score', jobId: 'job_id', partitionFieldValue: 'partition_field_value', excludeGenerated: 'exclude_generated', allowNoDatafeeds: 'allow_no_datafeeds', influencerScore: 'influencer_score', topN: 'top_n', bucketSpan: 'bucket_span', overallScore: 'overall_score', recordScore: 'record_score', includeModelDefinition: 'include_model_definition', decompressDefinition: 'decompress_definition', resetStart: 'reset_start', resetEnd: 'reset_end', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', ignoreThrottled: 'ignore_throttled', expandWildcards: 'expand_wildcards', deferDefinitionDecompression: 'defer_definition_decompression', deleteInterveningResults: 'delete_intervening_results' }
28
28
 
29
29
  function MlApi (transport, ConfigurationError) {
30
30
  this.transport = transport
@@ -1493,6 +1493,33 @@ MlApi.prototype.putTrainedModelAlias = function mlPutTrainedModelAliasApi (param
1493
1493
  return this.transport.request(request, options, callback)
1494
1494
  }
1495
1495
 
1496
+ MlApi.prototype.resetJob = function mlResetJobApi (params, options, callback) {
1497
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
1498
+
1499
+ // check required parameters
1500
+ if (params.job_id == null && params.jobId == null) {
1501
+ const err = new this[kConfigurationError]('Missing required parameter: job_id or jobId')
1502
+ return handleError(err, callback)
1503
+ }
1504
+
1505
+ let { method, body, jobId, job_id, ...querystring } = params
1506
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1507
+
1508
+ let path = ''
1509
+ if (method == null) method = 'POST'
1510
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_reset'
1511
+
1512
+ // build request object
1513
+ const request = {
1514
+ method,
1515
+ path,
1516
+ body: body || '',
1517
+ querystring
1518
+ }
1519
+
1520
+ return this.transport.request(request, options, callback)
1521
+ }
1522
+
1496
1523
  MlApi.prototype.revertModelSnapshot = function mlRevertModelSnapshotApi (params, options, callback) {
1497
1524
  ;[params, options, callback] = normalizeArguments(params, options, callback)
1498
1525
 
@@ -1964,6 +1991,7 @@ Object.defineProperties(MlApi.prototype, {
1964
1991
  put_job: { get () { return this.putJob } },
1965
1992
  put_trained_model: { get () { return this.putTrainedModel } },
1966
1993
  put_trained_model_alias: { get () { return this.putTrainedModelAlias } },
1994
+ reset_job: { get () { return this.resetJob } },
1967
1995
  revert_model_snapshot: { get () { return this.revertModelSnapshot } },
1968
1996
  set_upgrade_mode: { get () { return this.setUpgradeMode } },
1969
1997
  start_data_frame_analytics: { get () { return this.startDataFrameAnalytics } },
package/api/api/nodes.js CHANGED
@@ -23,14 +23,78 @@
23
23
  /* eslint no-unused-vars: 0 */
24
24
 
25
25
  const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26
- const acceptedQuerystring = ['interval', 'snapshots', 'threads', 'ignore_idle_threads', 'type', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'flat_settings', 'completion_fields', 'fielddata_fields', 'fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments']
27
- const snakeCase = { ignoreIdleThreads: 'ignore_idle_threads', errorTrace: 'error_trace', filterPath: 'filter_path', flatSettings: 'flat_settings', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments' }
26
+ const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'interval', 'snapshots', 'threads', 'ignore_idle_threads', 'type', 'sort', 'timeout', 'flat_settings', 'completion_fields', 'fielddata_fields', 'fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments']
27
+ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', ignoreIdleThreads: 'ignore_idle_threads', flatSettings: 'flat_settings', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments' }
28
28
 
29
29
  function NodesApi (transport, ConfigurationError) {
30
30
  this.transport = transport
31
31
  this[kConfigurationError] = ConfigurationError
32
32
  }
33
33
 
34
+ NodesApi.prototype.clearRepositoriesMeteringArchive = function nodesClearRepositoriesMeteringArchiveApi (params, options, callback) {
35
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
36
+
37
+ // check required parameters
38
+ if (params.node_id == null && params.nodeId == null) {
39
+ const err = new this[kConfigurationError]('Missing required parameter: node_id or nodeId')
40
+ return handleError(err, callback)
41
+ }
42
+ if (params.max_archive_version == null && params.maxArchiveVersion == null) {
43
+ const err = new this[kConfigurationError]('Missing required parameter: max_archive_version or maxArchiveVersion')
44
+ return handleError(err, callback)
45
+ }
46
+
47
+ // check required url components
48
+ if ((params.max_archive_version != null || params.maxArchiveVersion != null) && ((params.node_id == null && params.nodeId == null))) {
49
+ const err = new this[kConfigurationError]('Missing required parameter of the url: node_id')
50
+ return handleError(err, callback)
51
+ }
52
+
53
+ let { method, body, nodeId, node_id, maxArchiveVersion, max_archive_version, ...querystring } = params
54
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
55
+
56
+ let path = ''
57
+ if (method == null) method = 'DELETE'
58
+ path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + '_repositories_metering' + '/' + encodeURIComponent(max_archive_version || maxArchiveVersion)
59
+
60
+ // build request object
61
+ const request = {
62
+ method,
63
+ path,
64
+ body: body || '',
65
+ querystring
66
+ }
67
+
68
+ return this.transport.request(request, options, callback)
69
+ }
70
+
71
+ NodesApi.prototype.getRepositoriesMeteringInfo = function nodesGetRepositoriesMeteringInfoApi (params, options, callback) {
72
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
73
+
74
+ // check required parameters
75
+ if (params.node_id == null && params.nodeId == null) {
76
+ const err = new this[kConfigurationError]('Missing required parameter: node_id or nodeId')
77
+ return handleError(err, callback)
78
+ }
79
+
80
+ let { method, body, nodeId, node_id, ...querystring } = params
81
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
82
+
83
+ let path = ''
84
+ if (method == null) method = 'GET'
85
+ path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + '_repositories_metering'
86
+
87
+ // build request object
88
+ const request = {
89
+ method,
90
+ path,
91
+ body: null,
92
+ querystring
93
+ }
94
+
95
+ return this.transport.request(request, options, callback)
96
+ }
97
+
34
98
  NodesApi.prototype.hotThreads = function nodesHotThreadsApi (params, options, callback) {
35
99
  ;[params, options, callback] = normalizeArguments(params, options, callback)
36
100
 
@@ -195,6 +259,8 @@ NodesApi.prototype.usage = function nodesUsageApi (params, options, callback) {
195
259
  }
196
260
 
197
261
  Object.defineProperties(NodesApi.prototype, {
262
+ clear_repositories_metering_archive: { get () { return this.clearRepositoriesMeteringArchive } },
263
+ get_repositories_metering_info: { get () { return this.getRepositoriesMeteringInfo } },
198
264
  hot_threads: { get () { return this.hotThreads } },
199
265
  reload_secure_settings: { get () { return this.reloadSecureSettings } }
200
266
  })
@@ -29,17 +29,22 @@ const snakeCase = { ignoreUnavailable: 'ignore_unavailable', expandWildcards: 'e
29
29
  function openPointInTimeApi (params, options, callback) {
30
30
  ;[params, options, callback] = normalizeArguments(params, options, callback)
31
31
 
32
+ // check required parameters
33
+ if (params.index == null) {
34
+ const err = new this[kConfigurationError]('Missing required parameter: index')
35
+ return handleError(err, callback)
36
+ }
37
+ if (params.keep_alive == null && params.keepAlive == null) {
38
+ const err = new this[kConfigurationError]('Missing required parameter: keep_alive or keepAlive')
39
+ return handleError(err, callback)
40
+ }
41
+
32
42
  let { method, body, index, ...querystring } = params
33
43
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
34
44
 
35
45
  let path = ''
36
- if ((index) != null) {
37
- if (method == null) method = 'POST'
38
- path = '/' + encodeURIComponent(index) + '/' + '_pit'
39
- } else {
40
- if (method == null) method = 'POST'
41
- path = '/' + '_pit'
42
- }
46
+ if (method == null) method = 'POST'
47
+ path = '/' + encodeURIComponent(index) + '/' + '_pit'
43
48
 
44
49
  // build request object
45
50
  const request = {
@@ -0,0 +1,87 @@
1
+ /*
2
+ * Licensed to Elasticsearch B.V. under one or more contributor
3
+ * license agreements. See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright
5
+ * ownership. Elasticsearch B.V. licenses this file to you under
6
+ * the Apache License, Version 2.0 (the "License"); you may
7
+ * not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+
20
+ 'use strict'
21
+
22
+ /* eslint camelcase: 0 */
23
+ /* eslint no-unused-vars: 0 */
24
+
25
+ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26
+ const acceptedQuerystring = ['exact_bounds', 'extent', 'grid_precision', 'grid_type', 'size', 'track_total_hits', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
27
+ const snakeCase = { exactBounds: 'exact_bounds', gridPrecision: 'grid_precision', gridType: 'grid_type', trackTotalHits: 'track_total_hits', errorTrace: 'error_trace', filterPath: 'filter_path' }
28
+
29
+ function searchMvtApi (params, options, callback) {
30
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
31
+
32
+ // check required parameters
33
+ if (params.index == null) {
34
+ const err = new this[kConfigurationError]('Missing required parameter: index')
35
+ return handleError(err, callback)
36
+ }
37
+ if (params.field == null) {
38
+ const err = new this[kConfigurationError]('Missing required parameter: field')
39
+ return handleError(err, callback)
40
+ }
41
+ if (params.zoom == null) {
42
+ const err = new this[kConfigurationError]('Missing required parameter: zoom')
43
+ return handleError(err, callback)
44
+ }
45
+ if (params.x == null) {
46
+ const err = new this[kConfigurationError]('Missing required parameter: x')
47
+ return handleError(err, callback)
48
+ }
49
+ if (params.y == null) {
50
+ const err = new this[kConfigurationError]('Missing required parameter: y')
51
+ return handleError(err, callback)
52
+ }
53
+
54
+ // check required url components
55
+ if (params.y != null && (params.x == null || params.zoom == null || params.field == null || params.index == null)) {
56
+ const err = new this[kConfigurationError]('Missing required parameter of the url: x, zoom, field, index')
57
+ return handleError(err, callback)
58
+ } else if (params.x != null && (params.zoom == null || params.field == null || params.index == null)) {
59
+ const err = new this[kConfigurationError]('Missing required parameter of the url: zoom, field, index')
60
+ return handleError(err, callback)
61
+ } else if (params.zoom != null && (params.field == null || params.index == null)) {
62
+ const err = new this[kConfigurationError]('Missing required parameter of the url: field, index')
63
+ return handleError(err, callback)
64
+ } else if (params.field != null && (params.index == null)) {
65
+ const err = new this[kConfigurationError]('Missing required parameter of the url: index')
66
+ return handleError(err, callback)
67
+ }
68
+
69
+ let { method, body, index, field, zoom, x, y, ...querystring } = params
70
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
71
+
72
+ let path = ''
73
+ if (method == null) method = body == null ? 'GET' : 'POST'
74
+ path = '/' + encodeURIComponent(index) + '/' + '_mvt' + '/' + encodeURIComponent(field) + '/' + encodeURIComponent(zoom) + '/' + encodeURIComponent(x) + '/' + encodeURIComponent(y)
75
+
76
+ // build request object
77
+ const request = {
78
+ method,
79
+ path,
80
+ body: body || '',
81
+ querystring
82
+ }
83
+
84
+ return this.transport.request(request, options, callback)
85
+ }
86
+
87
+ module.exports = searchMvtApi