@elastic/elasticsearch 7.15.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 (103) hide show
  1. package/.dockerignore +5 -0
  2. package/LICENSE +202 -0
  3. package/README.md +232 -0
  4. package/api/api/async_search.js +141 -0
  5. package/api/api/autoscaling.js +147 -0
  6. package/api/api/bulk.js +70 -0
  7. package/api/api/cat.js +648 -0
  8. package/api/api/ccr.js +403 -0
  9. package/api/api/clear_scroll.js +55 -0
  10. package/api/api/close_point_in_time.js +50 -0
  11. package/api/api/cluster.js +420 -0
  12. package/api/api/count.js +64 -0
  13. package/api/api/create.js +69 -0
  14. package/api/api/dangling_indices.js +115 -0
  15. package/api/api/delete.js +65 -0
  16. package/api/api/delete_by_query.js +71 -0
  17. package/api/api/delete_by_query_rethrottle.js +60 -0
  18. package/api/api/delete_script.js +56 -0
  19. package/api/api/enrich.js +173 -0
  20. package/api/api/eql.js +150 -0
  21. package/api/api/exists.js +65 -0
  22. package/api/api/exists_source.js +74 -0
  23. package/api/api/explain.js +65 -0
  24. package/api/api/features.js +81 -0
  25. package/api/api/field_caps.js +55 -0
  26. package/api/api/fleet.js +65 -0
  27. package/api/api/get.js +65 -0
  28. package/api/api/get_script.js +56 -0
  29. package/api/api/get_script_context.js +50 -0
  30. package/api/api/get_script_languages.js +50 -0
  31. package/api/api/get_source.js +65 -0
  32. package/api/api/graph.js +72 -0
  33. package/api/api/ilm.js +317 -0
  34. package/api/api/index.js +71 -0
  35. package/api/api/indices.js +1753 -0
  36. package/api/api/info.js +50 -0
  37. package/api/api/ingest.js +200 -0
  38. package/api/api/license.js +188 -0
  39. package/api/api/logstash.js +125 -0
  40. package/api/api/mget.js +70 -0
  41. package/api/api/migration.js +60 -0
  42. package/api/api/ml.js +2010 -0
  43. package/api/api/monitoring.js +66 -0
  44. package/api/api/msearch.js +70 -0
  45. package/api/api/msearch_template.js +70 -0
  46. package/api/api/mtermvectors.js +64 -0
  47. package/api/api/nodes.js +268 -0
  48. package/api/api/open_point_in_time.js +56 -0
  49. package/api/api/ping.js +50 -0
  50. package/api/api/put_script.js +71 -0
  51. package/api/api/rank_eval.js +61 -0
  52. package/api/api/reindex.js +56 -0
  53. package/api/api/reindex_rethrottle.js +60 -0
  54. package/api/api/render_search_template.js +55 -0
  55. package/api/api/rollup.js +319 -0
  56. package/api/api/scripts_painless_execute.js +50 -0
  57. package/api/api/scroll.js +55 -0
  58. package/api/api/search.js +64 -0
  59. package/api/api/search_mvt.js +87 -0
  60. package/api/api/search_shards.js +55 -0
  61. package/api/api/search_template.js +70 -0
  62. package/api/api/searchable_snapshots.js +186 -0
  63. package/api/api/security.js +1261 -0
  64. package/api/api/shutdown.js +124 -0
  65. package/api/api/slm.js +256 -0
  66. package/api/api/snapshot.js +439 -0
  67. package/api/api/sql.js +203 -0
  68. package/api/api/ssl.js +55 -0
  69. package/api/api/tasks.js +108 -0
  70. package/api/api/terms_enum.js +56 -0
  71. package/api/api/termvectors.js +67 -0
  72. package/api/api/text_structure.js +65 -0
  73. package/api/api/transform.js +268 -0
  74. package/api/api/update.js +69 -0
  75. package/api/api/update_by_query.js +67 -0
  76. package/api/api/update_by_query_rethrottle.js +60 -0
  77. package/api/api/watcher.js +333 -0
  78. package/api/api/xpack.js +76 -0
  79. package/api/index.js +508 -0
  80. package/api/new.d.ts +1585 -0
  81. package/api/requestParams.d.ts +2920 -0
  82. package/api/types.d.ts +15420 -0
  83. package/api/utils.js +58 -0
  84. package/codecov.yml +14 -0
  85. package/index.d.ts +2991 -0
  86. package/index.js +349 -0
  87. package/index.mjs +29 -0
  88. package/lib/Connection.d.ts +99 -0
  89. package/lib/Connection.js +392 -0
  90. package/lib/Helpers.d.ts +124 -0
  91. package/lib/Helpers.js +770 -0
  92. package/lib/Serializer.d.ts +30 -0
  93. package/lib/Serializer.js +94 -0
  94. package/lib/Transport.d.ts +162 -0
  95. package/lib/Transport.js +689 -0
  96. package/lib/errors.d.ts +90 -0
  97. package/lib/errors.js +159 -0
  98. package/lib/pool/BaseConnectionPool.js +262 -0
  99. package/lib/pool/CloudConnectionPool.js +64 -0
  100. package/lib/pool/ConnectionPool.js +246 -0
  101. package/lib/pool/index.d.ts +220 -0
  102. package/lib/pool/index.js +30 -0
  103. package/package.json +106 -0
