@opensearch-project/opensearch 1.0.0 → 2.0.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 (86) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.json +26 -0
  3. package/.prettierrc.json +5 -0
  4. package/.whitesource +15 -0
  5. package/ADMINS.md +18 -11
  6. package/COMPATIBILITY.md +24 -0
  7. package/DEVELOPER_GUIDE.md +22 -5
  8. package/MAINTAINERS.md +23 -18
  9. package/README.md +102 -106
  10. package/RELEASING.md +3 -3
  11. package/SECURITY.md +1 -1
  12. package/api/api/bulk.js +53 -26
  13. package/api/api/cat.js +354 -264
  14. package/api/api/clear_scroll.js +17 -17
  15. package/api/api/cluster.js +366 -219
  16. package/api/api/count.js +55 -24
  17. package/api/api/create.js +50 -24
  18. package/api/api/dangling_indices.js +95 -51
  19. package/api/api/delete.js +49 -22
  20. package/api/api/delete_by_query.js +88 -25
  21. package/api/api/delete_by_query_rethrottle.js +33 -19
  22. package/api/api/delete_script.js +31 -17
  23. package/api/api/exists.js +55 -22
  24. package/api/api/exists_source.js +60 -27
  25. package/api/api/explain.js +60 -22
  26. package/api/api/features.js +56 -35
  27. package/api/api/field_caps.js +36 -18
  28. package/api/api/get.js +55 -22
  29. package/api/api/get_script.js +30 -17
  30. package/api/api/get_script_context.js +15 -15
  31. package/api/api/get_script_languages.js +15 -15
  32. package/api/api/get_source.js +55 -22
  33. package/api/api/index.js +60 -28
  34. package/api/api/indices.js +1068 -857
  35. package/api/api/info.js +15 -15
  36. package/api/api/ingest.js +132 -96
  37. package/api/api/mget.js +50 -26
  38. package/api/api/msearch.js +49 -26
  39. package/api/api/msearch_template.js +53 -26
  40. package/api/api/mtermvectors.js +48 -24
  41. package/api/api/nodes.js +281 -154
  42. package/api/api/ping.js +15 -15
  43. package/api/api/put_script.js +40 -25
  44. package/api/api/rank_eval.js +37 -20
  45. package/api/api/reindex.js +38 -17
  46. package/api/api/reindex_rethrottle.js +32 -19
  47. package/api/api/render_search_template.js +18 -18
  48. package/api/api/scripts_painless_execute.js +15 -15
  49. package/api/api/scroll.js +31 -17
  50. package/api/api/search.js +108 -24
  51. package/api/api/search_shards.js +36 -18
  52. package/api/api/search_template.js +64 -26
  53. package/api/api/shutdown.js +66 -54
  54. package/api/api/snapshot.js +347 -224
  55. package/api/api/tasks.js +65 -46
  56. package/api/api/terms_enum.js +17 -17
  57. package/api/api/termvectors.js +57 -26
  58. package/api/api/update.js +64 -24
  59. package/api/api/update_by_query.js +89 -23
  60. package/api/api/update_by_query_rethrottle.js +33 -19
  61. package/api/index.js +267 -179
  62. package/api/new.d.ts +2042 -529
  63. package/api/opensearch_dashboards.d.ts +275 -0
  64. package/api/requestParams.d.ts +301 -69
  65. package/api/types.d.ts +6204 -5719
  66. package/api/utils.js +22 -22
  67. package/codecov.yml +2 -2
  68. package/index.d.ts +4779 -934
  69. package/index.js +153 -140
  70. package/index.mjs +9 -9
  71. package/lib/Connection.d.ts +37 -26
  72. package/lib/Connection.js +163 -168
  73. package/lib/Helpers.d.ts +103 -63
  74. package/lib/Helpers.js +398 -371
  75. package/lib/Serializer.d.ts +2 -2
  76. package/lib/Serializer.js +39 -39
  77. package/lib/Transport.d.ts +30 -12
  78. package/lib/Transport.js +383 -324
  79. package/lib/errors.d.ts +25 -7
  80. package/lib/errors.js +75 -71
  81. package/lib/pool/BaseConnectionPool.js +100 -97
  82. package/lib/pool/CloudConnectionPool.js +16 -16
  83. package/lib/pool/ConnectionPool.js +105 -105
  84. package/lib/pool/index.d.ts +8 -6
  85. package/lib/pool/index.js +6 -6
  86. package/package.json +13 -8
