@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.
- package/.eslintrc.json +13 -5
- package/ADMINS.md +13 -38
- package/CHANGELOG.md +54 -0
- package/COMPATIBILITY.md +4 -1
- package/MAINTAINERS.md +11 -73
- package/Makefile +2 -12
- package/README.md +4 -107
- package/RELEASING.md +7 -1
- package/USER_GUIDE.md +248 -0
- package/api/api/bulk.js +24 -2
- package/api/api/cat.js +320 -2
- package/api/api/clear_scroll.js +15 -2
- package/api/api/cluster.js +238 -2
- package/api/api/count.js +29 -2
- package/api/api/create.js +27 -2
- package/api/api/create_pit.js +88 -0
- package/api/api/dangling_indices.js +46 -2
- package/api/api/delete.js +24 -2
- package/api/api/delete_all_pits.js +53 -0
- package/api/api/delete_by_query.js +49 -2
- package/api/api/delete_by_query_rethrottle.js +15 -2
- package/api/api/delete_pit.js +61 -0
- package/api/api/delete_script.js +15 -2
- package/api/api/exists.js +26 -2
- package/api/api/exists_source.js +26 -2
- package/api/api/explain.js +28 -2
- package/api/api/features.js +25 -2
- package/api/api/field_caps.js +20 -2
- package/api/api/get.js +26 -2
- package/api/api/get_all_pits.js +53 -0
- package/api/api/get_script.js +17 -2
- package/api/api/get_script_context.js +12 -2
- package/api/api/get_script_languages.js +12 -2
- package/api/api/get_source.js +26 -2
- package/api/api/index.js +30 -2
- package/api/api/indices.js +816 -2
- package/api/api/info.js +12 -2
- package/api/api/ingest.js +90 -2
- package/api/api/mget.js +25 -2
- package/api/api/msearch.js +23 -2
- package/api/api/msearch_template.js +20 -2
- package/api/api/mtermvectors.js +1 -2
- package/api/api/nodes.js +92 -2
- package/api/api/ping.js +12 -2
- package/api/api/put_script.js +18 -2
- package/api/api/rank_eval.js +20 -2
- package/api/api/reindex.js +23 -2
- package/api/api/reindex_rethrottle.js +15 -2
- package/api/api/render_search_template.js +15 -2
- package/api/api/scripts_painless_execute.js +14 -2
- package/api/api/scroll.js +18 -2
- package/api/api/search.js +61 -2
- package/api/api/search_shards.js +20 -2
- package/api/api/search_template.js +28 -2
- package/api/api/shutdown.js +4 -2
- package/api/api/snapshot.js +211 -2
- package/api/api/tasks.js +57 -2
- package/api/api/terms_enum.js +2 -2
- package/api/api/termvectors.js +27 -2
- package/api/api/update.js +29 -2
- package/api/api/update_by_query.js +51 -2
- package/api/api/update_by_query_rethrottle.js +15 -2
- package/api/index.js +29 -2
- package/api/new.d.ts +65 -2
- package/api/opensearch_dashboards.d.ts +5 -2
- package/api/requestParams.d.ts +17 -2
- package/api/types.d.ts +48 -2
- package/api/utils.js +1 -2
- package/index.d.ts +605 -120
- package/index.js +2 -3
- package/index.mjs +1 -2
- package/jenkins/release.JenkinsFile +11 -0
- package/lib/Connection.d.ts +1 -2
- package/lib/Connection.js +5 -4
- package/lib/Helpers.d.ts +5 -4
- package/lib/Helpers.js +13 -17
- package/lib/Serializer.d.ts +1 -2
- package/lib/Serializer.js +2 -3
- package/lib/Transport.d.ts +10 -4
- package/lib/Transport.js +34 -7
- package/lib/aws/AwsSigv4Signer.js +176 -0
- package/lib/aws/errors.js +24 -0
- package/lib/aws/index.d.ts +39 -0
- package/lib/aws/index.js +19 -0
- package/lib/errors.d.ts +1 -2
- package/lib/errors.js +1 -2
- package/lib/pool/BaseConnectionPool.js +1 -2
- package/lib/pool/CloudConnectionPool.js +1 -2
- package/lib/pool/ConnectionPool.js +1 -2
- package/lib/pool/index.d.ts +1 -2
- package/lib/pool/index.js +1 -2
- package/package.json +36 -18
|
@@ -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,20 @@ 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
|
+
* Allows to use the Mustache language to pre-render a search definition.
|
|
41
|
+
*
|
|
42
|
+
* @memberOf API-Search
|
|
43
|
+
*
|
|
44
|
+
* @param {Object} params
|
|
45
|
+
* @param {string} [params.id] - The id of the stored search template
|
|
46
|
+
* @param {Object} [params.body] - The search definition template and its params
|
|
47
|
+
*
|
|
48
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
49
|
+
* @param {function} callback - Callback that handles errors and response
|
|
50
|
+
*
|
|
51
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
52
|
+
*/
|
|
40
53
|
function renderSearchTemplateApi(params, options, callback) {
|
|
41
54
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
42
55
|
|
|
@@ -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,19 @@ 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
|
+
* Execute Painless script
|
|
41
|
+
* <br/> See also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/exec-script/ OpenSearch - Execute Painless script}
|
|
42
|
+
* @memberOf API-Script
|
|
43
|
+
*
|
|
44
|
+
* @param {Object} params
|
|
45
|
+
* @param {string} params.body - The painless script
|
|
46
|
+
*
|
|
47
|
+
* @param {Object} [options] - Options for {@link Transport#request}
|
|
48
|
+
* @param {function} [callback] - Callback that handles errors and response
|
|
49
|
+
*
|
|
50
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
51
|
+
*/
|
|
40
52
|
function scriptsPainlessExecuteApi(params, options, callback) {
|
|
41
53
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
42
54
|
|
package/api/api/scroll.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
|
/*
|
|
@@ -51,6 +50,23 @@ const snakeCase = {
|
|
|
51
50
|
filterPath: 'filter_path',
|
|
52
51
|
};
|
|
53
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Allows to retrieve a large numbers of results from a single search request.
|
|
55
|
+
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/scroll/ OpenSearch - Scroll }
|
|
56
|
+
*
|
|
57
|
+
* @memberOf API-Search
|
|
58
|
+
*
|
|
59
|
+
* @param {Object} params
|
|
60
|
+
* @param {string} [params.scroll_id] - The scroll ID *Deprecated*
|
|
61
|
+
* @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search
|
|
62
|
+
* @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
|
|
63
|
+
* @param {Object} [params.body] - The scroll ID if not passed by URL or query parameter.
|
|
64
|
+
*
|
|
65
|
+
* @param {Object} [options] - Options for {@link Transport#request}
|
|
66
|
+
* @param {function} [callback] - Callback that handles errors and response
|
|
67
|
+
*
|
|
68
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
69
|
+
*/
|
|
54
70
|
function scrollApi(params, options, callback) {
|
|
55
71
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
56
72
|
|
package/api/api/search.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-Search */
|
|
36
|
+
|
|
36
37
|
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
|
|
37
38
|
const acceptedQuerystring = [
|
|
38
39
|
'analyzer',
|
|
@@ -121,6 +122,64 @@ const snakeCase = {
|
|
|
121
122
|
filterPath: 'filter_path',
|
|
122
123
|
};
|
|
123
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Allows to execute several search operations in one request.
|
|
127
|
+
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/search/ OpenSearch - Search}
|
|
128
|
+
*
|
|
129
|
+
* @memberOf API-Search
|
|
130
|
+
*
|
|
131
|
+
* @param {Object} params
|
|
132
|
+
* @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
|
|
133
|
+
* @param {string} [params.analyzer] - The analyzer to use for the query string
|
|
134
|
+
* @param {boolean} [params.analyze_wildcard] - Specify whether wildcard and prefix queries should be analyzed (default: false)
|
|
135
|
+
* @param {boolean} [params.ccs_minimize_roundtrips] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
|
|
136
|
+
* @param {string} [params.default_operator] - The default operator for query string query (AND or OR) (options: AND, OR)
|
|
137
|
+
* @param {string} [params.df] - The field to use as default where no field prefix is given in the query string
|
|
138
|
+
* @param {boolean} [params.explain] - Specify whether to return detailed information about score computation as part of a hit
|
|
139
|
+
* @param {string} [params.stored_fields] - A comma-separated list of stored fields to return as part of a hit
|
|
140
|
+
* @param {string} [params.docvalue_fields] - A comma-separated list of fields to return as the docvalue representation of a field for each hit
|
|
141
|
+
* @param {number} [params.from] - Starting offset (default: 0)
|
|
142
|
+
* @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
|
143
|
+
* @param {boolean} [params.ignore_throttled] - Whether specified concrete, expanded or aliased indices should be ignored when throttled
|
|
144
|
+
* @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)
|
|
145
|
+
* @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)
|
|
146
|
+
* @param {boolean} [params.lenient] - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
|
|
147
|
+
* @param {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random)
|
|
148
|
+
* @param {string} [params.q] - Query in the Lucene query string syntax
|
|
149
|
+
* @param {string} [params.routing] - A comma-separated list of specific routing values
|
|
150
|
+
* @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search
|
|
151
|
+
* @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch)
|
|
152
|
+
* @param {number} [params.size] - Number of hits to return (default: 10)
|
|
153
|
+
* @param {string} [params.sort] - A comma-separated list of <field>:<direction> pairs
|
|
154
|
+
* @param {string} [params._source] - True or false to return the _source field or not, or a list of fields to return
|
|
155
|
+
* @param {string} [params._source_excludes] - A list of fields to exclude from the returned _source field
|
|
156
|
+
* @param {string} [params._source_includes] - A list of fields to extract and return from the _source field
|
|
157
|
+
* @param {number} [params.terminate_after] - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
|
|
158
|
+
* @param {string} [params.stats] - Specific 'tag' of the request for logging and statistical purposes
|
|
159
|
+
* @param {string} [params.suggest_field] - Specify which field to use for suggestions
|
|
160
|
+
* @param {string} [params.suggest_mode] - Specify suggest mode (options: missing, popular, always)
|
|
161
|
+
* @param {number} [params.suggest_size] - How many suggestions to return in response
|
|
162
|
+
* @param {string} [params.suggest_text] - The source text for which the suggestions should be returned
|
|
163
|
+
* @param {string} [params.timeout] - Explicit operation timeout
|
|
164
|
+
* @param {boolean} [params.track_scores] - Whether to calculate and return scores even if they are not used for sorting
|
|
165
|
+
* @param {boolean} [params.track_total_hits] - Indicate if the number of documents that match the query should be tracked
|
|
166
|
+
* @param {boolean} [params.allow_partial_search_results] - Indicate if an error should be returned if there is a partial search failure or timeout
|
|
167
|
+
* @param {boolean} [params.typed_keys] - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
|
|
168
|
+
* @param {boolean} [params.version] - Specify whether to return document version as part of a hit
|
|
169
|
+
* @param {boolean} [params.seq_no_primary_term] - Specify whether to return sequence number and primary term of the last modification of each hit
|
|
170
|
+
* @param {boolean} [params.request_cache] - Specify if request cache should be used for this request or not, defaults to index level setting
|
|
171
|
+
* @param {number} [params.batched_reduce_size] - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.
|
|
172
|
+
* @param {number} [params.max_concurrent_shard_requests] - The number of concurrent shard requests per node this search executes concurrently. 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
|
|
173
|
+
* @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.
|
|
174
|
+
* @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
|
|
175
|
+
* @param {string} [params.min_compatible_shard_node] - The minimum compatible version that all shards involved in search should have for this request to be successful
|
|
176
|
+
* @param {Object} [params.body] - The search definition using the Query DSL
|
|
177
|
+
*
|
|
178
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
179
|
+
* @param {function} callback - Callback that handles errors and response
|
|
180
|
+
*
|
|
181
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/latest/api-reference/search/#response-body Search Response}
|
|
182
|
+
*/
|
|
124
183
|
function searchApi(params, options, callback) {
|
|
125
184
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
126
185
|
|
package/api/api/search_shards.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
|
/*
|
|
@@ -55,6 +54,25 @@ const snakeCase = {
|
|
|
55
54
|
filterPath: 'filter_path',
|
|
56
55
|
};
|
|
57
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Returns information about the indices and shards that a search request would be executed against.
|
|
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 {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random)
|
|
65
|
+
* @param {string} [params.routing] - Specific routing value
|
|
66
|
+
* @param {boolean} [params.local] - Return local information, do not retrieve the state from cluster_manager node (default: false)
|
|
67
|
+
* @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
|
68
|
+
* @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)
|
|
69
|
+
* @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)
|
|
70
|
+
*
|
|
71
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
72
|
+
* @param {function} callback - Callback that handles errors and response
|
|
73
|
+
*
|
|
74
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
75
|
+
*/
|
|
58
76
|
function searchShardsApi(params, options, callback) {
|
|
59
77
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
60
78
|
|
|
@@ -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
|
/*
|
|
@@ -67,6 +66,33 @@ const snakeCase = {
|
|
|
67
66
|
filterPath: 'filter_path',
|
|
68
67
|
};
|
|
69
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Allows to use the Mustache language to pre-render a search definition.
|
|
71
|
+
*
|
|
72
|
+
* @memberOf API-Search
|
|
73
|
+
*
|
|
74
|
+
* @param {Object} params
|
|
75
|
+
* @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
|
|
76
|
+
* @param {Object} params.body - The search definition template and its params
|
|
77
|
+
* @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
|
78
|
+
* @param {boolean} [params.ignore_throttled] - Whether specified concrete, expanded or aliased indices should be ignored when throttled
|
|
79
|
+
* @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)
|
|
80
|
+
* @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)
|
|
81
|
+
* @param {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random)
|
|
82
|
+
* @param {string} [params.routing] - A comma-separated list of specific routing values
|
|
83
|
+
* @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search
|
|
84
|
+
* @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch)
|
|
85
|
+
* @param {boolean} [params.explain] - Specify whether to return detailed information about score computation as part of a hit
|
|
86
|
+
* @param {boolean} [params.profile] - Specify whether to profile the query execution
|
|
87
|
+
* @param {boolean} [params.typed_keys] - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
|
|
88
|
+
* @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
|
|
89
|
+
* @param {boolean} [params.ccs_minimize_roundtrips] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
|
|
90
|
+
*
|
|
91
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
92
|
+
* @param {function} callback - Callback that handles errors and response
|
|
93
|
+
*
|
|
94
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
95
|
+
*/
|
|
70
96
|
function searchTemplateApi(params, options, callback) {
|
|
71
97
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
72
98
|
|
package/api/api/shutdown.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
|
/*
|
|
@@ -42,6 +41,7 @@ function ShutdownApi(transport, ConfigurationError) {
|
|
|
42
41
|
this[kConfigurationError] = ConfigurationError;
|
|
43
42
|
}
|
|
44
43
|
|
|
44
|
+
// TODO: Remove. Added in ES 7.15
|
|
45
45
|
ShutdownApi.prototype.deleteNode = function shutdownDeleteNodeApi(params, options, callback) {
|
|
46
46
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
47
47
|
|
|
@@ -69,6 +69,7 @@ ShutdownApi.prototype.deleteNode = function shutdownDeleteNodeApi(params, option
|
|
|
69
69
|
return this.transport.request(request, options, callback);
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
+
// TODO: Remove. Added in ES 7.15
|
|
72
73
|
ShutdownApi.prototype.getNode = function shutdownGetNodeApi(params, options, callback) {
|
|
73
74
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
74
75
|
|
|
@@ -95,6 +96,7 @@ ShutdownApi.prototype.getNode = function shutdownGetNodeApi(params, options, cal
|
|
|
95
96
|
return this.transport.request(request, options, callback);
|
|
96
97
|
};
|
|
97
98
|
|
|
99
|
+
// TODO: Remove. Added in ES 7.15
|
|
98
100
|
ShutdownApi.prototype.putNode = function shutdownPutNodeApi(params, options, callback) {
|
|
99
101
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
100
102
|
|
package/api/api/snapshot.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-Snapshot */
|
|
36
|
+
|
|
36
37
|
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
|
|
37
38
|
const acceptedQuerystring = [
|
|
38
39
|
'cluster_manager_timeout',
|
|
@@ -84,6 +85,21 @@ function SnapshotApi(transport, ConfigurationError) {
|
|
|
84
85
|
this[kConfigurationError] = ConfigurationError;
|
|
85
86
|
}
|
|
86
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Removes stale data from repository.
|
|
90
|
+
*
|
|
91
|
+
* @memberOf API-Snapshot
|
|
92
|
+
*
|
|
93
|
+
* @param {Object} params
|
|
94
|
+
* @param {string} params.repository - A repository name
|
|
95
|
+
* @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
|
|
96
|
+
* @param {string} [params.timeout] - Explicit operation timeout
|
|
97
|
+
*
|
|
98
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
99
|
+
* @param {function} callback - Callback that handles errors and response
|
|
100
|
+
*
|
|
101
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
102
|
+
*/
|
|
87
103
|
SnapshotApi.prototype.cleanupRepository = function snapshotCleanupRepositoryApi(
|
|
88
104
|
params,
|
|
89
105
|
options,
|
|
@@ -115,6 +131,23 @@ SnapshotApi.prototype.cleanupRepository = function snapshotCleanupRepositoryApi(
|
|
|
115
131
|
return this.transport.request(request, options, callback);
|
|
116
132
|
};
|
|
117
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Clones indices from one snapshot into another snapshot in the same repository.
|
|
136
|
+
*
|
|
137
|
+
* @memberOf API-Snapshot
|
|
138
|
+
*
|
|
139
|
+
* @param {Object} params
|
|
140
|
+
* @param {string} params.repository - A repository name
|
|
141
|
+
* @param {string} params.snapshot - The name of the snapshot to clone from
|
|
142
|
+
* @param {Object} params.body - The snapshot clone definition
|
|
143
|
+
* @param {string} [params.target_snapshot] - The name of the cloned snapshot to create
|
|
144
|
+
* @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
|
|
145
|
+
*
|
|
146
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
147
|
+
* @param {function} callback - Callback that handles errors and response
|
|
148
|
+
*
|
|
149
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
150
|
+
*/
|
|
118
151
|
SnapshotApi.prototype.clone = function snapshotCloneApi(params, options, callback) {
|
|
119
152
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
120
153
|
|
|
@@ -181,6 +214,23 @@ SnapshotApi.prototype.clone = function snapshotCloneApi(params, options, callbac
|
|
|
181
214
|
return this.transport.request(request, options, callback);
|
|
182
215
|
};
|
|
183
216
|
|
|
217
|
+
/**
|
|
218
|
+
* Creates a snapshot in a repository.
|
|
219
|
+
*
|
|
220
|
+
* @memberOf API-Snapshot
|
|
221
|
+
*
|
|
222
|
+
* @param {Object} params
|
|
223
|
+
* @param {string} params.repository - A repository name
|
|
224
|
+
* @param {string} params.snapshot - A snapshot name
|
|
225
|
+
* @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
|
|
226
|
+
* @param {boolean} [params.wait_for_completion] - Should this request wait until the operation has completed before returning
|
|
227
|
+
* @param {Object} [params.body] - The snapshot definition
|
|
228
|
+
*
|
|
229
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
230
|
+
* @param {function} callback - Callback that handles errors and response
|
|
231
|
+
*
|
|
232
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
233
|
+
*/
|
|
184
234
|
SnapshotApi.prototype.create = function snapshotCreateApi(params, options, callback) {
|
|
185
235
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
186
236
|
|
|
@@ -219,6 +269,23 @@ SnapshotApi.prototype.create = function snapshotCreateApi(params, options, callb
|
|
|
219
269
|
return this.transport.request(request, options, callback);
|
|
220
270
|
};
|
|
221
271
|
|
|
272
|
+
/**
|
|
273
|
+
* Creates a repository.
|
|
274
|
+
*
|
|
275
|
+
* @memberOf API-Snapshot
|
|
276
|
+
*
|
|
277
|
+
* @param {Object} params
|
|
278
|
+
* @param {string} params.repository - A repository name
|
|
279
|
+
* @param {Object} params.body - The repository definition
|
|
280
|
+
* @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
|
|
281
|
+
* @param {string} [params.timeout] - Explicit operation timeout
|
|
282
|
+
* @param {boolean} [params.verify] - Whether to verify the repository after creation
|
|
283
|
+
*
|
|
284
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
285
|
+
* @param {function} callback - Callback that handles errors and response
|
|
286
|
+
*
|
|
287
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
288
|
+
*/
|
|
222
289
|
SnapshotApi.prototype.createRepository = function snapshotCreateRepositoryApi(
|
|
223
290
|
params,
|
|
224
291
|
options,
|
|
@@ -254,6 +321,22 @@ SnapshotApi.prototype.createRepository = function snapshotCreateRepositoryApi(
|
|
|
254
321
|
return this.transport.request(request, options, callback);
|
|
255
322
|
};
|
|
256
323
|
|
|
324
|
+
/**
|
|
325
|
+
* Deletes a snapshot.
|
|
326
|
+
*
|
|
327
|
+
* @memberOf API-Snapshot
|
|
328
|
+
*
|
|
329
|
+
* @param {Object} params
|
|
330
|
+
* @param {string} [params.repository] - A repository name
|
|
331
|
+
* @param {string} [params.snapshot] - A snapshot name
|
|
332
|
+
* @param {string} [params.master_timeout] - (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node
|
|
333
|
+
* @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
|
|
334
|
+
*
|
|
335
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
336
|
+
* @param {function} callback - Callback that handles errors and response
|
|
337
|
+
*
|
|
338
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
339
|
+
*/
|
|
257
340
|
SnapshotApi.prototype.delete = function snapshotDeleteApi(params, options, callback) {
|
|
258
341
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
259
342
|
|
|
@@ -292,6 +375,22 @@ SnapshotApi.prototype.delete = function snapshotDeleteApi(params, options, callb
|
|
|
292
375
|
return this.transport.request(request, options, callback);
|
|
293
376
|
};
|
|
294
377
|
|
|
378
|
+
/**
|
|
379
|
+
* Deletes a repository.
|
|
380
|
+
*
|
|
381
|
+
* @memberOf API-Snapshot
|
|
382
|
+
*
|
|
383
|
+
* @param {Object} params
|
|
384
|
+
* @param {string} [params.repository] - Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported.
|
|
385
|
+
* @param {string} [params.master_timeout] - (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node
|
|
386
|
+
* @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
|
|
387
|
+
* @param {string} [params.timeout] - Explicit operation timeout
|
|
388
|
+
*
|
|
389
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
390
|
+
* @param {function} callback - Callback that handles errors and response
|
|
391
|
+
*
|
|
392
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
393
|
+
*/
|
|
295
394
|
SnapshotApi.prototype.deleteRepository = function snapshotDeleteRepositoryApi(
|
|
296
395
|
params,
|
|
297
396
|
options,
|
|
@@ -323,6 +422,26 @@ SnapshotApi.prototype.deleteRepository = function snapshotDeleteRepositoryApi(
|
|
|
323
422
|
return this.transport.request(request, options, callback);
|
|
324
423
|
};
|
|
325
424
|
|
|
425
|
+
/**
|
|
426
|
+
* Returns information about a snapshot.
|
|
427
|
+
*
|
|
428
|
+
* @memberOf API-Snapshot
|
|
429
|
+
*
|
|
430
|
+
* @param {Object} params
|
|
431
|
+
* @param {string} [params.repository] - A repository name
|
|
432
|
+
* @param {string} [params.snapshot] - A comma-separated list of snapshot names
|
|
433
|
+
* @param {string} [params.master_timeout] - (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node
|
|
434
|
+
* @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
|
|
435
|
+
* @param {boolean} [params.ignore_unavailable] - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown
|
|
436
|
+
* @param {boolean} [params.index_details] - Whether to include details of each index in the snapshot, if those details are available. Defaults to false.
|
|
437
|
+
* @param {boolean} [params.include_repository] - Whether to include the repository name in the snapshot info. Defaults to true.
|
|
438
|
+
* @param {boolean} [params.verbose] - Whether to show verbose snapshot info or only show the basic info found in the repository index blob
|
|
439
|
+
*
|
|
440
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
441
|
+
* @param {function} callback - Callback that handles errors and response
|
|
442
|
+
*
|
|
443
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
444
|
+
*/
|
|
326
445
|
SnapshotApi.prototype.get = function snapshotGetApi(params, options, callback) {
|
|
327
446
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
328
447
|
|
|
@@ -361,6 +480,21 @@ SnapshotApi.prototype.get = function snapshotGetApi(params, options, callback) {
|
|
|
361
480
|
return this.transport.request(request, options, callback);
|
|
362
481
|
};
|
|
363
482
|
|
|
483
|
+
/**
|
|
484
|
+
* Returns information about a snapshot.
|
|
485
|
+
*
|
|
486
|
+
* @memberOf API-Snapshot
|
|
487
|
+
*
|
|
488
|
+
* @param {Object} params
|
|
489
|
+
* @param {string} [params.repository] - A comma-separated list of repository names
|
|
490
|
+
* @param {string} [params.master_timeout] - (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to cluster_manager node
|
|
491
|
+
* @param {boolean} [params.local] - Return local information, do not retrieve the state from cluster_manager node (default: false)
|
|
492
|
+
*
|
|
493
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
494
|
+
* @param {function} callback - Callback that handles errors and response
|
|
495
|
+
*
|
|
496
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
497
|
+
*/
|
|
364
498
|
SnapshotApi.prototype.getRepository = function snapshotGetRepositoryApi(params, options, callback) {
|
|
365
499
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
366
500
|
|
|
@@ -387,6 +521,30 @@ SnapshotApi.prototype.getRepository = function snapshotGetRepositoryApi(params,
|
|
|
387
521
|
return this.transport.request(request, options, callback);
|
|
388
522
|
};
|
|
389
523
|
|
|
524
|
+
/**
|
|
525
|
+
* Analyzes a repository for correctness and performance
|
|
526
|
+
*
|
|
527
|
+
* @memberOf API-Snapshot
|
|
528
|
+
*
|
|
529
|
+
* @param {Object} params
|
|
530
|
+
* @param {string} [params.repository] - A repository name
|
|
531
|
+
* @param {number} [params.blob_count] - Number of blobs to create during the test. Defaults to 100.
|
|
532
|
+
* @param {number} [params.concurrency] - Number of operations to run concurrently during the test. Defaults to 10.
|
|
533
|
+
* @param {number} [params.read_node_count] - Number of nodes on which to read a blob after writing. Defaults to 10.
|
|
534
|
+
* @param {number} [params.early_read_node_count] - Number of nodes on which to perform an early read on a blob, i.e. before writing has completed. Early reads are rare actions so the 'rare_action_probability' parameter is also relevant. Defaults to 2.
|
|
535
|
+
* @param {number} [params.seed] - Seed for the random number generator used to create the test workload. Defaults to a random value.
|
|
536
|
+
* @param {number} [params.rare_action_probability] - Probability of taking a rare action such as an early read or an overwrite. Defaults to 0.02.
|
|
537
|
+
* @param {string} [params.max_blob_size] - Maximum size of a blob to create during the test, e.g '1gb' or '100mb'. Defaults to '10mb'.
|
|
538
|
+
* @param {string} [params.max_total_data_size] - Maximum total size of all blobs to create during the test, e.g '1tb' or '100gb'. Defaults to '1gb'.
|
|
539
|
+
* @param {string} [params.timeout] - Explicit operation timeout. Defaults to '30s'.
|
|
540
|
+
* @param {boolean} [params.detailed] - Whether to return detailed results or a summary. Defaults to 'false' so that only the summary is returned.
|
|
541
|
+
* @param {boolean} [params.rarely_abort_writes] - Whether to rarely abort writes before they complete. Defaults to 'true'.
|
|
542
|
+
*
|
|
543
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
544
|
+
* @param {function} callback - Callback that handles errors and response
|
|
545
|
+
*
|
|
546
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
547
|
+
*/
|
|
390
548
|
SnapshotApi.prototype.repositoryAnalyze = function snapshotRepositoryAnalyzeApi(
|
|
391
549
|
params,
|
|
392
550
|
options,
|
|
@@ -418,6 +576,24 @@ SnapshotApi.prototype.repositoryAnalyze = function snapshotRepositoryAnalyzeApi(
|
|
|
418
576
|
return this.transport.request(request, options, callback);
|
|
419
577
|
};
|
|
420
578
|
|
|
579
|
+
/**
|
|
580
|
+
* Restores a snapshot.
|
|
581
|
+
*
|
|
582
|
+
* @memberOf API-Snapshot
|
|
583
|
+
*
|
|
584
|
+
* @param {Object} params
|
|
585
|
+
* @param {string} [params.repository] - A repository name
|
|
586
|
+
* @param {string} [params.snapshot] - A snapshot name
|
|
587
|
+
* @param {string} [params.master_timeout] - (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node
|
|
588
|
+
* @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
|
|
589
|
+
* @param {boolean} [params.wait_for_completion] - Should this request wait until the operation has completed before returning
|
|
590
|
+
* @param {Object} [params.body] - Details of what to restore
|
|
591
|
+
*
|
|
592
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
593
|
+
* @param {function} callback - Callback that handles errors and response
|
|
594
|
+
*
|
|
595
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
596
|
+
*/
|
|
421
597
|
SnapshotApi.prototype.restore = function snapshotRestoreApi(params, options, callback) {
|
|
422
598
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
423
599
|
|
|
@@ -463,6 +639,23 @@ SnapshotApi.prototype.restore = function snapshotRestoreApi(params, options, cal
|
|
|
463
639
|
return this.transport.request(request, options, callback);
|
|
464
640
|
};
|
|
465
641
|
|
|
642
|
+
/**
|
|
643
|
+
* Returns information about the status of a snapshot.
|
|
644
|
+
*
|
|
645
|
+
* @memberOf API-Snapshot
|
|
646
|
+
*
|
|
647
|
+
* @param {Object} params
|
|
648
|
+
* @param {string} [params.repository] - A repository name
|
|
649
|
+
* @param {string} [params.snapshot] - A comma-separated list of snapshot names
|
|
650
|
+
* @param {string} [params.master_timeout] - (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node
|
|
651
|
+
* @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
|
|
652
|
+
* @param {boolean} [params.ignore_unavailable] - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown
|
|
653
|
+
*
|
|
654
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
655
|
+
* @param {function} callback - Callback that handles errors and response
|
|
656
|
+
*
|
|
657
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
658
|
+
*/
|
|
466
659
|
SnapshotApi.prototype.status = function snapshotStatusApi(params, options, callback) {
|
|
467
660
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
468
661
|
|
|
@@ -506,6 +699,22 @@ SnapshotApi.prototype.status = function snapshotStatusApi(params, options, callb
|
|
|
506
699
|
return this.transport.request(request, options, callback);
|
|
507
700
|
};
|
|
508
701
|
|
|
702
|
+
/**
|
|
703
|
+
* Verifies a repository.
|
|
704
|
+
*
|
|
705
|
+
* @memberOf API-Snapshot
|
|
706
|
+
*
|
|
707
|
+
* @param {Object} params
|
|
708
|
+
* @param {string} [params.repository] - A repository name
|
|
709
|
+
* @param {string} [params.master_timeout] - (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node
|
|
710
|
+
* @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
|
|
711
|
+
* @param {string} [params.timeout] - Explicit operation timeout
|
|
712
|
+
*
|
|
713
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
714
|
+
* @param {function} callback - Callback that handles errors and response
|
|
715
|
+
*
|
|
716
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
717
|
+
*/
|
|
509
718
|
SnapshotApi.prototype.verifyRepository = function snapshotVerifyRepositoryApi(
|
|
510
719
|
params,
|
|
511
720
|
options,
|