@opensearch-project/opensearch 1.1.0 → 2.1.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/.eslintignore +2 -0
- package/.eslintrc.json +31 -0
- package/.prettierrc.json +5 -0
- package/.whitesource +15 -0
- package/ADMINS.md +13 -31
- package/CHANGELOG.md +24 -0
- package/COMPATIBILITY.md +27 -0
- package/DEVELOPER_GUIDE.md +22 -5
- package/MAINTAINERS.md +15 -70
- package/Makefile +2 -12
- package/README.md +19 -123
- package/RELEASING.md +3 -3
- package/SECURITY.md +1 -1
- package/USER_GUIDE.md +197 -0
- package/api/api/bulk.js +54 -28
- package/api/api/cat.js +355 -266
- package/api/api/clear_scroll.js +18 -19
- package/api/api/cluster.js +367 -221
- package/api/api/count.js +56 -26
- package/api/api/create.js +51 -26
- package/api/api/dangling_indices.js +96 -53
- package/api/api/delete.js +50 -24
- package/api/api/delete_by_query.js +89 -27
- package/api/api/delete_by_query_rethrottle.js +34 -21
- package/api/api/delete_script.js +32 -19
- package/api/api/exists.js +56 -24
- package/api/api/exists_source.js +61 -29
- package/api/api/explain.js +61 -24
- package/api/api/features.js +57 -37
- package/api/api/field_caps.js +37 -20
- package/api/api/get.js +56 -24
- package/api/api/get_script.js +31 -19
- package/api/api/get_script_context.js +16 -17
- package/api/api/get_script_languages.js +16 -17
- package/api/api/get_source.js +56 -24
- package/api/api/index.js +61 -30
- package/api/api/indices.js +1069 -859
- package/api/api/info.js +16 -17
- package/api/api/ingest.js +133 -98
- package/api/api/mget.js +51 -28
- package/api/api/msearch.js +50 -28
- package/api/api/msearch_template.js +54 -28
- package/api/api/mtermvectors.js +49 -26
- package/api/api/nodes.js +282 -156
- package/api/api/ping.js +16 -17
- package/api/api/put_script.js +41 -27
- package/api/api/rank_eval.js +38 -22
- package/api/api/reindex.js +39 -19
- package/api/api/reindex_rethrottle.js +33 -21
- package/api/api/render_search_template.js +19 -20
- package/api/api/scripts_painless_execute.js +16 -17
- package/api/api/scroll.js +32 -19
- package/api/api/search.js +109 -26
- package/api/api/search_shards.js +37 -20
- package/api/api/search_template.js +65 -28
- package/api/api/shutdown.js +67 -56
- package/api/api/snapshot.js +348 -226
- package/api/api/tasks.js +66 -48
- package/api/api/terms_enum.js +18 -19
- package/api/api/termvectors.js +58 -28
- package/api/api/update.js +65 -26
- package/api/api/update_by_query.js +90 -25
- package/api/api/update_by_query_rethrottle.js +34 -21
- package/api/index.js +268 -181
- package/api/new.d.ts +2043 -531
- package/api/opensearch_dashboards.d.ts +240 -238
- package/api/requestParams.d.ts +302 -71
- package/api/types.d.ts +6205 -5721
- package/api/utils.js +23 -24
- package/codecov.yml +2 -2
- package/index.d.ts +5203 -1037
- package/index.js +154 -143
- package/index.mjs +10 -11
- package/jenkins/release.JenkinsFile +11 -0
- package/lib/Connection.d.ts +38 -28
- package/lib/Connection.js +166 -170
- package/lib/Helpers.d.ts +108 -68
- package/lib/Helpers.js +401 -378
- package/lib/Serializer.d.ts +3 -4
- package/lib/Serializer.js +40 -41
- package/lib/Transport.d.ts +39 -15
- package/lib/Transport.js +381 -337
- package/lib/aws/AwsSigv4Signer.js +167 -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 +26 -9
- package/lib/errors.js +76 -73
- package/lib/pool/BaseConnectionPool.js +101 -99
- package/lib/pool/CloudConnectionPool.js +17 -18
- package/lib/pool/ConnectionPool.js +106 -107
- package/lib/pool/index.d.ts +9 -8
- package/lib/pool/index.js +7 -8
- package/package.json +37 -15
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
|
/*
|
|
@@ -28,277 +27,352 @@
|
|
|
28
27
|
* under the License.
|
|
29
28
|
*/
|
|
30
29
|
|
|
31
|
-
'use strict'
|
|
30
|
+
'use strict';
|
|
32
31
|
|
|
33
32
|
/* eslint camelcase: 0 */
|
|
34
33
|
/* eslint no-unused-vars: 0 */
|
|
35
34
|
|
|
36
|
-
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
|
37
|
-
const acceptedQuerystring = [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
|
|
36
|
+
const acceptedQuerystring = [
|
|
37
|
+
'cluster_manager_timeout',
|
|
38
|
+
'master_timeout',
|
|
39
|
+
'timeout',
|
|
40
|
+
'pretty',
|
|
41
|
+
'human',
|
|
42
|
+
'error_trace',
|
|
43
|
+
'source',
|
|
44
|
+
'filter_path',
|
|
45
|
+
'wait_for_completion',
|
|
46
|
+
'verify',
|
|
47
|
+
'ignore_unavailable',
|
|
48
|
+
'index_details',
|
|
49
|
+
'include_repository',
|
|
50
|
+
'verbose',
|
|
51
|
+
'local',
|
|
52
|
+
'blob_count',
|
|
53
|
+
'concurrency',
|
|
54
|
+
'read_node_count',
|
|
55
|
+
'early_read_node_count',
|
|
56
|
+
'seed',
|
|
57
|
+
'rare_action_probability',
|
|
58
|
+
'max_blob_size',
|
|
59
|
+
'max_total_data_size',
|
|
60
|
+
'detailed',
|
|
61
|
+
'rarely_abort_writes',
|
|
62
|
+
];
|
|
63
|
+
const snakeCase = {
|
|
64
|
+
clusterManagerTimeout: 'cluster_manager_timeout',
|
|
65
|
+
masterTimeout: 'master_timeout',
|
|
66
|
+
errorTrace: 'error_trace',
|
|
67
|
+
filterPath: 'filter_path',
|
|
68
|
+
waitForCompletion: 'wait_for_completion',
|
|
69
|
+
ignoreUnavailable: 'ignore_unavailable',
|
|
70
|
+
indexDetails: 'index_details',
|
|
71
|
+
includeRepository: 'include_repository',
|
|
72
|
+
blobCount: 'blob_count',
|
|
73
|
+
readNodeCount: 'read_node_count',
|
|
74
|
+
earlyReadNodeCount: 'early_read_node_count',
|
|
75
|
+
rareActionProbability: 'rare_action_probability',
|
|
76
|
+
maxBlobSize: 'max_blob_size',
|
|
77
|
+
maxTotalDataSize: 'max_total_data_size',
|
|
78
|
+
rarelyAbortWrites: 'rarely_abort_writes',
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
function SnapshotApi(transport, ConfigurationError) {
|
|
82
|
+
this.transport = transport;
|
|
83
|
+
this[kConfigurationError] = ConfigurationError;
|
|
43
84
|
}
|
|
44
85
|
|
|
45
|
-
SnapshotApi.prototype.cleanupRepository = function snapshotCleanupRepositoryApi
|
|
46
|
-
|
|
86
|
+
SnapshotApi.prototype.cleanupRepository = function snapshotCleanupRepositoryApi(
|
|
87
|
+
params,
|
|
88
|
+
options,
|
|
89
|
+
callback
|
|
90
|
+
) {
|
|
91
|
+
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
47
92
|
|
|
48
93
|
// check required parameters
|
|
49
94
|
if (params.repository == null) {
|
|
50
|
-
const err = new this[kConfigurationError]('Missing required parameter: repository')
|
|
51
|
-
return handleError(err, callback)
|
|
95
|
+
const err = new this[kConfigurationError]('Missing required parameter: repository');
|
|
96
|
+
return handleError(err, callback);
|
|
52
97
|
}
|
|
53
98
|
|
|
54
|
-
let { method, body, repository, ...querystring } = params
|
|
55
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
99
|
+
let { method, body, repository, ...querystring } = params;
|
|
100
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
|
|
56
101
|
|
|
57
|
-
let path = ''
|
|
58
|
-
if (method == null) method = 'POST'
|
|
59
|
-
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_cleanup'
|
|
102
|
+
let path = '';
|
|
103
|
+
if (method == null) method = 'POST';
|
|
104
|
+
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_cleanup';
|
|
60
105
|
|
|
61
106
|
// build request object
|
|
62
107
|
const request = {
|
|
63
108
|
method,
|
|
64
109
|
path,
|
|
65
110
|
body: body || '',
|
|
66
|
-
querystring
|
|
67
|
-
}
|
|
111
|
+
querystring,
|
|
112
|
+
};
|
|
68
113
|
|
|
69
|
-
return this.transport.request(request, options, callback)
|
|
70
|
-
}
|
|
114
|
+
return this.transport.request(request, options, callback);
|
|
115
|
+
};
|
|
71
116
|
|
|
72
|
-
SnapshotApi.prototype.clone = function snapshotCloneApi
|
|
73
|
-
|
|
117
|
+
SnapshotApi.prototype.clone = function snapshotCloneApi(params, options, callback) {
|
|
118
|
+
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
74
119
|
|
|
75
120
|
// check required parameters
|
|
76
121
|
if (params.repository == null) {
|
|
77
|
-
const err = new this[kConfigurationError]('Missing required parameter: repository')
|
|
78
|
-
return handleError(err, callback)
|
|
122
|
+
const err = new this[kConfigurationError]('Missing required parameter: repository');
|
|
123
|
+
return handleError(err, callback);
|
|
79
124
|
}
|
|
80
125
|
if (params.snapshot == null) {
|
|
81
|
-
const err = new this[kConfigurationError]('Missing required parameter: snapshot')
|
|
82
|
-
return handleError(err, callback)
|
|
126
|
+
const err = new this[kConfigurationError]('Missing required parameter: snapshot');
|
|
127
|
+
return handleError(err, callback);
|
|
83
128
|
}
|
|
84
129
|
if (params.target_snapshot == null && params.targetSnapshot == null) {
|
|
85
|
-
const err = new this[kConfigurationError](
|
|
86
|
-
|
|
130
|
+
const err = new this[kConfigurationError](
|
|
131
|
+
'Missing required parameter: target_snapshot or targetSnapshot'
|
|
132
|
+
);
|
|
133
|
+
return handleError(err, callback);
|
|
87
134
|
}
|
|
88
135
|
if (params.body == null) {
|
|
89
|
-
const err = new this[kConfigurationError]('Missing required parameter: body')
|
|
90
|
-
return handleError(err, callback)
|
|
136
|
+
const err = new this[kConfigurationError]('Missing required parameter: body');
|
|
137
|
+
return handleError(err, callback);
|
|
91
138
|
}
|
|
92
139
|
|
|
93
140
|
// check required url components
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const err = new this[kConfigurationError](
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
141
|
+
if (
|
|
142
|
+
(params.target_snapshot != null || params.targetSnapshot != null) &&
|
|
143
|
+
(params.snapshot == null || params.repository == null)
|
|
144
|
+
) {
|
|
145
|
+
const err = new this[kConfigurationError](
|
|
146
|
+
'Missing required parameter of the url: snapshot, repository'
|
|
147
|
+
);
|
|
148
|
+
return handleError(err, callback);
|
|
149
|
+
} else if (params.snapshot != null && params.repository == null) {
|
|
150
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: repository');
|
|
151
|
+
return handleError(err, callback);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
let { method, body, repository, snapshot, targetSnapshot, target_snapshot, ...querystring } =
|
|
155
|
+
params;
|
|
156
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
|
|
157
|
+
|
|
158
|
+
let path = '';
|
|
159
|
+
if (method == null) method = 'PUT';
|
|
160
|
+
path =
|
|
161
|
+
'/' +
|
|
162
|
+
'_snapshot' +
|
|
163
|
+
'/' +
|
|
164
|
+
encodeURIComponent(repository) +
|
|
165
|
+
'/' +
|
|
166
|
+
encodeURIComponent(snapshot) +
|
|
167
|
+
'/' +
|
|
168
|
+
'_clone' +
|
|
169
|
+
'/' +
|
|
170
|
+
encodeURIComponent(target_snapshot || targetSnapshot);
|
|
108
171
|
|
|
109
172
|
// build request object
|
|
110
173
|
const request = {
|
|
111
174
|
method,
|
|
112
175
|
path,
|
|
113
176
|
body: body || '',
|
|
114
|
-
querystring
|
|
115
|
-
}
|
|
177
|
+
querystring,
|
|
178
|
+
};
|
|
116
179
|
|
|
117
|
-
return this.transport.request(request, options, callback)
|
|
118
|
-
}
|
|
180
|
+
return this.transport.request(request, options, callback);
|
|
181
|
+
};
|
|
119
182
|
|
|
120
|
-
SnapshotApi.prototype.create = function snapshotCreateApi
|
|
121
|
-
|
|
183
|
+
SnapshotApi.prototype.create = function snapshotCreateApi(params, options, callback) {
|
|
184
|
+
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
122
185
|
|
|
123
186
|
// check required parameters
|
|
124
187
|
if (params.repository == null) {
|
|
125
|
-
const err = new this[kConfigurationError]('Missing required parameter: repository')
|
|
126
|
-
return handleError(err, callback)
|
|
188
|
+
const err = new this[kConfigurationError]('Missing required parameter: repository');
|
|
189
|
+
return handleError(err, callback);
|
|
127
190
|
}
|
|
128
191
|
if (params.snapshot == null) {
|
|
129
|
-
const err = new this[kConfigurationError]('Missing required parameter: snapshot')
|
|
130
|
-
return handleError(err, callback)
|
|
192
|
+
const err = new this[kConfigurationError]('Missing required parameter: snapshot');
|
|
193
|
+
return handleError(err, callback);
|
|
131
194
|
}
|
|
132
195
|
|
|
133
196
|
// check required url components
|
|
134
|
-
if (params.snapshot != null &&
|
|
135
|
-
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
|
|
136
|
-
return handleError(err, callback)
|
|
197
|
+
if (params.snapshot != null && params.repository == null) {
|
|
198
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: repository');
|
|
199
|
+
return handleError(err, callback);
|
|
137
200
|
}
|
|
138
201
|
|
|
139
|
-
let { method, body, repository, snapshot, ...querystring } = params
|
|
140
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
202
|
+
let { method, body, repository, snapshot, ...querystring } = params;
|
|
203
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
|
|
141
204
|
|
|
142
|
-
let path = ''
|
|
143
|
-
if (method == null) method = 'PUT'
|
|
144
|
-
path =
|
|
205
|
+
let path = '';
|
|
206
|
+
if (method == null) method = 'PUT';
|
|
207
|
+
path =
|
|
208
|
+
'/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot);
|
|
145
209
|
|
|
146
210
|
// build request object
|
|
147
211
|
const request = {
|
|
148
212
|
method,
|
|
149
213
|
path,
|
|
150
214
|
body: body || '',
|
|
151
|
-
querystring
|
|
152
|
-
}
|
|
215
|
+
querystring,
|
|
216
|
+
};
|
|
153
217
|
|
|
154
|
-
return this.transport.request(request, options, callback)
|
|
155
|
-
}
|
|
218
|
+
return this.transport.request(request, options, callback);
|
|
219
|
+
};
|
|
156
220
|
|
|
157
|
-
SnapshotApi.prototype.createRepository = function snapshotCreateRepositoryApi
|
|
158
|
-
|
|
221
|
+
SnapshotApi.prototype.createRepository = function snapshotCreateRepositoryApi(
|
|
222
|
+
params,
|
|
223
|
+
options,
|
|
224
|
+
callback
|
|
225
|
+
) {
|
|
226
|
+
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
159
227
|
|
|
160
228
|
// check required parameters
|
|
161
229
|
if (params.repository == null) {
|
|
162
|
-
const err = new this[kConfigurationError]('Missing required parameter: repository')
|
|
163
|
-
return handleError(err, callback)
|
|
230
|
+
const err = new this[kConfigurationError]('Missing required parameter: repository');
|
|
231
|
+
return handleError(err, callback);
|
|
164
232
|
}
|
|
165
233
|
if (params.body == null) {
|
|
166
|
-
const err = new this[kConfigurationError]('Missing required parameter: body')
|
|
167
|
-
return handleError(err, callback)
|
|
234
|
+
const err = new this[kConfigurationError]('Missing required parameter: body');
|
|
235
|
+
return handleError(err, callback);
|
|
168
236
|
}
|
|
169
237
|
|
|
170
|
-
let { method, body, repository, ...querystring } = params
|
|
171
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
238
|
+
let { method, body, repository, ...querystring } = params;
|
|
239
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
|
|
172
240
|
|
|
173
|
-
let path = ''
|
|
174
|
-
if (method == null) method = 'PUT'
|
|
175
|
-
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository)
|
|
241
|
+
let path = '';
|
|
242
|
+
if (method == null) method = 'PUT';
|
|
243
|
+
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository);
|
|
176
244
|
|
|
177
245
|
// build request object
|
|
178
246
|
const request = {
|
|
179
247
|
method,
|
|
180
248
|
path,
|
|
181
249
|
body: body || '',
|
|
182
|
-
querystring
|
|
183
|
-
}
|
|
250
|
+
querystring,
|
|
251
|
+
};
|
|
184
252
|
|
|
185
|
-
return this.transport.request(request, options, callback)
|
|
186
|
-
}
|
|
253
|
+
return this.transport.request(request, options, callback);
|
|
254
|
+
};
|
|
187
255
|
|
|
188
|
-
SnapshotApi.prototype.delete = function snapshotDeleteApi
|
|
189
|
-
|
|
256
|
+
SnapshotApi.prototype.delete = function snapshotDeleteApi(params, options, callback) {
|
|
257
|
+
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
190
258
|
|
|
191
259
|
// check required parameters
|
|
192
260
|
if (params.repository == null) {
|
|
193
|
-
const err = new this[kConfigurationError]('Missing required parameter: repository')
|
|
194
|
-
return handleError(err, callback)
|
|
261
|
+
const err = new this[kConfigurationError]('Missing required parameter: repository');
|
|
262
|
+
return handleError(err, callback);
|
|
195
263
|
}
|
|
196
264
|
if (params.snapshot == null) {
|
|
197
|
-
const err = new this[kConfigurationError]('Missing required parameter: snapshot')
|
|
198
|
-
return handleError(err, callback)
|
|
265
|
+
const err = new this[kConfigurationError]('Missing required parameter: snapshot');
|
|
266
|
+
return handleError(err, callback);
|
|
199
267
|
}
|
|
200
268
|
|
|
201
269
|
// check required url components
|
|
202
|
-
if (params.snapshot != null &&
|
|
203
|
-
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
|
|
204
|
-
return handleError(err, callback)
|
|
270
|
+
if (params.snapshot != null && params.repository == null) {
|
|
271
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: repository');
|
|
272
|
+
return handleError(err, callback);
|
|
205
273
|
}
|
|
206
274
|
|
|
207
|
-
let { method, body, repository, snapshot, ...querystring } = params
|
|
208
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
275
|
+
let { method, body, repository, snapshot, ...querystring } = params;
|
|
276
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
|
|
209
277
|
|
|
210
|
-
let path = ''
|
|
211
|
-
if (method == null) method = 'DELETE'
|
|
212
|
-
path =
|
|
278
|
+
let path = '';
|
|
279
|
+
if (method == null) method = 'DELETE';
|
|
280
|
+
path =
|
|
281
|
+
'/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot);
|
|
213
282
|
|
|
214
283
|
// build request object
|
|
215
284
|
const request = {
|
|
216
285
|
method,
|
|
217
286
|
path,
|
|
218
287
|
body: body || '',
|
|
219
|
-
querystring
|
|
220
|
-
}
|
|
288
|
+
querystring,
|
|
289
|
+
};
|
|
221
290
|
|
|
222
|
-
return this.transport.request(request, options, callback)
|
|
223
|
-
}
|
|
291
|
+
return this.transport.request(request, options, callback);
|
|
292
|
+
};
|
|
224
293
|
|
|
225
|
-
SnapshotApi.prototype.deleteRepository = function snapshotDeleteRepositoryApi
|
|
226
|
-
|
|
294
|
+
SnapshotApi.prototype.deleteRepository = function snapshotDeleteRepositoryApi(
|
|
295
|
+
params,
|
|
296
|
+
options,
|
|
297
|
+
callback
|
|
298
|
+
) {
|
|
299
|
+
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
227
300
|
|
|
228
301
|
// check required parameters
|
|
229
302
|
if (params.repository == null) {
|
|
230
|
-
const err = new this[kConfigurationError]('Missing required parameter: repository')
|
|
231
|
-
return handleError(err, callback)
|
|
303
|
+
const err = new this[kConfigurationError]('Missing required parameter: repository');
|
|
304
|
+
return handleError(err, callback);
|
|
232
305
|
}
|
|
233
306
|
|
|
234
|
-
let { method, body, repository, ...querystring } = params
|
|
235
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
307
|
+
let { method, body, repository, ...querystring } = params;
|
|
308
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
|
|
236
309
|
|
|
237
|
-
let path = ''
|
|
238
|
-
if (method == null) method = 'DELETE'
|
|
239
|
-
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository)
|
|
310
|
+
let path = '';
|
|
311
|
+
if (method == null) method = 'DELETE';
|
|
312
|
+
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository);
|
|
240
313
|
|
|
241
314
|
// build request object
|
|
242
315
|
const request = {
|
|
243
316
|
method,
|
|
244
317
|
path,
|
|
245
318
|
body: body || '',
|
|
246
|
-
querystring
|
|
247
|
-
}
|
|
319
|
+
querystring,
|
|
320
|
+
};
|
|
248
321
|
|
|
249
|
-
return this.transport.request(request, options, callback)
|
|
250
|
-
}
|
|
322
|
+
return this.transport.request(request, options, callback);
|
|
323
|
+
};
|
|
251
324
|
|
|
252
|
-
SnapshotApi.prototype.get = function snapshotGetApi
|
|
253
|
-
|
|
325
|
+
SnapshotApi.prototype.get = function snapshotGetApi(params, options, callback) {
|
|
326
|
+
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
254
327
|
|
|
255
328
|
// check required parameters
|
|
256
329
|
if (params.repository == null) {
|
|
257
|
-
const err = new this[kConfigurationError]('Missing required parameter: repository')
|
|
258
|
-
return handleError(err, callback)
|
|
330
|
+
const err = new this[kConfigurationError]('Missing required parameter: repository');
|
|
331
|
+
return handleError(err, callback);
|
|
259
332
|
}
|
|
260
333
|
if (params.snapshot == null) {
|
|
261
|
-
const err = new this[kConfigurationError]('Missing required parameter: snapshot')
|
|
262
|
-
return handleError(err, callback)
|
|
334
|
+
const err = new this[kConfigurationError]('Missing required parameter: snapshot');
|
|
335
|
+
return handleError(err, callback);
|
|
263
336
|
}
|
|
264
337
|
|
|
265
338
|
// check required url components
|
|
266
|
-
if (params.snapshot != null &&
|
|
267
|
-
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
|
|
268
|
-
return handleError(err, callback)
|
|
339
|
+
if (params.snapshot != null && params.repository == null) {
|
|
340
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: repository');
|
|
341
|
+
return handleError(err, callback);
|
|
269
342
|
}
|
|
270
343
|
|
|
271
|
-
let { method, body, repository, snapshot, ...querystring } = params
|
|
272
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
344
|
+
let { method, body, repository, snapshot, ...querystring } = params;
|
|
345
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
|
|
273
346
|
|
|
274
|
-
let path = ''
|
|
275
|
-
if (method == null) method = 'GET'
|
|
276
|
-
path =
|
|
347
|
+
let path = '';
|
|
348
|
+
if (method == null) method = 'GET';
|
|
349
|
+
path =
|
|
350
|
+
'/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot);
|
|
277
351
|
|
|
278
352
|
// build request object
|
|
279
353
|
const request = {
|
|
280
354
|
method,
|
|
281
355
|
path,
|
|
282
356
|
body: null,
|
|
283
|
-
querystring
|
|
284
|
-
}
|
|
357
|
+
querystring,
|
|
358
|
+
};
|
|
285
359
|
|
|
286
|
-
return this.transport.request(request, options, callback)
|
|
287
|
-
}
|
|
360
|
+
return this.transport.request(request, options, callback);
|
|
361
|
+
};
|
|
288
362
|
|
|
289
|
-
SnapshotApi.prototype.getRepository = function snapshotGetRepositoryApi
|
|
290
|
-
|
|
363
|
+
SnapshotApi.prototype.getRepository = function snapshotGetRepositoryApi(params, options, callback) {
|
|
364
|
+
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
291
365
|
|
|
292
|
-
let { method, body, repository, ...querystring } = params
|
|
293
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
366
|
+
let { method, body, repository, ...querystring } = params;
|
|
367
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
|
|
294
368
|
|
|
295
|
-
let path = ''
|
|
296
|
-
if (
|
|
297
|
-
if (method == null) method = 'GET'
|
|
298
|
-
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository)
|
|
369
|
+
let path = '';
|
|
370
|
+
if (repository != null) {
|
|
371
|
+
if (method == null) method = 'GET';
|
|
372
|
+
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository);
|
|
299
373
|
} else {
|
|
300
|
-
if (method == null) method = 'GET'
|
|
301
|
-
path = '/' + '_snapshot'
|
|
374
|
+
if (method == null) method = 'GET';
|
|
375
|
+
path = '/' + '_snapshot';
|
|
302
376
|
}
|
|
303
377
|
|
|
304
378
|
// build request object
|
|
@@ -306,98 +380,118 @@ SnapshotApi.prototype.getRepository = function snapshotGetRepositoryApi (params,
|
|
|
306
380
|
method,
|
|
307
381
|
path,
|
|
308
382
|
body: null,
|
|
309
|
-
querystring
|
|
310
|
-
}
|
|
383
|
+
querystring,
|
|
384
|
+
};
|
|
311
385
|
|
|
312
|
-
return this.transport.request(request, options, callback)
|
|
313
|
-
}
|
|
386
|
+
return this.transport.request(request, options, callback);
|
|
387
|
+
};
|
|
314
388
|
|
|
315
|
-
SnapshotApi.prototype.repositoryAnalyze = function snapshotRepositoryAnalyzeApi
|
|
316
|
-
|
|
389
|
+
SnapshotApi.prototype.repositoryAnalyze = function snapshotRepositoryAnalyzeApi(
|
|
390
|
+
params,
|
|
391
|
+
options,
|
|
392
|
+
callback
|
|
393
|
+
) {
|
|
394
|
+
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
317
395
|
|
|
318
396
|
// check required parameters
|
|
319
397
|
if (params.repository == null) {
|
|
320
|
-
const err = new this[kConfigurationError]('Missing required parameter: repository')
|
|
321
|
-
return handleError(err, callback)
|
|
398
|
+
const err = new this[kConfigurationError]('Missing required parameter: repository');
|
|
399
|
+
return handleError(err, callback);
|
|
322
400
|
}
|
|
323
401
|
|
|
324
|
-
let { method, body, repository, ...querystring } = params
|
|
325
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
402
|
+
let { method, body, repository, ...querystring } = params;
|
|
403
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
|
|
326
404
|
|
|
327
|
-
let path = ''
|
|
328
|
-
if (method == null) method = 'POST'
|
|
329
|
-
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_analyze'
|
|
405
|
+
let path = '';
|
|
406
|
+
if (method == null) method = 'POST';
|
|
407
|
+
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_analyze';
|
|
330
408
|
|
|
331
409
|
// build request object
|
|
332
410
|
const request = {
|
|
333
411
|
method,
|
|
334
412
|
path,
|
|
335
413
|
body: body || '',
|
|
336
|
-
querystring
|
|
337
|
-
}
|
|
414
|
+
querystring,
|
|
415
|
+
};
|
|
338
416
|
|
|
339
|
-
return this.transport.request(request, options, callback)
|
|
340
|
-
}
|
|
417
|
+
return this.transport.request(request, options, callback);
|
|
418
|
+
};
|
|
341
419
|
|
|
342
|
-
SnapshotApi.prototype.restore = function snapshotRestoreApi
|
|
343
|
-
|
|
420
|
+
SnapshotApi.prototype.restore = function snapshotRestoreApi(params, options, callback) {
|
|
421
|
+
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
344
422
|
|
|
345
423
|
// check required parameters
|
|
346
424
|
if (params.repository == null) {
|
|
347
|
-
const err = new this[kConfigurationError]('Missing required parameter: repository')
|
|
348
|
-
return handleError(err, callback)
|
|
425
|
+
const err = new this[kConfigurationError]('Missing required parameter: repository');
|
|
426
|
+
return handleError(err, callback);
|
|
349
427
|
}
|
|
350
428
|
if (params.snapshot == null) {
|
|
351
|
-
const err = new this[kConfigurationError]('Missing required parameter: snapshot')
|
|
352
|
-
return handleError(err, callback)
|
|
429
|
+
const err = new this[kConfigurationError]('Missing required parameter: snapshot');
|
|
430
|
+
return handleError(err, callback);
|
|
353
431
|
}
|
|
354
432
|
|
|
355
433
|
// check required url components
|
|
356
|
-
if (params.snapshot != null &&
|
|
357
|
-
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
|
|
358
|
-
return handleError(err, callback)
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
let { method, body, repository, snapshot, ...querystring } = params
|
|
362
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
363
|
-
|
|
364
|
-
let path = ''
|
|
365
|
-
if (method == null) method = 'POST'
|
|
366
|
-
path =
|
|
434
|
+
if (params.snapshot != null && params.repository == null) {
|
|
435
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: repository');
|
|
436
|
+
return handleError(err, callback);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
let { method, body, repository, snapshot, ...querystring } = params;
|
|
440
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
|
|
441
|
+
|
|
442
|
+
let path = '';
|
|
443
|
+
if (method == null) method = 'POST';
|
|
444
|
+
path =
|
|
445
|
+
'/' +
|
|
446
|
+
'_snapshot' +
|
|
447
|
+
'/' +
|
|
448
|
+
encodeURIComponent(repository) +
|
|
449
|
+
'/' +
|
|
450
|
+
encodeURIComponent(snapshot) +
|
|
451
|
+
'/' +
|
|
452
|
+
'_restore';
|
|
367
453
|
|
|
368
454
|
// build request object
|
|
369
455
|
const request = {
|
|
370
456
|
method,
|
|
371
457
|
path,
|
|
372
458
|
body: body || '',
|
|
373
|
-
querystring
|
|
374
|
-
}
|
|
459
|
+
querystring,
|
|
460
|
+
};
|
|
375
461
|
|
|
376
|
-
return this.transport.request(request, options, callback)
|
|
377
|
-
}
|
|
462
|
+
return this.transport.request(request, options, callback);
|
|
463
|
+
};
|
|
378
464
|
|
|
379
|
-
SnapshotApi.prototype.status = function snapshotStatusApi
|
|
380
|
-
|
|
465
|
+
SnapshotApi.prototype.status = function snapshotStatusApi(params, options, callback) {
|
|
466
|
+
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
381
467
|
|
|
382
468
|
// check required url components
|
|
383
|
-
if (params.snapshot != null &&
|
|
384
|
-
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
|
|
385
|
-
return handleError(err, callback)
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
let { method, body, repository, snapshot, ...querystring } = params
|
|
389
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
390
|
-
|
|
391
|
-
let path = ''
|
|
392
|
-
if (
|
|
393
|
-
if (method == null) method = 'GET'
|
|
394
|
-
path =
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
469
|
+
if (params.snapshot != null && params.repository == null) {
|
|
470
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: repository');
|
|
471
|
+
return handleError(err, callback);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
let { method, body, repository, snapshot, ...querystring } = params;
|
|
475
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
|
|
476
|
+
|
|
477
|
+
let path = '';
|
|
478
|
+
if (repository != null && snapshot != null) {
|
|
479
|
+
if (method == null) method = 'GET';
|
|
480
|
+
path =
|
|
481
|
+
'/' +
|
|
482
|
+
'_snapshot' +
|
|
483
|
+
'/' +
|
|
484
|
+
encodeURIComponent(repository) +
|
|
485
|
+
'/' +
|
|
486
|
+
encodeURIComponent(snapshot) +
|
|
487
|
+
'/' +
|
|
488
|
+
'_status';
|
|
489
|
+
} else if (repository != null) {
|
|
490
|
+
if (method == null) method = 'GET';
|
|
491
|
+
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_status';
|
|
398
492
|
} else {
|
|
399
|
-
if (method == null) method = 'GET'
|
|
400
|
-
path = '/' + '_snapshot' + '/' + '_status'
|
|
493
|
+
if (method == null) method = 'GET';
|
|
494
|
+
path = '/' + '_snapshot' + '/' + '_status';
|
|
401
495
|
}
|
|
402
496
|
|
|
403
497
|
// build request object
|
|
@@ -405,46 +499,74 @@ SnapshotApi.prototype.status = function snapshotStatusApi (params, options, call
|
|
|
405
499
|
method,
|
|
406
500
|
path,
|
|
407
501
|
body: null,
|
|
408
|
-
querystring
|
|
409
|
-
}
|
|
502
|
+
querystring,
|
|
503
|
+
};
|
|
410
504
|
|
|
411
|
-
return this.transport.request(request, options, callback)
|
|
412
|
-
}
|
|
505
|
+
return this.transport.request(request, options, callback);
|
|
506
|
+
};
|
|
413
507
|
|
|
414
|
-
SnapshotApi.prototype.verifyRepository = function snapshotVerifyRepositoryApi
|
|
415
|
-
|
|
508
|
+
SnapshotApi.prototype.verifyRepository = function snapshotVerifyRepositoryApi(
|
|
509
|
+
params,
|
|
510
|
+
options,
|
|
511
|
+
callback
|
|
512
|
+
) {
|
|
513
|
+
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
416
514
|
|
|
417
515
|
// check required parameters
|
|
418
516
|
if (params.repository == null) {
|
|
419
|
-
const err = new this[kConfigurationError]('Missing required parameter: repository')
|
|
420
|
-
return handleError(err, callback)
|
|
517
|
+
const err = new this[kConfigurationError]('Missing required parameter: repository');
|
|
518
|
+
return handleError(err, callback);
|
|
421
519
|
}
|
|
422
520
|
|
|
423
|
-
let { method, body, repository, ...querystring } = params
|
|
424
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
521
|
+
let { method, body, repository, ...querystring } = params;
|
|
522
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
|
|
425
523
|
|
|
426
|
-
let path = ''
|
|
427
|
-
if (method == null) method = 'POST'
|
|
428
|
-
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_verify'
|
|
524
|
+
let path = '';
|
|
525
|
+
if (method == null) method = 'POST';
|
|
526
|
+
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_verify';
|
|
429
527
|
|
|
430
528
|
// build request object
|
|
431
529
|
const request = {
|
|
432
530
|
method,
|
|
433
531
|
path,
|
|
434
532
|
body: body || '',
|
|
435
|
-
querystring
|
|
436
|
-
}
|
|
533
|
+
querystring,
|
|
534
|
+
};
|
|
437
535
|
|
|
438
|
-
return this.transport.request(request, options, callback)
|
|
439
|
-
}
|
|
536
|
+
return this.transport.request(request, options, callback);
|
|
537
|
+
};
|
|
440
538
|
|
|
441
539
|
Object.defineProperties(SnapshotApi.prototype, {
|
|
442
|
-
cleanup_repository: {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
540
|
+
cleanup_repository: {
|
|
541
|
+
get() {
|
|
542
|
+
return this.cleanupRepository;
|
|
543
|
+
},
|
|
544
|
+
},
|
|
545
|
+
create_repository: {
|
|
546
|
+
get() {
|
|
547
|
+
return this.createRepository;
|
|
548
|
+
},
|
|
549
|
+
},
|
|
550
|
+
delete_repository: {
|
|
551
|
+
get() {
|
|
552
|
+
return this.deleteRepository;
|
|
553
|
+
},
|
|
554
|
+
},
|
|
555
|
+
get_repository: {
|
|
556
|
+
get() {
|
|
557
|
+
return this.getRepository;
|
|
558
|
+
},
|
|
559
|
+
},
|
|
560
|
+
repository_analyze: {
|
|
561
|
+
get() {
|
|
562
|
+
return this.repositoryAnalyze;
|
|
563
|
+
},
|
|
564
|
+
},
|
|
565
|
+
verify_repository: {
|
|
566
|
+
get() {
|
|
567
|
+
return this.verifyRepository;
|
|
568
|
+
},
|
|
569
|
+
},
|
|
570
|
+
});
|
|
571
|
+
|
|
572
|
+
module.exports = SnapshotApi;
|