@@ -28,129 +28,208 @@
28
28
  * under the License.
29
29
  */
30
30
 
31
- 'use strict'
31
+ 'use strict';
32
32
 
33
33
  /* eslint camelcase: 0 */
34
34
  /* eslint no-unused-vars: 0 */
35
35
 
36
- const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
37
- 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']
38
- 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' }
39
-
40
- function ClusterApi (transport, ConfigurationError) {
41
- this.transport = transport
42
- this[kConfigurationError] = ConfigurationError
36
+ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
37
+ const acceptedQuerystring = [
38
+ 'include_yes_decisions',
39
+ 'include_disk_info',
40
+ 'pretty',
41
+ 'human',
42
+ 'error_trace',
43
+ 'source',
44
+ 'filter_path',
45
+ 'timeout',
46
+ 'cluster_manager_timeout',
47
+ 'master_timeout',
48
+ 'wait_for_removal',
49
+ 'local',
50
+ 'flat_settings',
51
+ 'include_defaults',
52
+ 'expand_wildcards',
53
+ 'level',
54
+ 'wait_for_active_shards',
55
+ 'wait_for_nodes',
56
+ 'wait_for_events',
57
+ 'wait_for_no_relocating_shards',
58
+ 'wait_for_no_initializing_shards',
59
+ 'wait_for_status',
60
+ 'node_ids',
61
+ 'node_names',
62
+ 'create',
63
+ 'dry_run',
64
+ 'explain',
65
+ 'retry_failed',
66
+ 'metric',
67
+ 'wait_for_metadata_version',
68
+ 'wait_for_timeout',
69
+ 'ignore_unavailable',
70
+ 'allow_no_indices',
71
+ ];
72
+ const snakeCase = {
73
+ includeYesDecisions: 'include_yes_decisions',
74
+ includeDiskInfo: 'include_disk_info',
75
+ errorTrace: 'error_trace',
76
+ filterPath: 'filter_path',
77
+ clusterManagerTimeout: 'cluster_manager_timeout',
78
+ masterTimeout: 'master_timeout',
79
+ waitForRemoval: 'wait_for_removal',
80
+ flatSettings: 'flat_settings',
81
+ includeDefaults: 'include_defaults',
82
+ expandWildcards: 'expand_wildcards',
83
+ waitForActiveShards: 'wait_for_active_shards',
84
+ waitForNodes: 'wait_for_nodes',
85
+ waitForEvents: 'wait_for_events',
86
+ waitForNoRelocatingShards: 'wait_for_no_relocating_shards',
87
+ waitForNoInitializingShards: 'wait_for_no_initializing_shards',
88
+ waitForStatus: 'wait_for_status',
89
+ nodeIds: 'node_ids',
90
+ nodeNames: 'node_names',
91
+ dryRun: 'dry_run',
92
+ retryFailed: 'retry_failed',
93
+ waitForMetadataVersion: 'wait_for_metadata_version',
94
+ waitForTimeout: 'wait_for_timeout',
95
+ ignoreUnavailable: 'ignore_unavailable',
96
+ allowNoIndices: 'allow_no_indices',
97
+ };
98
+
99
+ function ClusterApi(transport, ConfigurationError) {
100
+ this.transport = transport;
101
+ this[kConfigurationError] = ConfigurationError;
43
102
  }
44
103
 
45
- ClusterApi.prototype.allocationExplain = function clusterAllocationExplainApi (params, options, callback) {
46
- ;[params, options, callback] = normalizeArguments(params, options, callback)
104
+ ClusterApi.prototype.allocationExplain = function clusterAllocationExplainApi(
105
+ params,
106
+ options,
107
+ callback
108
+ ) {
109
+ [params, options, callback] = normalizeArguments(params, options, callback);
47
110
 
48
- let { method, body, ...querystring } = params
49
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
111
+ let { method, body, ...querystring } = params;
112
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
50
113
 
51
- let path = ''
52
- if (method == null) method = body == null ? 'GET' : 'POST'
53
- path = '/' + '_cluster' + '/' + 'allocation' + '/' + 'explain'
114
+ let path = '';
115
+ if (method == null) method = body == null ? 'GET' : 'POST';
116
+ path = '/' + '_cluster' + '/' + 'allocation' + '/' + 'explain';
54
117
 
55
118
  // build request object
56
119
  const request = {
57
120
  method,
58
121
  path,
59
122
  body: body || '',
60
- querystring
61
- }
123
+ querystring,
124
+ };
62
125
 
63
- return this.transport.request(request, options, callback)
64
- }
126
+ return this.transport.request(request, options, callback);
127
+ };
65
128
 
