@opensearch-project/opensearch 2.0.0 → 2.2.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 (92) hide show
  1. package/.eslintrc.json +13 -5
  2. package/ADMINS.md +13 -38
  3. package/CHANGELOG.md +54 -0
  4. package/COMPATIBILITY.md +4 -1
  5. package/MAINTAINERS.md +11 -73
  6. package/Makefile +2 -12
  7. package/README.md +4 -107
  8. package/RELEASING.md +7 -1
  9. package/USER_GUIDE.md +248 -0
  10. package/api/api/bulk.js +24 -2
  11. package/api/api/cat.js +320 -2
  12. package/api/api/clear_scroll.js +15 -2
  13. package/api/api/cluster.js +238 -2
  14. package/api/api/count.js +29 -2
  15. package/api/api/create.js +27 -2
  16. package/api/api/create_pit.js +88 -0
  17. package/api/api/dangling_indices.js +46 -2
  18. package/api/api/delete.js +24 -2
  19. package/api/api/delete_all_pits.js +53 -0
  20. package/api/api/delete_by_query.js +49 -2
  21. package/api/api/delete_by_query_rethrottle.js +15 -2
  22. package/api/api/delete_pit.js +61 -0
  23. package/api/api/delete_script.js +15 -2
  24. package/api/api/exists.js +26 -2
  25. package/api/api/exists_source.js +26 -2
  26. package/api/api/explain.js +28 -2
  27. package/api/api/features.js +25 -2
  28. package/api/api/field_caps.js +20 -2
  29. package/api/api/get.js +26 -2
  30. package/api/api/get_all_pits.js +53 -0
  31. package/api/api/get_script.js +17 -2
  32. package/api/api/get_script_context.js +12 -2
  33. package/api/api/get_script_languages.js +12 -2
  34. package/api/api/get_source.js +26 -2
  35. package/api/api/index.js +30 -2
  36. package/api/api/indices.js +816 -2
  37. package/api/api/info.js +12 -2
  38. package/api/api/ingest.js +90 -2
  39. package/api/api/mget.js +25 -2
  40. package/api/api/msearch.js +23 -2
  41. package/api/api/msearch_template.js +20 -2
  42. package/api/api/mtermvectors.js +1 -2
  43. package/api/api/nodes.js +92 -2
  44. package/api/api/ping.js +12 -2
  45. package/api/api/put_script.js +18 -2
  46. package/api/api/rank_eval.js +20 -2
  47. package/api/api/reindex.js +23 -2
  48. package/api/api/reindex_rethrottle.js +15 -2
  49. package/api/api/render_search_template.js +15 -2
  50. package/api/api/scripts_painless_execute.js +14 -2
  51. package/api/api/scroll.js +18 -2
  52. package/api/api/search.js +61 -2
  53. package/api/api/search_shards.js +20 -2
  54. package/api/api/search_template.js +28 -2
  55. package/api/api/shutdown.js +4 -2
  56. package/api/api/snapshot.js +211 -2
  57. package/api/api/tasks.js +57 -2
  58. package/api/api/terms_enum.js +2 -2
  59. package/api/api/termvectors.js +27 -2
  60. package/api/api/update.js +29 -2
  61. package/api/api/update_by_query.js +51 -2
  62. package/api/api/update_by_query_rethrottle.js +15 -2
  63. package/api/index.js +29 -2
  64. package/api/new.d.ts +65 -2
  65. package/api/opensearch_dashboards.d.ts +5 -2
  66. package/api/requestParams.d.ts +17 -2
  67. package/api/types.d.ts +48 -2
  68. package/api/utils.js +1 -2
  69. package/index.d.ts +605 -120
  70. package/index.js +2 -3
  71. package/index.mjs +1 -2
  72. package/jenkins/release.JenkinsFile +11 -0
  73. package/lib/Connection.d.ts +1 -2
  74. package/lib/Connection.js +5 -4
  75. package/lib/Helpers.d.ts +5 -4
  76. package/lib/Helpers.js +13 -17
  77. package/lib/Serializer.d.ts +1 -2
  78. package/lib/Serializer.js +2 -3
  79. package/lib/Transport.d.ts +10 -4
  80. package/lib/Transport.js +34 -7
  81. package/lib/aws/AwsSigv4Signer.js +176 -0
  82. package/lib/aws/errors.js +24 -0
  83. package/lib/aws/index.d.ts +39 -0
  84. package/lib/aws/index.js +19 -0
  85. package/lib/errors.d.ts +1 -2
  86. package/lib/errors.js +1 -2
  87. package/lib/pool/BaseConnectionPool.js +1 -2
  88. package/lib/pool/CloudConnectionPool.js +1 -2
  89. package/lib/pool/ConnectionPool.js +1 -2
  90. package/lib/pool/index.d.ts +1 -2
  91. package/lib/pool/index.js +1 -2
  92. package/package.json +36 -18
