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