66
- ClusterApi.prototype.deleteComponentTemplate = function clusterDeleteComponentTemplateApi (params, options, callback) {
67
- ;[params, options, callback] = normalizeArguments(params, options, callback)
129
+ ClusterApi.prototype.deleteComponentTemplate = function clusterDeleteComponentTemplateApi(
130
+ params,
131
+ options,
132
+ callback
133
+ ) {
134
+ [params, options, callback] = normalizeArguments(params, options, callback);
68
135
 
69
136
  // check required parameters
70
137
  if (params.name == null) {
71
- const err = new this[kConfigurationError]('Missing required parameter: name')
72
- return handleError(err, callback)
138
+ const err = new this[kConfigurationError]('Missing required parameter: name');
139
+ return handleError(err, callback);
73
140
  }
74
141
 
75
- let { method, body, name, ...querystring } = params
76
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
142
+ let { method, body, name, ...querystring } = params;
143
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
77
144
 
78
- let path = ''
79
- if (method == null) method = 'DELETE'
80
- path = '/' + '_component_template' + '/' + encodeURIComponent(name)
145
+ let path = '';
146
+ if (method == null) method = 'DELETE';
147
+ path = '/' + '_component_template' + '/' + encodeURIComponent(name);
81
148
 
82
149
  // build request object
83
150
  const request = {
84
151
  method,
85
152
  path,
86
153
  body: body || '',
87
- querystring
88
- }
154
+ querystring,
155
+ };
89
156
 
90
- return this.transport.request(request, options, callback)
91
- }
157
+ return this.transport.request(request, options, callback);
158
+ };
92
159
 
93
- ClusterApi.prototype.deleteVotingConfigExclusions = function clusterDeleteVotingConfigExclusionsApi (params, options, callback) {
94
- ;[params, options, callback] = normalizeArguments(params, options, callback)
160
+ ClusterApi.prototype.deleteVotingConfigExclusions = function clusterDeleteVotingConfigExclusionsApi(
161
+ params,
162
+ options,
163
+ callback
164
+ ) {
165
+ [params, options, callback] = normalizeArguments(params, options, callback);
95
166
 
96
- let { method, body, ...querystring } = params
97
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
167
+ let { method, body, ...querystring } = params;
168
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
98
169
 
99
- let path = ''
100
- if (method == null) method = 'DELETE'
101
- path = '/' + '_cluster' + '/' + 'voting_config_exclusions'
170
+ let path = '';
171
+ if (method == null) method = 'DELETE';
172
+ path = '/' + '_cluster' + '/' + 'voting_config_exclusions';
102
173
 
103
174
  // build request object
104
175
  const request = {
105
176
  method,
106
177
  path,
107
178
  body: body || '',
108
- querystring
109
- }
179
+ querystring,
180
+ };
110
181
 
111
- return this.transport.request(request, options, callback)
112
- }
182
+ return this.transport.request(request, options, callback);
183
+ };
113
184
 