package/api/api/info.js CHANGED
@@ -1,12 +1,11 @@
1
1
  /*
2
+ * Copyright OpenSearch Contributors
2
3
  * SPDX-License-Identifier: Apache-2.0
3
4
  *
4
5
  * The OpenSearch Contributors require contributions made to
5
6
  * this file be licensed under the Apache-2.0 license or a
6
7
  * compatible open source license.
7
8
  *
8
- * Modifications Copyright OpenSearch Contributors. See
9
- * GitHub history for details.
10
9
  */
11
10
 
12
11
  /*
@@ -37,6 +36,17 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } =
37
36
  const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
38
37
  const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
39
38
 
39
+ /**
40
+ * Returns basic information about the cluster.
41
+ *
42
+ * @memberOf API-Cluster
43
+ *
44
+ * @param {Object} params - (Unused)
45
+ * @param {Object} options - Options for {@link Transport#request}
46
+ * @param {function} callback - Callback that handles errors and response
47
+ *
48
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
49
+ */
40
50
  function infoApi(params, options, callback) {
41
51
  [params, options, callback] = normalizeArguments(params, options, callback);
42
52
 
package/api/api/ingest.js CHANGED
@@ -1,12 +1,11 @@
1
1
  /*
2
+ * Copyright OpenSearch Contributors
2
3
  * SPDX-License-Identifier: Apache-2.0
3
4
  *
4
5
  * The OpenSearch Contributors require contributions made to
5
6
  * this file be licensed under the Apache-2.0 license or a
6
7
  * compatible open source license.
7
8
  *
8
- * Modifications Copyright OpenSearch Contributors. See
9
- * GitHub history for details.
10
9
  */
11
10
 
12
11
  /*
@@ -33,6 +32,8 @@
33
32
  /* eslint camelcase: 0 */
34
33
  /* eslint no-unused-vars: 0 */
35
34
 
35
+ /** @namespace API-Ingest */
36
+
36
37
  const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
37
38
  const acceptedQuerystring = [
38
39
  'cluster_manager_timeout',
@@ -58,6 +59,22 @@ function IngestApi(transport, ConfigurationError) {
58
59
  this[kConfigurationError] = ConfigurationError;
59
60
  }
60
61
 
62
+ /**
63
+ * Deletes a pipeline.
64
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/delete-ingest/ OpenSearch - Delete a pipeline}
65
+ *
66
+ * @memberOf API-Ingest
67
+ *
68
+ * @param {Object} params
69
+ * @param {string} params.id - Pipeline ID
70
+ * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
71
+ * @param {string} [params.timeout] - Explicit operation timeout
72
+ *
73
+ * @param {Object} options - Options for {@link Transport#request}
74
+ * @param {function} callback - Callback that handles errors and response
75
+ *
76
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/delete-ingest/#response Delete Pipeline Response}
77
+ */
61
78
  IngestApi.prototype.deletePipeline = function ingestDeletePipelineApi(params, options, callback) {
62
79
  [params, options, callback] = normalizeArguments(params, options, callback);
63
80
 
@@ -85,6 +102,17 @@ IngestApi.prototype.deletePipeline = function ingestDeletePipelineApi(params, op
85
102
  return this.transport.request(request, options, callback);
86
103
  };
87
104
 
105
+ /**
106
+ * Returns statistical information about geoip databases
107
+ *
108
+ * @memberOf API-Ingest
109
+ *
110
+ * @param {Object} params - (Unused)
111
+ * @param {Object} options - Options for {@link Transport#request}
112
+ * @param {function} callback - Callback that handles errors and response
113
+ *
114
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
115
+ */
88
116
  IngestApi.prototype.geoIpStats = function ingestGeoIpStatsApi(params, options, callback) {
89
117
  [params, options, callback] = normalizeArguments(params, options, callback);
90
118
 
@@ -106,6 +134,22 @@ IngestApi.prototype.geoIpStats = function ingestGeoIpStatsApi(params, options, c
106
134
  return this.transport.request(request, options, callback);
107
135
  };
108
136
 
137
+ /**
138
+ * Returns a pipeline.
139
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/get-ingest/ OpenSearch - Get pipeline}
140
+ *
141
+ * @memberOf API-Ingest
142
+ *
143
+ * @param {Object} params
144
+ * @param {string} [params.id] - Comma separated list of pipeline ids. Wildcards supported
145
+ * @param {boolean} [params.summary=false] - Return pipelines without their definitions
146
+ * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
147
+ *
148
+ * @param {Object} options - Options for {@link Transport#request}
149
+ * @param {function} callback - Callback that handles errors and response
150
+ *
151
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/get-ingest/#response Get Pipeline Response}
152
+ */
109
153
  IngestApi.prototype.getPipeline = function ingestGetPipelineApi(params, options, callback) {
110
154
  [params, options, callback] = normalizeArguments(params, options, callback);
111
155
 
@@ -132,6 +176,17 @@ IngestApi.prototype.getPipeline = function ingestGetPipelineApi(params, options,
132
176
  return this.transport.request(request, options, callback);
133
177
  };
134
178
 
179
+ /**
180
+ * Returns a list of the built-in patterns.
181
+ *
182
+ * @memberOf API-Ingest
183
+ *
184
+ * @param {Object} params - (Unused)
185
+ * @param {Object} options - Options for {@link Transport#request}
186
+ * @param {function} callback - Callback that handles errors and response
187
+ *
188
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
189
+ */
135
190
  IngestApi.prototype.processorGrok = function ingestProcessorGrokApi(params, options, callback) {
136
191
  [params, options, callback] = normalizeArguments(params, options, callback);
137
192
 
@@ -153,6 +208,23 @@ IngestApi.prototype.processorGrok = function ingestProcessorGrokApi(params, opti
153
208
  return this.transport.request(request, options, callback);
154
209
  };
155
210
 
211
+ /**
212
+ * Creates or updates a pipeline.
213
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/create-update-ingest/ OpenSearch - Create/Update pipeline}
214
+ *
215
+ * @memberOf API-Ingest
216
+ *
217
+ * @param {Object} params
218
+ * @param {string} params.id - Pipeline ID
219
+ * @param {Object} params.body - Ingest definition
220
+ * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
221
+ * @param {string} [params.timeout] - Explicit operation timeout
222
+ *
223
+ * @param {Object} options - Options for {@link Transport#request}
224
+ * @param {function} callback - Callback that handles errors and response
225
+ *
226
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/create-update-ingest/#response Create/Update Pipeline Response}
227
+ */
156
228
  IngestApi.prototype.putPipeline = function ingestPutPipelineApi(params, options, callback) {
157
229
  [params, options, callback] = normalizeArguments(params, options, callback);
158
230
 
@@ -184,6 +256,22 @@ IngestApi.prototype.putPipeline = function ingestPutPipelineApi(params, options,
184
256
  return this.transport.request(request, options, callback);
185
257
  };
186
258
 
259
+ /**
260
+ * Allows to simulate a pipeline with example documents.
261
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/simulate-ingest/ OpenSearch - Simulate Pipeline}
262
+ *
263
+ * @memberOf API-Ingest
264
+ *
265
+ * @param {Object} params
266
+ * @param {string} [params.id] - Pipeline ID
267
+ * @param {boolean} [params.verbose] - Verbose mode. Display data output for each processor in executed pipeline
268
+ * @param {Object} params.body - Simulate definition
269
+ *
270
+ * @param {Object} options - Options for {@link Transport#request}
271
+ * @param {function} callback - Callback that handles errors and response
272
+ *
273
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
274
+ */
187
275
  IngestApi.prototype.simulate = function ingestSimulateApi(params, options, callback) {
188
276
  [params, options, callback] = normalizeArguments(params, options, callback);
189
277
 
package/api/api/mget.js CHANGED
@@ -1,12 +1,11 @@
1
1
  /*
2
+ * Copyright OpenSearch Contributors
2
3
  * SPDX-License-Identifier: Apache-2.0
3
4
  *
4
5
  * The OpenSearch Contributors require contributions made to
5
6
  * this file be licensed under the Apache-2.0 license or a
6
7
  * compatible open source license.
7
8
  *
8
- * Modifications Copyright OpenSearch Contributors. See
9
- * GitHub history for details.
10
9
  */
11
10
 
12
11
  /*
@@ -61,6 +60,30 @@ const snakeCase = {
61
60
  filterPath: 'filter_path',
62
61
  };
63
62
 
63
+ /**
64
+ * Retrieve multiple documents
65
+ * <br/> See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/multi-get/ OpenSearch - Multi-get Document}
66
+ *
67
+ * @memberOf API-Document
68
+ *
69
+ * @param {Object} params
70
+ * @param {string} params.index - Name of the index.
71
+ * @param {string} params.id - Document ID.
72
+ * @param {string} params.body - {@link https://opensearch.org/docs/2.4/api-reference/document-apis/multi-get/#request-body Multi-get Request Body}
73
+ * @param {string} [params.preference] - Specifies a preference of which shard to retrieve results from. Available options are '_local', which tells the operation to retrieve results from a locally allocated shard replica, and a custom string value assigned to a specific shard replica. By default, OpenSearch executes get document operations on random shards.
74
+ * @param {boolean} [params.realtime=true] - Specifies whether the operation should run in realtime. If false, the operation waits for the index to refresh to analyze the source to retrieve data, which makes the operation near-realtime.
75
+ * @param {boolean} [params.refresh=false] - If true, OpenSearch refreshes shards to make the get operation available to search results. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation.
76
+ * @param {string} [params.routing] - A value used to route the operation to a specific shard.
77
+ * @param {boolean} [params.stored_fields=false] - Whether the get operation should retrieve fields stored in the index.
78
+ * @param {string} [params._source=true] - Whether to include the '_source' field in the response body.
79
+ * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude in the query response.
80
+ * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the query response.
81
+ *
82
+ * @param {Object} options - Options for {@link Transport#request}
83
+ * @param {function} callback - Callback that handles errors and response
84
+ *
85
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/multi-get/#response Multi-get Response}
86
+ */
64
87
  function mgetApi(params, options, callback) {
65
88
  [params, options, callback] = normalizeArguments(params, options, callback);
66
89
 
@@ -1,12 +1,11 @@
1
1
  /*
2
+ * Copyright OpenSearch Contributors
2
3
  * SPDX-License-Identifier: Apache-2.0
3
4
  *
4
5
  * The OpenSearch Contributors require contributions made to
5
6
  * this file be licensed under the Apache-2.0 license or a
6
7
  * compatible open source license.
7
8
  *
8
- * Modifications Copyright OpenSearch Contributors. See
9
- * GitHub history for details.
10
9
  */
11
10
 
12
11
  /*
@@ -60,6 +59,28 @@ const snakeCase = {
60
59
  filterPath: 'filter_path',
61
60
  };
62
61
 
62
+ /**
63
+ * Allows to execute several search operations in one request.
64
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/multi-search/ OpenSearch - Multi-Search}
65
+ *
66
+ * @memberOf API-Search
67
+ *
68
+ * @param {Object} params
69
+ * @param {string} params.index - A comma-separated list of index names to use as default
70
+ * @param {Object} params.body - The request definitions (metadata-search request definition pairs), separated by newlines
71
+ * @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch)
72
+ * @param {number} [params.max_concurrent_searches] - Controls the maximum number of concurrent searches the multi search api will execute
73
+ * @param {boolean} [params.typed_keys] - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
74
+ * @param {number} [params.pre_filter_shard_size] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.
75
+ * @param {number} [params.max_concurrent_shard_requests] - The number of concurrent shard requests each sub search executes concurrently per node. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
76
+ * @param {boolean} [params.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
77
+ * @param {boolean} [params.ccs_minimize_roundtrips] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
78
+ *
79
+ * @param {Object} options - Options for {@link Transport#request}
80
+ * @param {function} callback - Callback that handles errors and response
81
+ *
82
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/latest/api-reference/multi-search/#response Multi-search Response}
83
+ */
63
84
  function msearchApi(params, options, callback) {
64
85
  [params, options, callback] = normalizeArguments(params, options, callback);
65
86
 
@@ -1,12 +1,11 @@
1
1
  /*
2
+ * Copyright OpenSearch Contributors
2
3
  * SPDX-License-Identifier: Apache-2.0
3
4
  *
4
5
  * The OpenSearch Contributors require contributions made to
5
6
  * this file be licensed under the Apache-2.0 license or a
6
7
  * compatible open source license.
7
8
  *
8
- * Modifications Copyright OpenSearch Contributors. See
9
- * GitHub history for details.
10
9
  */
11
10
 
12
11
  /*
@@ -56,6 +55,25 @@ const snakeCase = {
56
55
  filterPath: 'filter_path',
57
56
  };
58
57
 
58
+ /**
59
+ * Allows to execute several search template operations in one request.
60
+ *
61
+ * @memberOf API-Search
62
+ *
63
+ * @param {Object} params
64
+ * @param {string} params.index - A comma-separated list of index names to use as default
65
+ * @param {Object} params.body - The request definitions (metadata-search request definition pairs), separated by newlines
66
+ * @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch)
67
+ * @param {boolean} [params.typed_keys] - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
68
+ * @param {number} [params.max_concurrent_searches] - Controls the maximum number of concurrent searches the multi search api will execute
69
+ * @param {boolean} [params.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
70
+ * @param {boolean} [params.ccs_minimize_roundtrips] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
71
+ *
72
+ * @param {Object} options - Options for {@link Transport#request}
73
+ * @param {function} callback - Callback that handles errors and response
74
+ *
75
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
76
+ */
59
77
  function msearchTemplateApi(params, options, callback) {
60
78
  [params, options, callback] = normalizeArguments(params, options, callback);
61
79
 
@@ -1,12 +1,11 @@
1
1
  /*
2
+ * Copyright OpenSearch Contributors
2
3
  * SPDX-License-Identifier: Apache-2.0
3
4
  *
4
5
  * The OpenSearch Contributors require contributions made to
5
6
  * this file be licensed under the Apache-2.0 license or a
6
7
  * compatible open source license.
7
8
  *
8
- * Modifications Copyright OpenSearch Contributors. See
9
- * GitHub history for details.
10
9
  */
11
10
 
12
11
  /*
package/api/api/nodes.js CHANGED
@@ -1,12 +1,11 @@
1
1
  /*
2
+ * Copyright OpenSearch Contributors
2
3
  * SPDX-License-Identifier: Apache-2.0
3
4
  *
4
5
  * The OpenSearch Contributors require contributions made to
5
6
  * this file be licensed under the Apache-2.0 license or a
6
7
  * compatible open source license.
7
8
  *
8
- * Modifications Copyright OpenSearch Contributors. See
9
- * GitHub history for details.
10
9
  */
11
10
 
12
11
  /*
@@ -33,6 +32,8 @@
33
32
  /* eslint camelcase: 0 */
34
33
  /* eslint no-unused-vars: 0 */
35
34
 
35
+ /** @namespace API-Nodes */
36
+
36
37
  const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
37
38
  const acceptedQuerystring = [
38
39
  'pretty',
@@ -156,6 +157,25 @@ NodesApi.prototype.getMeteringInfo = function nodesGetMeteringInfoApi(params, op
156
157
  return this.transport.request(request, options, callback);
157
158
  };
158
159
 
160
+ /**
161
+ * Returns information about hot threads on each node in the cluster.
162
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-hot-threads/ OpenSearch - Nodes Hot Threads}
163
+ * @memberOf API-Nodes
164
+ *
165
+ * @param {Object} params
166
+ * @param {string} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
167
+ * @param {string} [params.interval] - The interval for the second sampling of threads
168
+ * @param {number} [params.snapshots] - Number of samples of thread stacktrace (default: 10)
169
+ * @param {number} [params.threads] - Specify the number of threads to provide information for (default: 3)
170
+ * @param {boolean} [params.ignore_idle_threads] - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true)
171
+ * @param {string} [params.type] - The type to sample (default: cpu) (options: cpu, wait, block)
172
+ * @param {string} [params.timeout] - Explicit operation timeout
173
+ *
174
+ * @param {Object} options - Options for {@link Transport#request}
175
+ * @param {function} callback - Callback that handles errors and response
176
+ *
177
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
178
+ */
159
179
  NodesApi.prototype.hotThreads = function nodesHotThreadsApi(params, options, callback) {
160
180
  [params, options, callback] = normalizeArguments(params, options, callback);
161
181
 
@@ -207,6 +227,22 @@ NodesApi.prototype.hotThreads = function nodesHotThreadsApi(params, options, cal
207
227
  return this.transport.request(request, options, callback);
208
228
  };
209
229
 
230
+ /**
231
+ * Returns information about hot threads on each node in the cluster.
232
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-info/ OpenSearch - Nodes Info}
233
+ * @memberOf API-Nodes
234
+ *
235
+ * @param {Object} params
236
+ * @param {string} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
237
+ * @param {string} [params.metric] - A comma-separated list of metrics you wish returned. Leave empty to return all. (options: settings, os, process, jvm, thread_pool, transport, http, plugins, ingest)
238
+ * @param {boolean} [params.flat_settings] - Return settings in flat format (default: false)
239
+ * @param {string} [params.timeout] - Explicit operation timeout
240
+ *
241
+ * @param {Object} options - Options for {@link Transport#request}
242
+ * @param {function} callback - Callback that handles errors and response
243
+ *
244
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
245
+ */
210
246
  NodesApi.prototype.info = function nodesInfoApi(params, options, callback) {
211
247
  [params, options, callback] = normalizeArguments(params, options, callback);
212
248
 
@@ -245,6 +281,21 @@ NodesApi.prototype.info = function nodesInfoApi(params, options, callback) {
245
281
  return this.transport.request(request, options, callback);
246
282
  };
247
283
 
284
+ /**
285
+ * Reloads secure settings.
286
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-reload-secure/ OpenSearch - Nodes Reload Security Settings}
287
+ * @memberOf API-Nodes
288
+ *
289
+ * @param {Object} params
290
+ * @param {string} [params.node_id] - A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes.
291
+ * @param {string} [params.timeout] - Explicit operation timeout
292
+ * @param {Object} [params.body] - An object containing the password for the opensearch keystore
293
+ *
294
+ * @param {Object} options - Options for {@link Transport#request}
295
+ * @param {function} callback - Callback that handles errors and response
296
+ *
297
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
298
+ */
248
299
  NodesApi.prototype.reloadSecureSettings = function nodesReloadSecureSettingsApi(
249
300
  params,
250
301
  options,
@@ -276,6 +327,30 @@ NodesApi.prototype.reloadSecureSettings = function nodesReloadSecureSettingsApi(
276
327
  return this.transport.request(request, options, callback);
277
328
  };
278
329
 
330
+ /**
331
+ * Returns statistical information about nodes in the cluster.
332
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-stats/ OpenSearch - Nodes Stats}
333
+ * @memberOf API-Nodes
334
+ *
335
+ * @param {Object} params
336
+ * @param {string} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
337
+ * @param {string} [params.metric] - Limit the information returned to the specified metrics (options: _all, breaker, fs, http, indices, jvm, os, process, thread_pool, transport, discovery, indexing_pressure)
338
+ * @param {string} [params.index_metric] - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. (options: _all, completion, docs, fielddata, query_cache, flush, get, indexing, merge, request_cache, refresh, search, segments, store, warmer, suggest)
339
+ * @param {string} [params.completion_fields] - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)
340
+ * @param {string} [params.fielddata_fields] - A comma-separated list of fields for `fielddata` index metric (supports wildcards)
341
+ * @param {string} [params.fields] - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)
342
+ * @param {boolean} [params.groups] - A comma-separated list of search groups for `search` index metric
343
+ * @param {string} [params.level] - Return indices stats aggregated at index, node or shard level (options: indices, node, shards)
344
+ * @param {string} [params.types] - A comma-separated list of document types for the `indexing` index metric
345
+ * @param {string} [params.timeout] - Explicit operation timeout
346
+ * @param {boolean} [params.include_segment_file_sizes] - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)
347
+ * @param {boolean} [params.include_unloaded_segments] - If set to true segment stats will include stats for segments that are not currently loaded into memory
348
+ *
349
+ * @param {Object} options - Options for {@link Transport#request}
350
+ * @param {function} callback - Callback that handles errors and response
351
+ *
352
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
353
+ */
279
354
  NodesApi.prototype.stats = function nodesStatsApi(params, options, callback) {
280
355
  [params, options, callback] = normalizeArguments(params, options, callback);
281
356
 
@@ -340,6 +415,21 @@ NodesApi.prototype.stats = function nodesStatsApi(params, options, callback) {
340
415
  return this.transport.request(request, options, callback);
341
416
  };
342
417
 
418
+ /**
419
+ * Returns low-level information about REST actions usage on nodes.
420
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-usage/ OpenSearch - Nodes Usage}
421
+ * @memberOf API-Nodes
422
+ *
423
+ * @param {Object} params
424
+ * @param {string} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
425
+ * @param {string} [params.metric] - Limit the information returned to the specified metrics (options: _all, rest_actions)
426
+ * @param {string} [params.timeout] - Explicit operation timeout
427
+ *
428
+ * @param {Object} options - Options for {@link Transport#request}
429
+ * @param {function} callback - Callback that handles errors and response
430
+ *
431
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
432
+ */
343
433
  NodesApi.prototype.usage = function nodesUsageApi(params, options, callback) {
344
434
  [params, options, callback] = normalizeArguments(params, options, callback);
345
435
 
package/api/api/ping.js CHANGED
@@ -1,12 +1,11 @@
1
1
  /*
2
+ * Copyright OpenSearch Contributors
2
3
  * SPDX-License-Identifier: Apache-2.0
3
4
  *
4
5
  * The OpenSearch Contributors require contributions made to
5
6
  * this file be licensed under the Apache-2.0 license or a
6
7
  * compatible open source license.
7
8
  *
8
- * Modifications Copyright OpenSearch Contributors. See
9
- * GitHub history for details.
10
9
  */
11
10
 
12
11
  /*
@@ -37,6 +36,17 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } =
37
36
  const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
38
37
  const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
39
38
 
39
+ /**
40
+ * Returns whether the cluster is running.
41
+ *
42
+ * @memberOf API-Cluster
43
+ *
44
+ * @param {Object} params - (Unused)
45
+ * @param {Object} options - Options for {@link Transport#request}
46
+ * @param {function} callback - Callback that handles errors and response
47
+ *
48
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
49
+ */
40
50
  function pingApi(params, options, callback) {
41
51
  [params, options, callback] = normalizeArguments(params, options, callback);
42
52
 
@@ -1,12 +1,11 @@
1
1
  /*
2
+ * Copyright OpenSearch Contributors
2
3
  * SPDX-License-Identifier: Apache-2.0
3
4
  *
4
5
  * The OpenSearch Contributors require contributions made to
5
6
  * this file be licensed under the Apache-2.0 license or a
6
7
  * compatible open source license.
7
8
  *
8
- * Modifications Copyright OpenSearch Contributors. See
9
- * GitHub history for details.
10
9
  */
11
10
 
12
11
  /*
@@ -52,6 +51,23 @@ const snakeCase = {
52
51
  filterPath: 'filter_path',
53
52
  };
54
53
 
54
+ /**
55
+ * Creates or updates a script.
56
+ * <br/> See also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/create-stored-script/ OpenSearch - Create or update stored script}
57
+ * @memberOf API-Script
58
+ *
59
+ * @param {Object} params
60
+ * @param {string} params.id - Stored script or search template name
61
+ * @param {string} params.body - The script
62
+ * @param {string} [params.context] - Context in which the script or search template is to run. To prevent errors, the API immediately compiles the script or template in this context.
63
+ * @param {string} [params.timeout=30s] - Explicit operation timeout
64
+ * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
65
+ *
66
+ * @param {Object} [options] - Options for {@link Transport#request}
67
+ * @param {function} [callback] - Callback that handles errors and response
68
+ *
69
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
70
+ */
55
71
  function putScriptApi(params, options, callback) {
56
72
  [params, options, callback] = normalizeArguments(params, options, callback);
57
73
 
@@ -1,12 +1,11 @@
1
1
  /*
2
+ * Copyright OpenSearch Contributors
2
3
  * SPDX-License-Identifier: Apache-2.0
3
4
  *
4
5
  * The OpenSearch Contributors require contributions made to
5
6
  * this file be licensed under the Apache-2.0 license or a
6
7
  * compatible open source license.
7
8
  *
8
- * Modifications Copyright OpenSearch Contributors. See
9
- * GitHub history for details.
10
9
  */
11
10
 
12
11
  /*
@@ -54,6 +53,25 @@ const snakeCase = {
54
53
  filterPath: 'filter_path',
55
54
  };
56
55
 
56
+ /**
57
+ * Allows to evaluate the quality of ranked search results over a set of typical search queries
58
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/rank-eval/ OpenSearch - Ranking evaluation}
59
+ *
60
+ * @memberOf API-Search
61
+ *
62
+ * @param {Object} params
63
+ * @param {string} [params.index] - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
64
+ * @param {Object} params.body - The ranking evaluation search definition, including search requests, document ratings and ranking metric definition
65
+ * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
66
+ * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
67
+ * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
68
+ * @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch)
69
+ *
70
+ * @param {Object} [options] - Options for {@link Transport#request}
71
+ * @param {function} [callback] - Callback that handles errors and response
72
+ *
73
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/latest/api-reference/rank-eval/#sample-response Ranking Evaluation Response}
74
+ */
57
75
  function rankEvalApi(params, options, callback) {
58
76
  [params, options, callback] = normalizeArguments(params, options, callback);
59
77
 
@@ -1,12 +1,11 @@
1
1
  /*
2
+ * Copyright OpenSearch Contributors
2
3
  * SPDX-License-Identifier: Apache-2.0
3
4
  *
4
5
  * The OpenSearch Contributors require contributions made to
5
6
  * this file be licensed under the Apache-2.0 license or a
6
7
  * compatible open source license.
7
8
  *
8
- * Modifications Copyright OpenSearch Contributors. See
9
- * GitHub history for details.
10
9
  */
11
10
 
12
11
  /*
@@ -58,6 +57,28 @@ const snakeCase = {
58
57
  filterPath: 'filter_path',
59
58
  };
60
59
 
60
+ /**
61
+ * Copy all or a subset of your data from a source index into a destination index.
62
+ * <br/> See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/reindex/ OpenSearch - Reindex Document}
63
+ *
64
+ * @memberOf API-Document
65
+ *
66
+ * @param {Object} params
67
+ * @param {Object} params.body The search definition using the Query DSL and the prototype for the index request.
68
+ * @param {boolean} [params.refresh=false] Should the affected indexes be refreshed?
69
+ * @param {string} [params.timeout=30s] Time each individual bulk request should wait for shards that are unavailable.
70
+ * @param {string} [params.wait_for_active_shards] Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
71
+ * @param {boolean} [params.wait_for_completion=false] Should the request should block until the reindex is complete.
72
+ * @param {number} [params.requests_per_second=-1] The throttle to set on this request in sub-requests per second. -1 means no throttle.
73
+ * @param {string} [params.scroll=5m] Control how long to keep the search context alive
74
+ * @param {number|string} [params.slices=1] The number of slices this task should be divided into. 1 means the task isn't sliced into subtasks. Can be set to `auto`.
75
+ * @param {number} [params.max_docs] Maximum number of documents to process (default: all documents)
76
+ *
77
+ * @param {Object} options - Options for {@link Transport#request}
78
+ * @param {function} callback - Callback that handles errors and response
79
+ *
80
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/reindex/#response Reindex Document Response}
81
+ */
61
82
  function reindexApi(params, options, callback) {
62
83
  [params, options, callback] = normalizeArguments(params, options, callback);
63
84
 
@@ -1,12 +1,11 @@
1
1
  /*
2
+ * Copyright OpenSearch Contributors
2
3
  * SPDX-License-Identifier: Apache-2.0
3
4
  *
4
5
  * The OpenSearch Contributors require contributions made to
5
6
  * this file be licensed under the Apache-2.0 license or a
6
7
  * compatible open source license.
7
8
  *
8
- * Modifications Copyright OpenSearch Contributors. See
9
- * GitHub history for details.
10
9
  */
11
10
 
12
11
  /*
@@ -48,6 +47,20 @@ const snakeCase = {
48
47
  filterPath: 'filter_path',
49
48
  };
50
49
 
50
+ /**
51
+ * Changes the number of requests per second for a particular Reindex operation.
52
+ *
53
+ * @memberOf API-Document
54
+ *
55
+ * @param {Object} params
56
+ * @param {string} params.task_id - The task id to rethrottle
57
+ * @param {number} params.requests_per_second - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
58
+ *
59
+ * @param {Object} options - Options for {@link Transport#request}
60
+ * @param {function} callback - Callback that handles errors and response
61
+ *
62
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
63
+ */
51
64
  function reindexRethrottleApi(params, options, callback) {
52
65
  [params, options, callback] = normalizeArguments(params, options, callback);
53
66