package/api/api/cat.js ADDED
@@ -0,0 +1,648 @@
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 = ['format', 'local', 'h', 'help', 's', 'v', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'bytes', 'master_timeout', 'fields', 'time', 'ts', 'health', 'pri', 'include_unloaded_segments', 'allow_no_match', 'allow_no_datafeeds', 'allow_no_jobs', 'from', 'size', 'full_id', 'include_bootstrap', 'active_only', 'detailed', 'index', 'ignore_unavailable', 'nodes', 'actions', 'parent_task_id']
27
+ const snakeCase = { expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', includeUnloadedSegments: 'include_unloaded_segments', allowNoMatch: 'allow_no_match', allowNoDatafeeds: 'allow_no_datafeeds', allowNoJobs: 'allow_no_jobs', fullId: 'full_id', includeBootstrap: 'include_bootstrap', activeOnly: 'active_only', ignoreUnavailable: 'ignore_unavailable', parentTaskId: 'parent_task_id' }
28
+
29
+ function CatApi (transport, ConfigurationError) {
30
+ this.transport = transport
31
+ this[kConfigurationError] = ConfigurationError
32
+ }
33
+
34
+ CatApi.prototype.aliases = function catAliasesApi (params, options, callback) {
35
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
36
+
37
+ let { method, body, name, ...querystring } = params
38
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
39
+
40
+ let path = ''
41
+ if ((name) != null) {
42
+ if (method == null) method = 'GET'
43
+ path = '/' + '_cat' + '/' + 'aliases' + '/' + encodeURIComponent(name)
44
+ } else {
45
+ if (method == null) method = 'GET'
46
+ path = '/' + '_cat' + '/' + 'aliases'
47
+ }
48
+
49
+ // build request object
50
+ const request = {
51
+ method,
52
+ path,
53
+ body: null,
54
+ querystring
55
+ }
56
+
57
+ return this.transport.request(request, options, callback)
58
+ }
59
+
60
+ CatApi.prototype.allocation = function catAllocationApi (params, options, callback) {
61
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
62
+
63
+ let { method, body, nodeId, node_id, ...querystring } = params
64
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
65
+
66
+ let path = ''
67
+ if ((node_id || nodeId) != null) {
68
+ if (method == null) method = 'GET'
69
+ path = '/' + '_cat' + '/' + 'allocation' + '/' + encodeURIComponent(node_id || nodeId)
70
+ } else {
71
+ if (method == null) method = 'GET'
72
+ path = '/' + '_cat' + '/' + 'allocation'
73
+ }
74
+
75
+ // build request object
76
+ const request = {
77
+ method,
78
+ path,
79
+ body: null,
80
+ querystring
81
+ }
82
+
83
+ return this.transport.request(request, options, callback)
84
+ }
85
+
86
+ CatApi.prototype.count = function catCountApi (params, options, callback) {
87
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
88
+
89
+ let { method, body, index, ...querystring } = params
90
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
91
+
92
+ let path = ''
93
+ if ((index) != null) {
94
+ if (method == null) method = 'GET'
95
+ path = '/' + '_cat' + '/' + 'count' + '/' + encodeURIComponent(index)
96
+ } else {
97
+ if (method == null) method = 'GET'
98
+ path = '/' + '_cat' + '/' + 'count'
99
+ }
100
+
101
+ // build request object
102
+ const request = {
103
+ method,
104
+ path,
105
+ body: null,
106
+ querystring
107
+ }
108
+
109
+ return this.transport.request(request, options, callback)
110
+ }
111
+
112
+ CatApi.prototype.fielddata = function catFielddataApi (params, options, callback) {
113
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
114
+
115
+ let { method, body, fields, ...querystring } = params
116
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
117
+
118
+ let path = ''
119
+ if ((fields) != null) {
120
+ if (method == null) method = 'GET'
121
+ path = '/' + '_cat' + '/' + 'fielddata' + '/' + encodeURIComponent(fields)
122
+ } else {
123
+ if (method == null) method = 'GET'
124
+ path = '/' + '_cat' + '/' + 'fielddata'
125
+ }
126
+
127
+ // build request object
128
+ const request = {
129
+ method,
130
+ path,
131
+ body: null,
132
+ querystring
133
+ }
134
+
135
+ return this.transport.request(request, options, callback)
136
+ }
137
+
138
+ CatApi.prototype.health = function catHealthApi (params, options, callback) {
139
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
140
+
141
+ let { method, body, ...querystring } = params
142
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
143
+
144
+ let path = ''
145
+ if (method == null) method = 'GET'
146
+ path = '/' + '_cat' + '/' + 'health'
147
+
148
+ // build request object
149
+ const request = {
150
+ method,
151
+ path,
152
+ body: null,
153
+ querystring
154
+ }
155
+
156
+ return this.transport.request(request, options, callback)
157
+ }
158
+
159
+ CatApi.prototype.help = function catHelpApi (params, options, callback) {
160
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
161
+
162
+ let { method, body, ...querystring } = params
163
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
164
+
165
+ let path = ''
166
+ if (method == null) method = 'GET'
167
+ path = '/' + '_cat'
168
+
169
+ // build request object
170
+ const request = {
171
+ method,
172
+ path,
173
+ body: null,
174
+ querystring
175
+ }
176
+
177
+ return this.transport.request(request, options, callback)
178
+ }
179
+
180
+ CatApi.prototype.indices = function catIndicesApi (params, options, callback) {
181
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
182
+
183
+ let { method, body, index, ...querystring } = params
184
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
185
+
186
+ let path = ''
187
+ if ((index) != null) {
188
+ if (method == null) method = 'GET'
189
+ path = '/' + '_cat' + '/' + 'indices' + '/' + encodeURIComponent(index)
190
+ } else {
191
+ if (method == null) method = 'GET'
192
+ path = '/' + '_cat' + '/' + 'indices'
193
+ }
194
+
195
+ // build request object
196
+ const request = {
197
+ method,
198
+ path,
199
+ body: null,
200
+ querystring
201
+ }
202
+
203
+ return this.transport.request(request, options, callback)
204
+ }
205
+
206
+ CatApi.prototype.master = function catMasterApi (params, options, callback) {
207
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
208
+
209
+ let { method, body, ...querystring } = params
210
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
211
+
212
+ let path = ''
213
+ if (method == null) method = 'GET'
214
+ path = '/' + '_cat' + '/' + 'master'
215
+
216
+ // build request object
217
+ const request = {
218
+ method,
219
+ path,
220
+ body: null,
221
+ querystring
222
+ }
223
+
224
+ return this.transport.request(request, options, callback)
225
+ }
226
+
227
+ CatApi.prototype.mlDataFrameAnalytics = function catMlDataFrameAnalyticsApi (params, options, callback) {
228
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
229
+
230
+ let { method, body, id, ...querystring } = params
231
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
232
+
233
+ let path = ''
234
+ if ((id) != null) {
235
+ if (method == null) method = 'GET'
236
+ path = '/' + '_cat' + '/' + 'ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id)
237
+ } else {
238
+ if (method == null) method = 'GET'
239
+ path = '/' + '_cat' + '/' + 'ml' + '/' + 'data_frame' + '/' + 'analytics'
240
+ }
241
+
242
+ // build request object
243
+ const request = {
244
+ method,
245
+ path,
246
+ body: null,
247
+ querystring
248
+ }
249
+
250
+ return this.transport.request(request, options, callback)
251
+ }
252
+
253
+ CatApi.prototype.mlDatafeeds = function catMlDatafeedsApi (params, options, callback) {
254
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
255
+
256
+ let { method, body, datafeedId, datafeed_id, ...querystring } = params
257
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
258
+
259
+ let path = ''
260
+ if ((datafeed_id || datafeedId) != null) {
261
+ if (method == null) method = 'GET'
262
+ path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
263
+ } else {
264
+ if (method == null) method = 'GET'
265
+ path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds'
266
+ }
267
+
268
+ // build request object
269
+ const request = {
270
+ method,
271
+ path,
272
+ body: null,
273
+ querystring
274
+ }
275
+
276
+ return this.transport.request(request, options, callback)
277
+ }
278
+
279
+ CatApi.prototype.mlJobs = function catMlJobsApi (params, options, callback) {
280
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
281
+
282
+ let { method, body, jobId, job_id, ...querystring } = params
283
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
284
+
285
+ let path = ''
286
+ if ((job_id || jobId) != null) {
287
+ if (method == null) method = 'GET'
288
+ path = '/' + '_cat' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
289
+ } else {
290
+ if (method == null) method = 'GET'
291
+ path = '/' + '_cat' + '/' + 'ml' + '/' + 'anomaly_detectors'
292
+ }
293
+
294
+ // build request object
295
+ const request = {
296
+ method,
297
+ path,
298
+ body: null,
299
+ querystring
300
+ }
301
+
302
+ return this.transport.request(request, options, callback)
303
+ }
304
+
305
+ CatApi.prototype.mlTrainedModels = function catMlTrainedModelsApi (params, options, callback) {
306
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
307
+
308
+ let { method, body, modelId, model_id, ...querystring } = params
309
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
310
+
311
+ let path = ''
312
+ if ((model_id || modelId) != null) {
313
+ if (method == null) method = 'GET'
314
+ path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models' + '/' + encodeURIComponent(model_id || modelId)
315
+ } else {
316
+ if (method == null) method = 'GET'
317
+ path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models'
318
+ }
319
+
320
+ // build request object
321
+ const request = {
322
+ method,
323
+ path,
324
+ body: null,
325
+ querystring
326
+ }
327
+
328
+ return this.transport.request(request, options, callback)
329
+ }
330
+
331
+ CatApi.prototype.nodeattrs = function catNodeattrsApi (params, options, callback) {
332
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
333
+
334
+ let { method, body, ...querystring } = params
335
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
336
+
337
+ let path = ''
338
+ if (method == null) method = 'GET'
339
+ path = '/' + '_cat' + '/' + 'nodeattrs'
340
+
341
+ // build request object
342
+ const request = {
343
+ method,
344
+ path,
345
+ body: null,
346
+ querystring
347
+ }
348
+
349
+ return this.transport.request(request, options, callback)
350
+ }
351
+
352
+ CatApi.prototype.nodes = function catNodesApi (params, options, callback) {
353
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
354
+
355
+ let { method, body, ...querystring } = params
356
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
357
+
358
+ let path = ''
359
+ if (method == null) method = 'GET'
360
+ path = '/' + '_cat' + '/' + 'nodes'
361
+
362
+ // build request object
363
+ const request = {
364
+ method,
365
+ path,
366
+ body: null,
367
+ querystring
368
+ }
369
+
370
+ return this.transport.request(request, options, callback)
371
+ }
372
+
373
+ CatApi.prototype.pendingTasks = function catPendingTasksApi (params, options, callback) {
374
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
375
+
376
+ let { method, body, ...querystring } = params
377
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
378
+
379
+ let path = ''
380
+ if (method == null) method = 'GET'
381
+ path = '/' + '_cat' + '/' + 'pending_tasks'
382
+
383
+ // build request object
384
+ const request = {
385
+ method,
386
+ path,
387
+ body: null,
388
+ querystring
389
+ }
390
+
391
+ return this.transport.request(request, options, callback)
392
+ }
393
+
394
+ CatApi.prototype.plugins = function catPluginsApi (params, options, callback) {
395
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
396
+
397
+ let { method, body, ...querystring } = params
398
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
399
+
400
+ let path = ''
401
+ if (method == null) method = 'GET'
402
+ path = '/' + '_cat' + '/' + 'plugins'
403
+
404
+ // build request object
405
+ const request = {
406
+ method,
407
+ path,
408
+ body: null,
409
+ querystring
410
+ }
411
+
412
+ return this.transport.request(request, options, callback)
413
+ }
414
+
415
+ CatApi.prototype.recovery = function catRecoveryApi (params, options, callback) {
416
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
417
+
418
+ let { method, body, index, ...querystring } = params
419
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
420
+
421
+ let path = ''
422
+ if ((index) != null) {
423
+ if (method == null) method = 'GET'
424
+ path = '/' + '_cat' + '/' + 'recovery' + '/' + encodeURIComponent(index)
425
+ } else {
426
+ if (method == null) method = 'GET'
427
+ path = '/' + '_cat' + '/' + 'recovery'
428
+ }
429
+
430
+ // build request object
431
+ const request = {
432
+ method,
433
+ path,
434
+ body: null,
435
+ querystring
436
+ }
437
+
438
+ return this.transport.request(request, options, callback)
439
+ }
440
+
441
+ CatApi.prototype.repositories = function catRepositoriesApi (params, options, callback) {
442
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
443
+
444
+ let { method, body, ...querystring } = params
445
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
446
+
447
+ let path = ''
448
+ if (method == null) method = 'GET'
449
+ path = '/' + '_cat' + '/' + 'repositories'
450
+
451
+ // build request object
452
+ const request = {
453
+ method,
454
+ path,
455
+ body: null,
456
+ querystring
457
+ }
458
+
459
+ return this.transport.request(request, options, callback)
460
+ }
461
+
462
+ CatApi.prototype.segments = function catSegmentsApi (params, options, callback) {
463
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
464
+
465
+ let { method, body, index, ...querystring } = params
466
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
467
+
468
+ let path = ''
469
+ if ((index) != null) {
470
+ if (method == null) method = 'GET'
471
+ path = '/' + '_cat' + '/' + 'segments' + '/' + encodeURIComponent(index)
472
+ } else {
473
+ if (method == null) method = 'GET'
474
+ path = '/' + '_cat' + '/' + 'segments'
475
+ }
476
+
477
+ // build request object
478
+ const request = {
479
+ method,
480
+ path,
481
+ body: null,
482
+ querystring
483
+ }
484
+
485
+ return this.transport.request(request, options, callback)
486
+ }
487
+
488
+ CatApi.prototype.shards = function catShardsApi (params, options, callback) {
489
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
490
+
491
+ let { method, body, index, ...querystring } = params
492
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
493
+
494
+ let path = ''
495
+ if ((index) != null) {
496
+ if (method == null) method = 'GET'
497
+ path = '/' + '_cat' + '/' + 'shards' + '/' + encodeURIComponent(index)
498
+ } else {
499
+ if (method == null) method = 'GET'
500
+ path = '/' + '_cat' + '/' + 'shards'
501
+ }
502
+
503
+ // build request object
504
+ const request = {
505
+ method,
506
+ path,
507
+ body: null,
508
+ querystring
509
+ }
510
+
511
+ return this.transport.request(request, options, callback)
512
+ }
513
+
514
+ CatApi.prototype.snapshots = function catSnapshotsApi (params, options, callback) {
515
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
516
+
517
+ let { method, body, repository, ...querystring } = params
518
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
519
+
520
+ let path = ''
521
+ if ((repository) != null) {
522
+ if (method == null) method = 'GET'
523
+ path = '/' + '_cat' + '/' + 'snapshots' + '/' + encodeURIComponent(repository)
524
+ } else {
525
+ if (method == null) method = 'GET'
526
+ path = '/' + '_cat' + '/' + 'snapshots'
527
+ }
528
+
529
+ // build request object
530
+ const request = {
531
+ method,
532
+ path,
533
+ body: null,
534
+ querystring
535
+ }
536
+
537
+ return this.transport.request(request, options, callback)
538
+ }
539
+
540
+ CatApi.prototype.tasks = function catTasksApi (params, options, callback) {
541
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
542
+
543
+ let { method, body, ...querystring } = params
544
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
545
+
546
+ let path = ''
547
+ if (method == null) method = 'GET'
548
+ path = '/' + '_cat' + '/' + 'tasks'
549
+
550
+ // build request object
551
+ const request = {
552
+ method,
553
+ path,
554
+ body: null,
555
+ querystring
556
+ }
557
+
558
+ return this.transport.request(request, options, callback)
559
+ }
560
+
561
+ CatApi.prototype.templates = function catTemplatesApi (params, options, callback) {
562
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
563
+
564
+ let { method, body, name, ...querystring } = params
565
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
566
+
567
+ let path = ''
568
+ if ((name) != null) {
569
+ if (method == null) method = 'GET'
570
+ path = '/' + '_cat' + '/' + 'templates' + '/' + encodeURIComponent(name)
571
+ } else {
572
+ if (method == null) method = 'GET'
573
+ path = '/' + '_cat' + '/' + 'templates'
574
+ }
575
+
576
+ // build request object
577
+ const request = {
578
+ method,
579
+ path,
580
+ body: null,
581
+ querystring
582
+ }
583
+
584
+ return this.transport.request(request, options, callback)
585
+ }
586
+
587
+ CatApi.prototype.threadPool = function catThreadPoolApi (params, options, callback) {
588
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
589
+
590
+ let { method, body, threadPoolPatterns, thread_pool_patterns, ...querystring } = params
591
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
592
+
593
+ let path = ''
594
+ if ((thread_pool_patterns || threadPoolPatterns) != null) {
595
+ if (method == null) method = 'GET'
596
+ path = '/' + '_cat' + '/' + 'thread_pool' + '/' + encodeURIComponent(thread_pool_patterns || threadPoolPatterns)
597
+ } else {
598
+ if (method == null) method = 'GET'
599
+ path = '/' + '_cat' + '/' + 'thread_pool'
600
+ }
601
+
602
+ // build request object
603
+ const request = {
604
+ method,
605
+ path,
606
+ body: null,
607
+ querystring
608
+ }
609
+
610
+ return this.transport.request(request, options, callback)
611
+ }
612
+
613
+ CatApi.prototype.transforms = function catTransformsApi (params, options, callback) {
614
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
615
+
616
+ let { method, body, transformId, transform_id, ...querystring } = params
617
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
618
+
619
+ let path = ''
620
+ if ((transform_id || transformId) != null) {
621
+ if (method == null) method = 'GET'
622
+ path = '/' + '_cat' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId)
623
+ } else {
624
+ if (method == null) method = 'GET'
625
+ path = '/' + '_cat' + '/' + 'transforms'
626
+ }
627
+
628
+ // build request object
629
+ const request = {
630
+ method,
631
+ path,
632
+ body: null,
633
+ querystring
634
+ }
635
+
636
+ return this.transport.request(request, options, callback)
637
+ }
638
+
639
+ Object.defineProperties(CatApi.prototype, {
640
+ ml_data_frame_analytics: { get () { return this.mlDataFrameAnalytics } },
641
+ ml_datafeeds: { get () { return this.mlDatafeeds } },
642
+ ml_jobs: { get () { return this.mlJobs } },
643
+ ml_trained_models: { get () { return this.mlTrainedModels } },
644
+ pending_tasks: { get () { return this.pendingTasks } },
645
+ thread_pool: { get () { return this.threadPool } }
646
+ })
647
+
648
+ module.exports = CatApi