114
- ClusterApi.prototype.existsComponentTemplate = function clusterExistsComponentTemplateApi (params, options, callback) {
115
- ;[params, options, callback] = normalizeArguments(params, options, callback)
185
+ ClusterApi.prototype.existsComponentTemplate = function clusterExistsComponentTemplateApi(
186
+ params,
187
+ options,
188
+ callback
189
+ ) {
190
+ [params, options, callback] = normalizeArguments(params, options, callback);
116
191
 
117
192
  // check required parameters
118
193
  if (params.name == null) {
119
- const err = new this[kConfigurationError]('Missing required parameter: name')
120
- return handleError(err, callback)
194
+ const err = new this[kConfigurationError]('Missing required parameter: name');
195
+ return handleError(err, callback);
121
196
  }
122
197
 
123
- let { method, body, name, ...querystring } = params
124
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
198
+ let { method, body, name, ...querystring } = params;
199
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
125
200
 
126
- let path = ''
127
- if (method == null) method = 'HEAD'
128
- path = '/' + '_component_template' + '/' + encodeURIComponent(name)
201
+ let path = '';
202
+ if (method == null) method = 'HEAD';
203
+ path = '/' + '_component_template' + '/' + encodeURIComponent(name);
129
204
 
130
205
  // build request object
131
206
  const request = {
132
207
  method,
133
208
  path,
134
209
  body: null,
135
- querystring
136
- }
137
-
138
- return this.transport.request(request, options, callback)
139
- }
140
-
141
- ClusterApi.prototype.getComponentTemplate = function clusterGetComponentTemplateApi (params, options, callback) {
142
- ;[params, options, callback] = normalizeArguments(params, options, callback)
143
-
144
- let { method, body, name, ...querystring } = params
145
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
146
-
147
- let path = ''
148
- if ((name) != null) {
149
- if (method == null) method = 'GET'
150
- path = '/' + '_component_template' + '/' + encodeURIComponent(name)
210
+ querystring,
211
+ };
212
+
213
+ return this.transport.request(request, options, callback);
214
+ };
215
+
216
+ ClusterApi.prototype.getComponentTemplate = function clusterGetComponentTemplateApi(
217
+ params,
218
+ options,
219
+ callback
220
+ ) {
221
+ [params, options, callback] = normalizeArguments(params, options, callback);
222
+
223
+ let { method, body, name, ...querystring } = params;
224
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
225
+
226
+ let path = '';
227
+ if (name != null) {
228
+ if (method == null) method = 'GET';
229
+ path = '/' + '_component_template' + '/' + encodeURIComponent(name);
151
230
  } else {
152
- if (method == null) method = 'GET'
153
- path = '/' + '_component_template'
231
+ if (method == null) method = 'GET';
232
+ path = '/' + '_component_template';
154
233
  }
155
234
 
156
235
  // build request object
@@ -158,46 +237,46 @@ ClusterApi.prototype.getComponentTemplate = function clusterGetComponentTemplate
158
237
  method,
159
238
  path,
160
239
  body: null,
161
- querystring
162
- }
240
+ querystring,
241
+ };
163
242
 
164
- return this.transport.request(request, options, callback)
165
- }
243
+ return this.transport.request(request, options, callback);
244
+ };
166
245
 
167
- ClusterApi.prototype.getSettings = function clusterGetSettingsApi (params, options, callback) {
168
- ;[params, options, callback] = normalizeArguments(params, options, callback)
246
+ ClusterApi.prototype.getSettings = function clusterGetSettingsApi(params, options, callback) {
247
+ [params, options, callback] = normalizeArguments(params, options, callback);
169
248
 
170
- let { method, body, ...querystring } = params
171
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
249
+ let { method, body, ...querystring } = params;
250
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
172
251
 
173
- let path = ''
174
- if (method == null) method = 'GET'
175
- path = '/' + '_cluster' + '/' + 'settings'
252
+ let path = '';
253
+ if (method == null) method = 'GET';
254
+ path = '/' + '_cluster' + '/' + 'settings';
176
255
 
177
256
  // build request object
178
257
  const request = {
179
258
  method,
180
259
  path,
181
260
  body: null,
182
- querystring
183
- }
261
+ querystring,
262
+ };
184
263
 
185
- return this.transport.request(request, options, callback)
186
- }
264
+ return this.transport.request(request, options, callback);
265
+ };
187
266
 
188
- ClusterApi.prototype.health = function clusterHealthApi (params, options, callback) {
189
- ;[params, options, callback] = normalizeArguments(params, options, callback)
267
+ ClusterApi.prototype.health = function clusterHealthApi(params, options, callback) {
268
+ [params, options, callback] = normalizeArguments(params, options, callback);
190
269
 
191
- let { method, body, index, ...querystring } = params
192
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
270
+ let { method, body, index, ...querystring } = params;
271
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
193
272
 
194
- let path = ''
195
- if ((index) != null) {
196
- if (method == null) method = 'GET'
197
- path = '/' + '_cluster' + '/' + 'health' + '/' + encodeURIComponent(index)
273
+ let path = '';
274
+ if (index != null) {
275
+ if (method == null) method = 'GET';
276
+ path = '/' + '_cluster' + '/' + 'health' + '/' + encodeURIComponent(index);
198
277
  } else {
199
- if (method == null) method = 'GET'
200
- path = '/' + '_cluster' + '/' + 'health'
278
+ if (method == null) method = 'GET';
279
+ path = '/' + '_cluster' + '/' + 'health';
201
280
  }
202
281
 
203
282
  // build request object
@@ -205,176 +284,192 @@ ClusterApi.prototype.health = function clusterHealthApi (params, options, callba
205
284
  method,
206
285
  path,
207
286
  body: null,
208
- querystring
209
- }
287
+ querystring,
288
+ };
210
289
 
211
- return this.transport.request(request, options, callback)
212
- }
290
+ return this.transport.request(request, options, callback);
291
+ };
213
292
 
214
- ClusterApi.prototype.pendingTasks = function clusterPendingTasksApi (params, options, callback) {
215
- ;[params, options, callback] = normalizeArguments(params, options, callback)
293
+ ClusterApi.prototype.pendingTasks = function clusterPendingTasksApi(params, options, callback) {
294
+ [params, options, callback] = normalizeArguments(params, options, callback);
216
295
 
217
- let { method, body, ...querystring } = params
218
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
296
+ let { method, body, ...querystring } = params;
297
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
219
298
 
220
- let path = ''
221
- if (method == null) method = 'GET'
222
- path = '/' + '_cluster' + '/' + 'pending_tasks'
299
+ let path = '';
300
+ if (method == null) method = 'GET';
301
+ path = '/' + '_cluster' + '/' + 'pending_tasks';
223
302
 
224
303
  // build request object
225
304
  const request = {
226
305
  method,
227
306
  path,
228
307
  body: null,
229
- querystring
230
- }
308
+ querystring,
309
+ };
231
310
 
232
- return this.transport.request(request, options, callback)
233
- }
311
+ return this.transport.request(request, options, callback);
312
+ };
234
313
 
235
- ClusterApi.prototype.postVotingConfigExclusions = function clusterPostVotingConfigExclusionsApi (params, options, callback) {
236
- ;[params, options, callback] = normalizeArguments(params, options, callback)
314
+ ClusterApi.prototype.postVotingConfigExclusions = function clusterPostVotingConfigExclusionsApi(
315
+ params,
316
+ options,
317
+ callback
318
+ ) {
319
+ [params, options, callback] = normalizeArguments(params, options, callback);
237
320
 
238
- let { method, body, ...querystring } = params
239
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
321
+ let { method, body, ...querystring } = params;
322
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
240
323
 
241
- let path = ''
242
- if (method == null) method = 'POST'
243
- path = '/' + '_cluster' + '/' + 'voting_config_exclusions'
324
+ let path = '';
325
+ if (method == null) method = 'POST';
326
+ path = '/' + '_cluster' + '/' + 'voting_config_exclusions';
244
327
 
245
328
  // build request object
246
329
  const request = {
247
330
  method,
248
331
  path,
249
332
  body: body || '',
250
- querystring
251
- }
333
+ querystring,
334
+ };
252
335
 
253
- return this.transport.request(request, options, callback)
254
- }
336
+ return this.transport.request(request, options, callback);
337
+ };
255
338
 
256
- ClusterApi.prototype.putComponentTemplate = function clusterPutComponentTemplateApi (params, options, callback) {
257
- ;[params, options, callback] = normalizeArguments(params, options, callback)
339
+ ClusterApi.prototype.putComponentTemplate = function clusterPutComponentTemplateApi(
340
+ params,
341
+ options,
342
+ callback
343
+ ) {
344
+ [params, options, callback] = normalizeArguments(params, options, callback);
258
345
 
259
346
  // check required parameters
260
347
  if (params.name == null) {
261
- const err = new this[kConfigurationError]('Missing required parameter: name')
262
- return handleError(err, callback)
348
+ const err = new this[kConfigurationError]('Missing required parameter: name');
349
+ return handleError(err, callback);
263
350
  }
264
351
  if (params.body == null) {
265
- const err = new this[kConfigurationError]('Missing required parameter: body')
266
- return handleError(err, callback)
352
+ const err = new this[kConfigurationError]('Missing required parameter: body');
353
+ return handleError(err, callback);
267
354
  }
268
355
 
269
- let { method, body, name, ...querystring } = params
270
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
356
+ let { method, body, name, ...querystring } = params;
357
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
271
358
 
272
- let path = ''
273
- if (method == null) method = 'PUT'
274
- path = '/' + '_component_template' + '/' + encodeURIComponent(name)
359
+ let path = '';
360
+ if (method == null) method = 'PUT';
361
+ path = '/' + '_component_template' + '/' + encodeURIComponent(name);
275
362
 
276
363
  // build request object
277
364
  const request = {
278
365
  method,
279
366
  path,
280
367
  body: body || '',
281
- querystring
282
- }
368
+ querystring,
369
+ };
283
370
 
284
- return this.transport.request(request, options, callback)
285
- }
371
+ return this.transport.request(request, options, callback);
372
+ };
286
373
 
287
- ClusterApi.prototype.putSettings = function clusterPutSettingsApi (params, options, callback) {
288
- ;[params, options, callback] = normalizeArguments(params, options, callback)
374
+ ClusterApi.prototype.putSettings = function clusterPutSettingsApi(params, options, callback) {
375
+ [params, options, callback] = normalizeArguments(params, options, callback);
289
376
 
290
377
  // check required parameters
291
378
  if (params.body == null) {
292
- const err = new this[kConfigurationError]('Missing required parameter: body')
293
- return handleError(err, callback)
379
+ const err = new this[kConfigurationError]('Missing required parameter: body');
380
+ return handleError(err, callback);
294
381
  }
295
382
 
296
- let { method, body, ...querystring } = params
297
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
383
+ let { method, body, ...querystring } = params;
384
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
298
385
 
299
- let path = ''
300
- if (method == null) method = 'PUT'
301
- path = '/' + '_cluster' + '/' + 'settings'
386
+ let path = '';
387
+ if (method == null) method = 'PUT';
388
+ path = '/' + '_cluster' + '/' + 'settings';
302
389
 
303
390
  // build request object
304
391
  const request = {
305
392
  method,
306
393
  path,
307
394
  body: body || '',
308
- querystring
309
- }
395
+ querystring,
396
+ };
310
397
 
311
- return this.transport.request(request, options, callback)
312
- }
398
+ return this.transport.request(request, options, callback);
399
+ };
313
400
 
314
- ClusterApi.prototype.remoteInfo = function clusterRemoteInfoApi (params, options, callback) {
315
- ;[params, options, callback] = normalizeArguments(params, options, callback)
401
+ ClusterApi.prototype.remoteInfo = function clusterRemoteInfoApi(params, options, callback) {
402
+ [params, options, callback] = normalizeArguments(params, options, callback);
316
403
 
317
- let { method, body, ...querystring } = params
318
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
404
+ let { method, body, ...querystring } = params;
405
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
319
406
 
320
- let path = ''
321
- if (method == null) method = 'GET'
322
- path = '/' + '_remote' + '/' + 'info'
407
+ let path = '';
408
+ if (method == null) method = 'GET';
409
+ path = '/' + '_remote' + '/' + 'info';
323
410
 
324
411
  // build request object
325
412
  const request = {
326
413
  method,
327
414
  path,
328
415
  body: null,
329
- querystring
330
- }
416
+ querystring,
417
+ };
331
418
 
332
- return this.transport.request(request, options, callback)
333
- }
419
+ return this.transport.request(request, options, callback);
420
+ };
334
421
 
335
- ClusterApi.prototype.reroute = function clusterRerouteApi (params, options, callback) {
336
- ;[params, options, callback] = normalizeArguments(params, options, callback)
422
+ ClusterApi.prototype.reroute = function clusterRerouteApi(params, options, callback) {
423
+ [params, options, callback] = normalizeArguments(params, options, callback);
337
424
 
338
- let { method, body, ...querystring } = params
339
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
425
+ let { method, body, ...querystring } = params;
426
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
340
427
 
341
- let path = ''
342
- if (method == null) method = 'POST'
343
- path = '/' + '_cluster' + '/' + 'reroute'
428
+ let path = '';
429
+ if (method == null) method = 'POST';
430
+ path = '/' + '_cluster' + '/' + 'reroute';
344
431
 
345
432
  // build request object
346
433
  const request = {
347
434
  method,
348
435
  path,
349
436
  body: body || '',
350
- querystring
351
- }
437
+ querystring,
438
+ };
352
439
 
353
- return this.transport.request(request, options, callback)
354
- }
440
+ return this.transport.request(request, options, callback);
441
+ };
355
442
 
356
- ClusterApi.prototype.state = function clusterStateApi (params, options, callback) {
357
- ;[params, options, callback] = normalizeArguments(params, options, callback)
443
+ ClusterApi.prototype.state = function clusterStateApi(params, options, callback) {
444
+ [params, options, callback] = normalizeArguments(params, options, callback);
358
445
 
359
446
  // check required url components
360
- if (params.index != null && (params.metric == null)) {
361
- const err = new this[kConfigurationError]('Missing required parameter of the url: metric')
362
- return handleError(err, callback)
447
+ if (params.index != null && params.metric == null) {
448
+ const err = new this[kConfigurationError]('Missing required parameter of the url: metric');
449
+ return handleError(err, callback);
363
450
  }
364
451
 
365
- let { method, body, metric, index, ...querystring } = params
366
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
367
-
368
- let path = ''
369
- if ((metric) != null && (index) != null) {
370
- if (method == null) method = 'GET'
371
- path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index)
372
- } else if ((metric) != null) {
373
- if (method == null) method = 'GET'
374
- path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric)
452
+ let { method, body, metric, index, ...querystring } = params;
453
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
454
+
455
+ let path = '';
456
+ if (metric != null && index != null) {
457
+ if (method == null) method = 'GET';
458
+ path =
459
+ '/' +
460
+ '_cluster' +
461
+ '/' +
462
+ 'state' +
463
+ '/' +
464
+ encodeURIComponent(metric) +
465
+ '/' +
466
+ encodeURIComponent(index);
467
+ } else if (metric != null) {
468
+ if (method == null) method = 'GET';
469
+ path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric);
375
470
  } else {
376
- if (method == null) method = 'GET'
377
- path = '/' + '_cluster' + '/' + 'state'
471
+ if (method == null) method = 'GET';
472
+ path = '/' + '_cluster' + '/' + 'state';
378
473
  }
379
474
 
380
475
  // build request object
@@ -382,25 +477,33 @@ ClusterApi.prototype.state = function clusterStateApi (params, options, callback
382
477
  method,
383
478
  path,
384
479
  body: null,
385
- querystring
386
- }
480
+ querystring,
481
+ };
387
482
 
388
- return this.transport.request(request, options, callback)
389
- }
483
+ return this.transport.request(request, options, callback);
484
+ };
390
485
 
391
- ClusterApi.prototype.stats = function clusterStatsApi (params, options, callback) {
392
- ;[params, options, callback] = normalizeArguments(params, options, callback)
486
+ ClusterApi.prototype.stats = function clusterStatsApi(params, options, callback) {
487
+ [params, options, callback] = normalizeArguments(params, options, callback);
393
488
 
394
- let { method, body, nodeId, node_id, ...querystring } = params
395
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
489
+ let { method, body, nodeId, node_id, ...querystring } = params;
490
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
396
491
 
397
- let path = ''
492
+ let path = '';
398
493
  if ((node_id || nodeId) != null) {
399
- if (method == null) method = 'GET'
400
- path = '/' + '_cluster' + '/' + 'stats' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId)
494
+ if (method == null) method = 'GET';
495
+ path =
496
+ '/' +
497
+ '_cluster' +
498
+ '/' +
499
+ 'stats' +
500
+ '/' +
501
+ 'nodes' +
502
+ '/' +
503
+ encodeURIComponent(node_id || nodeId);
401
504
  } else {
402
- if (method == null) method = 'GET'
403
- path = '/' + '_cluster' + '/' + 'stats'
505
+ if (method == null) method = 'GET';
506
+ path = '/' + '_cluster' + '/' + 'stats';
404
507
  }
405
508
 
406
509
  // build request object
@@ -408,24 +511,68 @@ ClusterApi.prototype.stats = function clusterStatsApi (params, options, callback
408
511
  method,
409
512
  path,
410
513
  body: null,
411
- querystring
412
- }
514
+ querystring,
515
+ };
413
516
 
414
- return this.transport.request(request, options, callback)
415
- }
517
+ return this.transport.request(request, options, callback);
518
+ };
416
519
 
417
520
  Object.defineProperties(ClusterApi.prototype, {
418
- allocation_explain: { get () { return this.allocationExplain } },
419
- delete_component_template: { get () { return this.deleteComponentTemplate } },
420
- delete_voting_config_exclusions: { get () { return this.deleteVotingConfigExclusions } },
421
- exists_component_template: { get () { return this.existsComponentTemplate } },
422
- get_component_template: { get () { return this.getComponentTemplate } },
423
- get_settings: { get () { return this.getSettings } },
424
- pending_tasks: { get () { return this.pendingTasks } },
425
- post_voting_config_exclusions: { get () { return this.postVotingConfigExclusions } },
426
- put_component_template: { get () { return this.putComponentTemplate } },
427
- put_settings: { get () { return this.putSettings } },
428
- remote_info: { get () { return this.remoteInfo } }
429
- })
430
-
431
- module.exports = ClusterApi
521
+ allocation_explain: {
522
+ get() {
523
+ return this.allocationExplain;
524
+ },
525
+ },
526
+ delete_component_template: {
527
+ get() {
528
+ return this.deleteComponentTemplate;
529
+ },
530
+ },
531
+ delete_voting_config_exclusions: {
532
+ get() {
533
+ return this.deleteVotingConfigExclusions;
534
+ },
535
+ },
536
+ exists_component_template: {
537
+ get() {
538
+ return this.existsComponentTemplate;
539
+ },
540
+ },
541
+ get_component_template: {
542
+ get() {
543
+ return this.getComponentTemplate;
544
+ },
545
+ },
546
+ get_settings: {
547
+ get() {
548
+ return this.getSettings;
549
+ },
550
+ },
551
+ pending_tasks: {
552
+ get() {
553
+ return this.pendingTasks;
554
+ },
555
+ },
556
+ post_voting_config_exclusions: {
557
+ get() {
558
+ return this.postVotingConfigExclusions;
559
+ },
560
+ },
561
+ put_component_template: {
562
+ get() {
563
+ return this.putComponentTemplate;
564
+ },
565
+ },
566
+ put_settings: {
567
+ get() {
568
+ return this.putSettings;
569
+ },
570
+ },
571
+ remote_info: {
572
+ get() {
573
+ return this.remoteInfo;
574
+ },
575
+ },
576
+ });
577
+
578
+ module.exports = ClusterApi;