@elastic/elasticsearch 7.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +5 -0
- package/LICENSE +202 -0
- package/README.md +232 -0
- package/api/api/async_search.js +141 -0
- package/api/api/autoscaling.js +147 -0
- package/api/api/bulk.js +70 -0
- package/api/api/cat.js +648 -0
- package/api/api/ccr.js +403 -0
- package/api/api/clear_scroll.js +55 -0
- package/api/api/close_point_in_time.js +50 -0
- package/api/api/cluster.js +420 -0
- package/api/api/count.js +64 -0
- package/api/api/create.js +69 -0
- package/api/api/dangling_indices.js +115 -0
- package/api/api/delete.js +65 -0
- package/api/api/delete_by_query.js +71 -0
- package/api/api/delete_by_query_rethrottle.js +60 -0
- package/api/api/delete_script.js +56 -0
- package/api/api/enrich.js +173 -0
- package/api/api/eql.js +150 -0
- package/api/api/exists.js +65 -0
- package/api/api/exists_source.js +74 -0
- package/api/api/explain.js +65 -0
- package/api/api/features.js +81 -0
- package/api/api/field_caps.js +55 -0
- package/api/api/fleet.js +65 -0
- package/api/api/get.js +65 -0
- package/api/api/get_script.js +56 -0
- package/api/api/get_script_context.js +50 -0
- package/api/api/get_script_languages.js +50 -0
- package/api/api/get_source.js +65 -0
- package/api/api/graph.js +72 -0
- package/api/api/ilm.js +317 -0
- package/api/api/index.js +71 -0
- package/api/api/indices.js +1753 -0
- package/api/api/info.js +50 -0
- package/api/api/ingest.js +200 -0
- package/api/api/license.js +188 -0
- package/api/api/logstash.js +125 -0
- package/api/api/mget.js +70 -0
- package/api/api/migration.js +60 -0
- package/api/api/ml.js +2010 -0
- package/api/api/monitoring.js +66 -0
- package/api/api/msearch.js +70 -0
- package/api/api/msearch_template.js +70 -0
- package/api/api/mtermvectors.js +64 -0
- package/api/api/nodes.js +268 -0
- package/api/api/open_point_in_time.js +56 -0
- package/api/api/ping.js +50 -0
- package/api/api/put_script.js +71 -0
- package/api/api/rank_eval.js +61 -0
- package/api/api/reindex.js +56 -0
- package/api/api/reindex_rethrottle.js +60 -0
- package/api/api/render_search_template.js +55 -0
- package/api/api/rollup.js +319 -0
- package/api/api/scripts_painless_execute.js +50 -0
- package/api/api/scroll.js +55 -0
- package/api/api/search.js +64 -0
- package/api/api/search_mvt.js +87 -0
- package/api/api/search_shards.js +55 -0
- package/api/api/search_template.js +70 -0
- package/api/api/searchable_snapshots.js +186 -0
- package/api/api/security.js +1261 -0
- package/api/api/shutdown.js +124 -0
- package/api/api/slm.js +256 -0
- package/api/api/snapshot.js +439 -0
- package/api/api/sql.js +203 -0
- package/api/api/ssl.js +55 -0
- package/api/api/tasks.js +108 -0
- package/api/api/terms_enum.js +56 -0
- package/api/api/termvectors.js +67 -0
- package/api/api/text_structure.js +65 -0
- package/api/api/transform.js +268 -0
- package/api/api/update.js +69 -0
- package/api/api/update_by_query.js +67 -0
- package/api/api/update_by_query_rethrottle.js +60 -0
- package/api/api/watcher.js +333 -0
- package/api/api/xpack.js +76 -0
- package/api/index.js +508 -0
- package/api/new.d.ts +1585 -0
- package/api/requestParams.d.ts +2920 -0
- package/api/types.d.ts +15420 -0
- package/api/utils.js +58 -0
- package/codecov.yml +14 -0
- package/index.d.ts +2991 -0
- package/index.js +349 -0
- package/index.mjs +29 -0
- package/lib/Connection.d.ts +99 -0
- package/lib/Connection.js +392 -0
- package/lib/Helpers.d.ts +124 -0
- package/lib/Helpers.js +770 -0
- package/lib/Serializer.d.ts +30 -0
- package/lib/Serializer.js +94 -0
- package/lib/Transport.d.ts +162 -0
- package/lib/Transport.js +689 -0
- package/lib/errors.d.ts +90 -0
- package/lib/errors.js +159 -0
- package/lib/pool/BaseConnectionPool.js +262 -0
- package/lib/pool/CloudConnectionPool.js +64 -0
- package/lib/pool/ConnectionPool.js +246 -0
- package/lib/pool/index.d.ts +220 -0
- package/lib/pool/index.js +30 -0
- package/package.json +106 -0
|
@@ -0,0 +1,1753 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to Elasticsearch B.V. under one or more contributor
|
|
3
|
+
* license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright
|
|
5
|
+
* ownership. Elasticsearch B.V. licenses this file to you under
|
|
6
|
+
* the Apache License, Version 2.0 (the "License"); you may
|
|
7
|
+
* not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
'use strict'
|
|
21
|
+
|
|
22
|
+
/* eslint camelcase: 0 */
|
|
23
|
+
/* eslint no-unused-vars: 0 */
|
|
24
|
+
|
|
25
|
+
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
|
26
|
+
const acceptedQuerystring = ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'index', 'fielddata', 'fields', 'query', 'request', 'wait_for_active_shards', 'include_type_name', 'run_expensive_tasks', 'flush', 'local', 'flat_settings', 'include_defaults', 'force', 'wait_if_ongoing', 'max_num_segments', 'only_expunge_deletes', 'create', 'cause', 'write_index_only', 'preserve_existing', 'order', 'detailed', 'active_only', 'dry_run', 'verbose', 'status', 'copy_settings', 'completion_fields', 'fielddata_fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments', 'forbid_closed_indices', 'wait_for_completion', 'only_ancient_segments', 'explain', 'q', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'lenient', 'rewrite', 'all_shards']
|
|
27
|
+
const snakeCase = { masterTimeout: 'master_timeout', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', waitForActiveShards: 'wait_for_active_shards', includeTypeName: 'include_type_name', runExpensiveTasks: 'run_expensive_tasks', flatSettings: 'flat_settings', includeDefaults: 'include_defaults', waitIfOngoing: 'wait_if_ongoing', maxNumSegments: 'max_num_segments', onlyExpungeDeletes: 'only_expunge_deletes', writeIndexOnly: 'write_index_only', preserveExisting: 'preserve_existing', activeOnly: 'active_only', dryRun: 'dry_run', copySettings: 'copy_settings', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments', forbidClosedIndices: 'forbid_closed_indices', waitForCompletion: 'wait_for_completion', onlyAncientSegments: 'only_ancient_segments', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', allShards: 'all_shards' }
|
|
28
|
+
|
|
29
|
+
function IndicesApi (transport, ConfigurationError) {
|
|
30
|
+
this.transport = transport
|
|
31
|
+
this[kConfigurationError] = ConfigurationError
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
IndicesApi.prototype.addBlock = function indicesAddBlockApi (params, options, callback) {
|
|
35
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
36
|
+
|
|
37
|
+
// check required parameters
|
|
38
|
+
if (params.index == null) {
|
|
39
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
40
|
+
return handleError(err, callback)
|
|
41
|
+
}
|
|
42
|
+
if (params.block == null) {
|
|
43
|
+
const err = new this[kConfigurationError]('Missing required parameter: block')
|
|
44
|
+
return handleError(err, callback)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// check required url components
|
|
48
|
+
if (params.block != null && (params.index == null)) {
|
|
49
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
|
|
50
|
+
return handleError(err, callback)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let { method, body, index, block, ...querystring } = params
|
|
54
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
55
|
+
|
|
56
|
+
let path = ''
|
|
57
|
+
if (method == null) method = 'PUT'
|
|
58
|
+
path = '/' + encodeURIComponent(index) + '/' + '_block' + '/' + encodeURIComponent(block)
|
|
59
|
+
|
|
60
|
+
// build request object
|
|
61
|
+
const request = {
|
|
62
|
+
method,
|
|
63
|
+
path,
|
|
64
|
+
body: body || '',
|
|
65
|
+
querystring
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return this.transport.request(request, options, callback)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
IndicesApi.prototype.analyze = function indicesAnalyzeApi (params, options, callback) {
|
|
72
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
73
|
+
|
|
74
|
+
let { method, body, index, ...querystring } = params
|
|
75
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
76
|
+
|
|
77
|
+
let path = ''
|
|
78
|
+
if ((index) != null) {
|
|
79
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
80
|
+
path = '/' + encodeURIComponent(index) + '/' + '_analyze'
|
|
81
|
+
} else {
|
|
82
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
83
|
+
path = '/' + '_analyze'
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// build request object
|
|
87
|
+
const request = {
|
|
88
|
+
method,
|
|
89
|
+
path,
|
|
90
|
+
body: body || '',
|
|
91
|
+
querystring
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return this.transport.request(request, options, callback)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
IndicesApi.prototype.clearCache = function indicesClearCacheApi (params, options, callback) {
|
|
98
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
99
|
+
|
|
100
|
+
let { method, body, index, ...querystring } = params
|
|
101
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
102
|
+
|
|
103
|
+
let path = ''
|
|
104
|
+
if ((index) != null) {
|
|
105
|
+
if (method == null) method = 'POST'
|
|
106
|
+
path = '/' + encodeURIComponent(index) + '/' + '_cache' + '/' + 'clear'
|
|
107
|
+
} else {
|
|
108
|
+
if (method == null) method = 'POST'
|
|
109
|
+
path = '/' + '_cache' + '/' + 'clear'
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// build request object
|
|
113
|
+
const request = {
|
|
114
|
+
method,
|
|
115
|
+
path,
|
|
116
|
+
body: body || '',
|
|
117
|
+
querystring
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return this.transport.request(request, options, callback)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
IndicesApi.prototype.clone = function indicesCloneApi (params, options, callback) {
|
|
124
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
125
|
+
|
|
126
|
+
// check required parameters
|
|
127
|
+
if (params.index == null) {
|
|
128
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
129
|
+
return handleError(err, callback)
|
|
130
|
+
}
|
|
131
|
+
if (params.target == null) {
|
|
132
|
+
const err = new this[kConfigurationError]('Missing required parameter: target')
|
|
133
|
+
return handleError(err, callback)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// check required url components
|
|
137
|
+
if (params.target != null && (params.index == null)) {
|
|
138
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
|
|
139
|
+
return handleError(err, callback)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
let { method, body, index, target, ...querystring } = params
|
|
143
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
144
|
+
|
|
145
|
+
let path = ''
|
|
146
|
+
if (method == null) method = 'PUT'
|
|
147
|
+
path = '/' + encodeURIComponent(index) + '/' + '_clone' + '/' + encodeURIComponent(target)
|
|
148
|
+
|
|
149
|
+
// build request object
|
|
150
|
+
const request = {
|
|
151
|
+
method,
|
|
152
|
+
path,
|
|
153
|
+
body: body || '',
|
|
154
|
+
querystring
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return this.transport.request(request, options, callback)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
IndicesApi.prototype.close = function indicesCloseApi (params, options, callback) {
|
|
161
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
162
|
+
|
|
163
|
+
// check required parameters
|
|
164
|
+
if (params.index == null) {
|
|
165
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
166
|
+
return handleError(err, callback)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
let { method, body, index, ...querystring } = params
|
|
170
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
171
|
+
|
|
172
|
+
let path = ''
|
|
173
|
+
if (method == null) method = 'POST'
|
|
174
|
+
path = '/' + encodeURIComponent(index) + '/' + '_close'
|
|
175
|
+
|
|
176
|
+
// build request object
|
|
177
|
+
const request = {
|
|
178
|
+
method,
|
|
179
|
+
path,
|
|
180
|
+
body: body || '',
|
|
181
|
+
querystring
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return this.transport.request(request, options, callback)
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
IndicesApi.prototype.create = function indicesCreateApi (params, options, callback) {
|
|
188
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
189
|
+
|
|
190
|
+
// check required parameters
|
|
191
|
+
if (params.index == null) {
|
|
192
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
193
|
+
return handleError(err, callback)
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
let { method, body, index, ...querystring } = params
|
|
197
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
198
|
+
|
|
199
|
+
let path = ''
|
|
200
|
+
if (method == null) method = 'PUT'
|
|
201
|
+
path = '/' + encodeURIComponent(index)
|
|
202
|
+
|
|
203
|
+
// build request object
|
|
204
|
+
const request = {
|
|
205
|
+
method,
|
|
206
|
+
path,
|
|
207
|
+
body: body || '',
|
|
208
|
+
querystring
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return this.transport.request(request, options, callback)
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
IndicesApi.prototype.createDataStream = function indicesCreateDataStreamApi (params, options, callback) {
|
|
215
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
216
|
+
|
|
217
|
+
// check required parameters
|
|
218
|
+
if (params.name == null) {
|
|
219
|
+
const err = new this[kConfigurationError]('Missing required parameter: name')
|
|
220
|
+
return handleError(err, callback)
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
let { method, body, name, ...querystring } = params
|
|
224
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
225
|
+
|
|
226
|
+
let path = ''
|
|
227
|
+
if (method == null) method = 'PUT'
|
|
228
|
+
path = '/' + '_data_stream' + '/' + encodeURIComponent(name)
|
|
229
|
+
|
|
230
|
+
// build request object
|
|
231
|
+
const request = {
|
|
232
|
+
method,
|
|
233
|
+
path,
|
|
234
|
+
body: body || '',
|
|
235
|
+
querystring
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return this.transport.request(request, options, callback)
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
IndicesApi.prototype.dataStreamsStats = function indicesDataStreamsStatsApi (params, options, callback) {
|
|
242
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
243
|
+
|
|
244
|
+
let { method, body, name, ...querystring } = params
|
|
245
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
246
|
+
|
|
247
|
+
let path = ''
|
|
248
|
+
if ((name) != null) {
|
|
249
|
+
if (method == null) method = 'GET'
|
|
250
|
+
path = '/' + '_data_stream' + '/' + encodeURIComponent(name) + '/' + '_stats'
|
|
251
|
+
} else {
|
|
252
|
+
if (method == null) method = 'GET'
|
|
253
|
+
path = '/' + '_data_stream' + '/' + '_stats'
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// build request object
|
|
257
|
+
const request = {
|
|
258
|
+
method,
|
|
259
|
+
path,
|
|
260
|
+
body: null,
|
|
261
|
+
querystring
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
return this.transport.request(request, options, callback)
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
IndicesApi.prototype.delete = function indicesDeleteApi (params, options, callback) {
|
|
268
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
269
|
+
|
|
270
|
+
// check required parameters
|
|
271
|
+
if (params.index == null) {
|
|
272
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
273
|
+
return handleError(err, callback)
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
let { method, body, index, ...querystring } = params
|
|
277
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
278
|
+
|
|
279
|
+
let path = ''
|
|
280
|
+
if (method == null) method = 'DELETE'
|
|
281
|
+
path = '/' + encodeURIComponent(index)
|
|
282
|
+
|
|
283
|
+
// build request object
|
|
284
|
+
const request = {
|
|
285
|
+
method,
|
|
286
|
+
path,
|
|
287
|
+
body: body || '',
|
|
288
|
+
querystring
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return this.transport.request(request, options, callback)
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
IndicesApi.prototype.deleteAlias = function indicesDeleteAliasApi (params, options, callback) {
|
|
295
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
296
|
+
|
|
297
|
+
// check required parameters
|
|
298
|
+
if (params.index == null) {
|
|
299
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
300
|
+
return handleError(err, callback)
|
|
301
|
+
}
|
|
302
|
+
if (params.name == null) {
|
|
303
|
+
const err = new this[kConfigurationError]('Missing required parameter: name')
|
|
304
|
+
return handleError(err, callback)
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// check required url components
|
|
308
|
+
if (params.name != null && (params.index == null)) {
|
|
309
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
|
|
310
|
+
return handleError(err, callback)
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
let { method, body, index, name, ...querystring } = params
|
|
314
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
315
|
+
|
|
316
|
+
let path = ''
|
|
317
|
+
if ((index) != null && (name) != null) {
|
|
318
|
+
if (method == null) method = 'DELETE'
|
|
319
|
+
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
|
|
320
|
+
} else {
|
|
321
|
+
if (method == null) method = 'DELETE'
|
|
322
|
+
path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name)
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// build request object
|
|
326
|
+
const request = {
|
|
327
|
+
method,
|
|
328
|
+
path,
|
|
329
|
+
body: body || '',
|
|
330
|
+
querystring
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
return this.transport.request(request, options, callback)
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
IndicesApi.prototype.deleteDataStream = function indicesDeleteDataStreamApi (params, options, callback) {
|
|
337
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
338
|
+
|
|
339
|
+
// check required parameters
|
|
340
|
+
if (params.name == null) {
|
|
341
|
+
const err = new this[kConfigurationError]('Missing required parameter: name')
|
|
342
|
+
return handleError(err, callback)
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
let { method, body, name, ...querystring } = params
|
|
346
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
347
|
+
|
|
348
|
+
let path = ''
|
|
349
|
+
if (method == null) method = 'DELETE'
|
|
350
|
+
path = '/' + '_data_stream' + '/' + encodeURIComponent(name)
|
|
351
|
+
|
|
352
|
+
// build request object
|
|
353
|
+
const request = {
|
|
354
|
+
method,
|
|
355
|
+
path,
|
|
356
|
+
body: body || '',
|
|
357
|
+
querystring
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
return this.transport.request(request, options, callback)
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
IndicesApi.prototype.deleteIndexTemplate = function indicesDeleteIndexTemplateApi (params, options, callback) {
|
|
364
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
365
|
+
|
|
366
|
+
// check required parameters
|
|
367
|
+
if (params.name == null) {
|
|
368
|
+
const err = new this[kConfigurationError]('Missing required parameter: name')
|
|
369
|
+
return handleError(err, callback)
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
let { method, body, name, ...querystring } = params
|
|
373
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
374
|
+
|
|
375
|
+
let path = ''
|
|
376
|
+
if (method == null) method = 'DELETE'
|
|
377
|
+
path = '/' + '_index_template' + '/' + encodeURIComponent(name)
|
|
378
|
+
|
|
379
|
+
// build request object
|
|
380
|
+
const request = {
|
|
381
|
+
method,
|
|
382
|
+
path,
|
|
383
|
+
body: body || '',
|
|
384
|
+
querystring
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
return this.transport.request(request, options, callback)
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
IndicesApi.prototype.deleteTemplate = function indicesDeleteTemplateApi (params, options, callback) {
|
|
391
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
392
|
+
|
|
393
|
+
// check required parameters
|
|
394
|
+
if (params.name == null) {
|
|
395
|
+
const err = new this[kConfigurationError]('Missing required parameter: name')
|
|
396
|
+
return handleError(err, callback)
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
let { method, body, name, ...querystring } = params
|
|
400
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
401
|
+
|
|
402
|
+
let path = ''
|
|
403
|
+
if (method == null) method = 'DELETE'
|
|
404
|
+
path = '/' + '_template' + '/' + encodeURIComponent(name)
|
|
405
|
+
|
|
406
|
+
// build request object
|
|
407
|
+
const request = {
|
|
408
|
+
method,
|
|
409
|
+
path,
|
|
410
|
+
body: body || '',
|
|
411
|
+
querystring
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
return this.transport.request(request, options, callback)
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
IndicesApi.prototype.diskUsage = function indicesDiskUsageApi (params, options, callback) {
|
|
418
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
419
|
+
|
|
420
|
+
// check required parameters
|
|
421
|
+
if (params.index == null) {
|
|
422
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
423
|
+
return handleError(err, callback)
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
let { method, body, index, ...querystring } = params
|
|
427
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
428
|
+
|
|
429
|
+
let path = ''
|
|
430
|
+
if (method == null) method = 'POST'
|
|
431
|
+
path = '/' + encodeURIComponent(index) + '/' + '_disk_usage'
|
|
432
|
+
|
|
433
|
+
// build request object
|
|
434
|
+
const request = {
|
|
435
|
+
method,
|
|
436
|
+
path,
|
|
437
|
+
body: body || '',
|
|
438
|
+
querystring
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
return this.transport.request(request, options, callback)
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
IndicesApi.prototype.exists = function indicesExistsApi (params, options, callback) {
|
|
445
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
446
|
+
|
|
447
|
+
// check required parameters
|
|
448
|
+
if (params.index == null) {
|
|
449
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
450
|
+
return handleError(err, callback)
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
let { method, body, index, ...querystring } = params
|
|
454
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
455
|
+
|
|
456
|
+
let path = ''
|
|
457
|
+
if (method == null) method = 'HEAD'
|
|
458
|
+
path = '/' + encodeURIComponent(index)
|
|
459
|
+
|
|
460
|
+
// build request object
|
|
461
|
+
const request = {
|
|
462
|
+
method,
|
|
463
|
+
path,
|
|
464
|
+
body: null,
|
|
465
|
+
querystring
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
return this.transport.request(request, options, callback)
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
IndicesApi.prototype.existsAlias = function indicesExistsAliasApi (params, options, callback) {
|
|
472
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
473
|
+
|
|
474
|
+
// check required parameters
|
|
475
|
+
if (params.name == null) {
|
|
476
|
+
const err = new this[kConfigurationError]('Missing required parameter: name')
|
|
477
|
+
return handleError(err, callback)
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
let { method, body, name, index, ...querystring } = params
|
|
481
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
482
|
+
|
|
483
|
+
let path = ''
|
|
484
|
+
if ((index) != null && (name) != null) {
|
|
485
|
+
if (method == null) method = 'HEAD'
|
|
486
|
+
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
|
|
487
|
+
} else {
|
|
488
|
+
if (method == null) method = 'HEAD'
|
|
489
|
+
path = '/' + '_alias' + '/' + encodeURIComponent(name)
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
// build request object
|
|
493
|
+
const request = {
|
|
494
|
+
method,
|
|
495
|
+
path,
|
|
496
|
+
body: null,
|
|
497
|
+
querystring
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
return this.transport.request(request, options, callback)
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
IndicesApi.prototype.existsIndexTemplate = function indicesExistsIndexTemplateApi (params, options, callback) {
|
|
504
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
505
|
+
|
|
506
|
+
// check required parameters
|
|
507
|
+
if (params.name == null) {
|
|
508
|
+
const err = new this[kConfigurationError]('Missing required parameter: name')
|
|
509
|
+
return handleError(err, callback)
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
let { method, body, name, ...querystring } = params
|
|
513
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
514
|
+
|
|
515
|
+
let path = ''
|
|
516
|
+
if (method == null) method = 'HEAD'
|
|
517
|
+
path = '/' + '_index_template' + '/' + encodeURIComponent(name)
|
|
518
|
+
|
|
519
|
+
// build request object
|
|
520
|
+
const request = {
|
|
521
|
+
method,
|
|
522
|
+
path,
|
|
523
|
+
body: null,
|
|
524
|
+
querystring
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
return this.transport.request(request, options, callback)
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
IndicesApi.prototype.existsTemplate = function indicesExistsTemplateApi (params, options, callback) {
|
|
531
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
532
|
+
|
|
533
|
+
// check required parameters
|
|
534
|
+
if (params.name == null) {
|
|
535
|
+
const err = new this[kConfigurationError]('Missing required parameter: name')
|
|
536
|
+
return handleError(err, callback)
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
let { method, body, name, ...querystring } = params
|
|
540
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
541
|
+
|
|
542
|
+
let path = ''
|
|
543
|
+
if (method == null) method = 'HEAD'
|
|
544
|
+
path = '/' + '_template' + '/' + encodeURIComponent(name)
|
|
545
|
+
|
|
546
|
+
// build request object
|
|
547
|
+
const request = {
|
|
548
|
+
method,
|
|
549
|
+
path,
|
|
550
|
+
body: null,
|
|
551
|
+
querystring
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
return this.transport.request(request, options, callback)
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
IndicesApi.prototype.existsType = function indicesExistsTypeApi (params, options, callback) {
|
|
558
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
559
|
+
|
|
560
|
+
// check required parameters
|
|
561
|
+
if (params.index == null) {
|
|
562
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
563
|
+
return handleError(err, callback)
|
|
564
|
+
}
|
|
565
|
+
if (params.type == null) {
|
|
566
|
+
const err = new this[kConfigurationError]('Missing required parameter: type')
|
|
567
|
+
return handleError(err, callback)
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
// check required url components
|
|
571
|
+
if (params.type != null && (params.index == null)) {
|
|
572
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
|
|
573
|
+
return handleError(err, callback)
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
let { method, body, index, type, ...querystring } = params
|
|
577
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
578
|
+
|
|
579
|
+
let path = ''
|
|
580
|
+
if (method == null) method = 'HEAD'
|
|
581
|
+
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type)
|
|
582
|
+
|
|
583
|
+
// build request object
|
|
584
|
+
const request = {
|
|
585
|
+
method,
|
|
586
|
+
path,
|
|
587
|
+
body: null,
|
|
588
|
+
querystring
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
return this.transport.request(request, options, callback)
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
IndicesApi.prototype.fieldUsageStats = function indicesFieldUsageStatsApi (params, options, callback) {
|
|
595
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
596
|
+
|
|
597
|
+
// check required parameters
|
|
598
|
+
if (params.index == null) {
|
|
599
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
600
|
+
return handleError(err, callback)
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
let { method, body, index, ...querystring } = params
|
|
604
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
605
|
+
|
|
606
|
+
let path = ''
|
|
607
|
+
if (method == null) method = 'GET'
|
|
608
|
+
path = '/' + encodeURIComponent(index) + '/' + '_field_usage_stats'
|
|
609
|
+
|
|
610
|
+
// build request object
|
|
611
|
+
const request = {
|
|
612
|
+
method,
|
|
613
|
+
path,
|
|
614
|
+
body: null,
|
|
615
|
+
querystring
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
return this.transport.request(request, options, callback)
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
IndicesApi.prototype.flush = function indicesFlushApi (params, options, callback) {
|
|
622
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
623
|
+
|
|
624
|
+
let { method, body, index, ...querystring } = params
|
|
625
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
626
|
+
|
|
627
|
+
let path = ''
|
|
628
|
+
if ((index) != null) {
|
|
629
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
630
|
+
path = '/' + encodeURIComponent(index) + '/' + '_flush'
|
|
631
|
+
} else {
|
|
632
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
633
|
+
path = '/' + '_flush'
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
// build request object
|
|
637
|
+
const request = {
|
|
638
|
+
method,
|
|
639
|
+
path,
|
|
640
|
+
body: body || '',
|
|
641
|
+
querystring
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
return this.transport.request(request, options, callback)
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
IndicesApi.prototype.flushSynced = function indicesFlushSyncedApi (params, options, callback) {
|
|
648
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
649
|
+
|
|
650
|
+
let { method, body, index, ...querystring } = params
|
|
651
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
652
|
+
|
|
653
|
+
let path = ''
|
|
654
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
655
|
+
path = '/' + encodeURIComponent(index) + '/' + '_flush' + '/' + 'synced'
|
|
656
|
+
|
|
657
|
+
// build request object
|
|
658
|
+
const request = {
|
|
659
|
+
method,
|
|
660
|
+
path,
|
|
661
|
+
body: body || '',
|
|
662
|
+
querystring
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
return this.transport.request(request, options, callback)
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
IndicesApi.prototype.forcemerge = function indicesForcemergeApi (params, options, callback) {
|
|
669
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
670
|
+
|
|
671
|
+
let { method, body, index, ...querystring } = params
|
|
672
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
673
|
+
|
|
674
|
+
let path = ''
|
|
675
|
+
if ((index) != null) {
|
|
676
|
+
if (method == null) method = 'POST'
|
|
677
|
+
path = '/' + encodeURIComponent(index) + '/' + '_forcemerge'
|
|
678
|
+
} else {
|
|
679
|
+
if (method == null) method = 'POST'
|
|
680
|
+
path = '/' + '_forcemerge'
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
// build request object
|
|
684
|
+
const request = {
|
|
685
|
+
method,
|
|
686
|
+
path,
|
|
687
|
+
body: body || '',
|
|
688
|
+
querystring
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
return this.transport.request(request, options, callback)
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
IndicesApi.prototype.freeze = function indicesFreezeApi (params, options, callback) {
|
|
695
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
696
|
+
|
|
697
|
+
// check required parameters
|
|
698
|
+
if (params.index == null) {
|
|
699
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
700
|
+
return handleError(err, callback)
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
let { method, body, index, ...querystring } = params
|
|
704
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
705
|
+
|
|
706
|
+
let path = ''
|
|
707
|
+
if (method == null) method = 'POST'
|
|
708
|
+
path = '/' + encodeURIComponent(index) + '/' + '_freeze'
|
|
709
|
+
|
|
710
|
+
// build request object
|
|
711
|
+
const request = {
|
|
712
|
+
method,
|
|
713
|
+
path,
|
|
714
|
+
body: body || '',
|
|
715
|
+
querystring
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
return this.transport.request(request, options, callback)
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
IndicesApi.prototype.get = function indicesGetApi (params, options, callback) {
|
|
722
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
723
|
+
|
|
724
|
+
// check required parameters
|
|
725
|
+
if (params.index == null) {
|
|
726
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
727
|
+
return handleError(err, callback)
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
let { method, body, index, ...querystring } = params
|
|
731
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
732
|
+
|
|
733
|
+
let path = ''
|
|
734
|
+
if (method == null) method = 'GET'
|
|
735
|
+
path = '/' + encodeURIComponent(index)
|
|
736
|
+
|
|
737
|
+
// build request object
|
|
738
|
+
const request = {
|
|
739
|
+
method,
|
|
740
|
+
path,
|
|
741
|
+
body: null,
|
|
742
|
+
querystring
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
return this.transport.request(request, options, callback)
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
IndicesApi.prototype.getAlias = function indicesGetAliasApi (params, options, callback) {
|
|
749
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
750
|
+
|
|
751
|
+
let { method, body, name, index, ...querystring } = params
|
|
752
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
753
|
+
|
|
754
|
+
let path = ''
|
|
755
|
+
if ((index) != null && (name) != null) {
|
|
756
|
+
if (method == null) method = 'GET'
|
|
757
|
+
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
|
|
758
|
+
} else if ((name) != null) {
|
|
759
|
+
if (method == null) method = 'GET'
|
|
760
|
+
path = '/' + '_alias' + '/' + encodeURIComponent(name)
|
|
761
|
+
} else if ((index) != null) {
|
|
762
|
+
if (method == null) method = 'GET'
|
|
763
|
+
path = '/' + encodeURIComponent(index) + '/' + '_alias'
|
|
764
|
+
} else {
|
|
765
|
+
if (method == null) method = 'GET'
|
|
766
|
+
path = '/' + '_alias'
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
// build request object
|
|
770
|
+
const request = {
|
|
771
|
+
method,
|
|
772
|
+
path,
|
|
773
|
+
body: null,
|
|
774
|
+
querystring
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
return this.transport.request(request, options, callback)
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
IndicesApi.prototype.getDataStream = function indicesGetDataStreamApi (params, options, callback) {
|
|
781
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
782
|
+
|
|
783
|
+
let { method, body, name, ...querystring } = params
|
|
784
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
785
|
+
|
|
786
|
+
let path = ''
|
|
787
|
+
if ((name) != null) {
|
|
788
|
+
if (method == null) method = 'GET'
|
|
789
|
+
path = '/' + '_data_stream' + '/' + encodeURIComponent(name)
|
|
790
|
+
} else {
|
|
791
|
+
if (method == null) method = 'GET'
|
|
792
|
+
path = '/' + '_data_stream'
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
// build request object
|
|
796
|
+
const request = {
|
|
797
|
+
method,
|
|
798
|
+
path,
|
|
799
|
+
body: null,
|
|
800
|
+
querystring
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
return this.transport.request(request, options, callback)
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
IndicesApi.prototype.getFieldMapping = function indicesGetFieldMappingApi (params, options, callback) {
|
|
807
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
808
|
+
|
|
809
|
+
// check required parameters
|
|
810
|
+
if (params.fields == null) {
|
|
811
|
+
const err = new this[kConfigurationError]('Missing required parameter: fields')
|
|
812
|
+
return handleError(err, callback)
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
let { method, body, fields, index, type, ...querystring } = params
|
|
816
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
817
|
+
|
|
818
|
+
let path = ''
|
|
819
|
+
if ((index) != null && (type) != null && (fields) != null) {
|
|
820
|
+
if (method == null) method = 'GET'
|
|
821
|
+
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields)
|
|
822
|
+
} else if ((index) != null && (fields) != null) {
|
|
823
|
+
if (method == null) method = 'GET'
|
|
824
|
+
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields)
|
|
825
|
+
} else if ((type) != null && (fields) != null) {
|
|
826
|
+
if (method == null) method = 'GET'
|
|
827
|
+
path = '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields)
|
|
828
|
+
} else {
|
|
829
|
+
if (method == null) method = 'GET'
|
|
830
|
+
path = '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields)
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
// build request object
|
|
834
|
+
const request = {
|
|
835
|
+
method,
|
|
836
|
+
path,
|
|
837
|
+
body: null,
|
|
838
|
+
querystring
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
return this.transport.request(request, options, callback)
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
IndicesApi.prototype.getIndexTemplate = function indicesGetIndexTemplateApi (params, options, callback) {
|
|
845
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
846
|
+
|
|
847
|
+
let { method, body, name, ...querystring } = params
|
|
848
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
849
|
+
|
|
850
|
+
let path = ''
|
|
851
|
+
if ((name) != null) {
|
|
852
|
+
if (method == null) method = 'GET'
|
|
853
|
+
path = '/' + '_index_template' + '/' + encodeURIComponent(name)
|
|
854
|
+
} else {
|
|
855
|
+
if (method == null) method = 'GET'
|
|
856
|
+
path = '/' + '_index_template'
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
// build request object
|
|
860
|
+
const request = {
|
|
861
|
+
method,
|
|
862
|
+
path,
|
|
863
|
+
body: null,
|
|
864
|
+
querystring
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
return this.transport.request(request, options, callback)
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
IndicesApi.prototype.getMapping = function indicesGetMappingApi (params, options, callback) {
|
|
871
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
872
|
+
|
|
873
|
+
let { method, body, index, type, ...querystring } = params
|
|
874
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
875
|
+
|
|
876
|
+
let path = ''
|
|
877
|
+
if ((index) != null && (type) != null) {
|
|
878
|
+
if (method == null) method = 'GET'
|
|
879
|
+
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type)
|
|
880
|
+
} else if ((index) != null) {
|
|
881
|
+
if (method == null) method = 'GET'
|
|
882
|
+
path = '/' + encodeURIComponent(index) + '/' + '_mapping'
|
|
883
|
+
} else if ((type) != null) {
|
|
884
|
+
if (method == null) method = 'GET'
|
|
885
|
+
path = '/' + '_mapping' + '/' + encodeURIComponent(type)
|
|
886
|
+
} else {
|
|
887
|
+
if (method == null) method = 'GET'
|
|
888
|
+
path = '/' + '_mapping'
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
// build request object
|
|
892
|
+
const request = {
|
|
893
|
+
method,
|
|
894
|
+
path,
|
|
895
|
+
body: null,
|
|
896
|
+
querystring
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
return this.transport.request(request, options, callback)
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
IndicesApi.prototype.getSettings = function indicesGetSettingsApi (params, options, callback) {
|
|
903
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
904
|
+
|
|
905
|
+
let { method, body, index, name, ...querystring } = params
|
|
906
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
907
|
+
|
|
908
|
+
let path = ''
|
|
909
|
+
if ((index) != null && (name) != null) {
|
|
910
|
+
if (method == null) method = 'GET'
|
|
911
|
+
path = '/' + encodeURIComponent(index) + '/' + '_settings' + '/' + encodeURIComponent(name)
|
|
912
|
+
} else if ((index) != null) {
|
|
913
|
+
if (method == null) method = 'GET'
|
|
914
|
+
path = '/' + encodeURIComponent(index) + '/' + '_settings'
|
|
915
|
+
} else if ((name) != null) {
|
|
916
|
+
if (method == null) method = 'GET'
|
|
917
|
+
path = '/' + '_settings' + '/' + encodeURIComponent(name)
|
|
918
|
+
} else {
|
|
919
|
+
if (method == null) method = 'GET'
|
|
920
|
+
path = '/' + '_settings'
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
// build request object
|
|
924
|
+
const request = {
|
|
925
|
+
method,
|
|
926
|
+
path,
|
|
927
|
+
body: null,
|
|
928
|
+
querystring
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
return this.transport.request(request, options, callback)
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
IndicesApi.prototype.getTemplate = function indicesGetTemplateApi (params, options, callback) {
|
|
935
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
936
|
+
|
|
937
|
+
let { method, body, name, ...querystring } = params
|
|
938
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
939
|
+
|
|
940
|
+
let path = ''
|
|
941
|
+
if ((name) != null) {
|
|
942
|
+
if (method == null) method = 'GET'
|
|
943
|
+
path = '/' + '_template' + '/' + encodeURIComponent(name)
|
|
944
|
+
} else {
|
|
945
|
+
if (method == null) method = 'GET'
|
|
946
|
+
path = '/' + '_template'
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
// build request object
|
|
950
|
+
const request = {
|
|
951
|
+
method,
|
|
952
|
+
path,
|
|
953
|
+
body: null,
|
|
954
|
+
querystring
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
return this.transport.request(request, options, callback)
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
IndicesApi.prototype.getUpgrade = function indicesGetUpgradeApi (params, options, callback) {
|
|
961
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
962
|
+
|
|
963
|
+
let { method, body, index, ...querystring } = params
|
|
964
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
965
|
+
|
|
966
|
+
let path = ''
|
|
967
|
+
if (method == null) method = 'GET'
|
|
968
|
+
path = '/' + encodeURIComponent(index) + '/' + '_upgrade'
|
|
969
|
+
|
|
970
|
+
// build request object
|
|
971
|
+
const request = {
|
|
972
|
+
method,
|
|
973
|
+
path,
|
|
974
|
+
body: null,
|
|
975
|
+
querystring
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
return this.transport.request(request, options, callback)
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
IndicesApi.prototype.migrateToDataStream = function indicesMigrateToDataStreamApi (params, options, callback) {
|
|
982
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
983
|
+
|
|
984
|
+
// check required parameters
|
|
985
|
+
if (params.name == null) {
|
|
986
|
+
const err = new this[kConfigurationError]('Missing required parameter: name')
|
|
987
|
+
return handleError(err, callback)
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
let { method, body, name, ...querystring } = params
|
|
991
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
992
|
+
|
|
993
|
+
let path = ''
|
|
994
|
+
if (method == null) method = 'POST'
|
|
995
|
+
path = '/' + '_data_stream' + '/' + '_migrate' + '/' + encodeURIComponent(name)
|
|
996
|
+
|
|
997
|
+
// build request object
|
|
998
|
+
const request = {
|
|
999
|
+
method,
|
|
1000
|
+
path,
|
|
1001
|
+
body: body || '',
|
|
1002
|
+
querystring
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
return this.transport.request(request, options, callback)
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
IndicesApi.prototype.open = function indicesOpenApi (params, options, callback) {
|
|
1009
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1010
|
+
|
|
1011
|
+
// check required parameters
|
|
1012
|
+
if (params.index == null) {
|
|
1013
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
1014
|
+
return handleError(err, callback)
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
let { method, body, index, ...querystring } = params
|
|
1018
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1019
|
+
|
|
1020
|
+
let path = ''
|
|
1021
|
+
if (method == null) method = 'POST'
|
|
1022
|
+
path = '/' + encodeURIComponent(index) + '/' + '_open'
|
|
1023
|
+
|
|
1024
|
+
// build request object
|
|
1025
|
+
const request = {
|
|
1026
|
+
method,
|
|
1027
|
+
path,
|
|
1028
|
+
body: body || '',
|
|
1029
|
+
querystring
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
return this.transport.request(request, options, callback)
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
IndicesApi.prototype.promoteDataStream = function indicesPromoteDataStreamApi (params, options, callback) {
|
|
1036
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1037
|
+
|
|
1038
|
+
// check required parameters
|
|
1039
|
+
if (params.name == null) {
|
|
1040
|
+
const err = new this[kConfigurationError]('Missing required parameter: name')
|
|
1041
|
+
return handleError(err, callback)
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
let { method, body, name, ...querystring } = params
|
|
1045
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1046
|
+
|
|
1047
|
+
let path = ''
|
|
1048
|
+
if (method == null) method = 'POST'
|
|
1049
|
+
path = '/' + '_data_stream' + '/' + '_promote' + '/' + encodeURIComponent(name)
|
|
1050
|
+
|
|
1051
|
+
// build request object
|
|
1052
|
+
const request = {
|
|
1053
|
+
method,
|
|
1054
|
+
path,
|
|
1055
|
+
body: body || '',
|
|
1056
|
+
querystring
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
return this.transport.request(request, options, callback)
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
IndicesApi.prototype.putAlias = function indicesPutAliasApi (params, options, callback) {
|
|
1063
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1064
|
+
|
|
1065
|
+
// check required parameters
|
|
1066
|
+
if (params.index == null) {
|
|
1067
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
1068
|
+
return handleError(err, callback)
|
|
1069
|
+
}
|
|
1070
|
+
if (params.name == null) {
|
|
1071
|
+
const err = new this[kConfigurationError]('Missing required parameter: name')
|
|
1072
|
+
return handleError(err, callback)
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
// check required url components
|
|
1076
|
+
if (params.name != null && (params.index == null)) {
|
|
1077
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
|
|
1078
|
+
return handleError(err, callback)
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
let { method, body, index, name, ...querystring } = params
|
|
1082
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1083
|
+
|
|
1084
|
+
let path = ''
|
|
1085
|
+
if ((index) != null && (name) != null) {
|
|
1086
|
+
if (method == null) method = 'PUT'
|
|
1087
|
+
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
|
|
1088
|
+
} else {
|
|
1089
|
+
if (method == null) method = 'PUT'
|
|
1090
|
+
path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name)
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
// build request object
|
|
1094
|
+
const request = {
|
|
1095
|
+
method,
|
|
1096
|
+
path,
|
|
1097
|
+
body: body || '',
|
|
1098
|
+
querystring
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
return this.transport.request(request, options, callback)
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
IndicesApi.prototype.putIndexTemplate = function indicesPutIndexTemplateApi (params, options, callback) {
|
|
1105
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1106
|
+
|
|
1107
|
+
// check required parameters
|
|
1108
|
+
if (params.name == null) {
|
|
1109
|
+
const err = new this[kConfigurationError]('Missing required parameter: name')
|
|
1110
|
+
return handleError(err, callback)
|
|
1111
|
+
}
|
|
1112
|
+
if (params.body == null) {
|
|
1113
|
+
const err = new this[kConfigurationError]('Missing required parameter: body')
|
|
1114
|
+
return handleError(err, callback)
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
let { method, body, name, ...querystring } = params
|
|
1118
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1119
|
+
|
|
1120
|
+
let path = ''
|
|
1121
|
+
if (method == null) method = 'PUT'
|
|
1122
|
+
path = '/' + '_index_template' + '/' + encodeURIComponent(name)
|
|
1123
|
+
|
|
1124
|
+
// build request object
|
|
1125
|
+
const request = {
|
|
1126
|
+
method,
|
|
1127
|
+
path,
|
|
1128
|
+
body: body || '',
|
|
1129
|
+
querystring
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
return this.transport.request(request, options, callback)
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
IndicesApi.prototype.putMapping = function indicesPutMappingApi (params, options, callback) {
|
|
1136
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1137
|
+
|
|
1138
|
+
// check required parameters
|
|
1139
|
+
if (params.body == null) {
|
|
1140
|
+
const err = new this[kConfigurationError]('Missing required parameter: body')
|
|
1141
|
+
return handleError(err, callback)
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
let { method, body, index, type, ...querystring } = params
|
|
1145
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1146
|
+
|
|
1147
|
+
let path = ''
|
|
1148
|
+
if ((index) != null && (type) != null) {
|
|
1149
|
+
if (method == null) method = 'PUT'
|
|
1150
|
+
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mapping'
|
|
1151
|
+
} else if ((index) != null && (type) != null) {
|
|
1152
|
+
if (method == null) method = 'PUT'
|
|
1153
|
+
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type)
|
|
1154
|
+
} else if ((index) != null && (type) != null) {
|
|
1155
|
+
if (method == null) method = 'PUT'
|
|
1156
|
+
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mappings'
|
|
1157
|
+
} else if ((index) != null && (type) != null) {
|
|
1158
|
+
if (method == null) method = 'PUT'
|
|
1159
|
+
path = '/' + encodeURIComponent(index) + '/' + '_mappings' + '/' + encodeURIComponent(type)
|
|
1160
|
+
} else if ((index) != null) {
|
|
1161
|
+
if (method == null) method = 'PUT'
|
|
1162
|
+
path = '/' + encodeURIComponent(index) + '/' + '_mapping'
|
|
1163
|
+
} else if ((type) != null) {
|
|
1164
|
+
if (method == null) method = 'PUT'
|
|
1165
|
+
path = '/' + '_mappings' + '/' + encodeURIComponent(type)
|
|
1166
|
+
} else if ((index) != null) {
|
|
1167
|
+
if (method == null) method = 'PUT'
|
|
1168
|
+
path = '/' + encodeURIComponent(index) + '/' + '_mappings'
|
|
1169
|
+
} else {
|
|
1170
|
+
if (method == null) method = 'PUT'
|
|
1171
|
+
path = '/' + '_mapping' + '/' + encodeURIComponent(type)
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
// build request object
|
|
1175
|
+
const request = {
|
|
1176
|
+
method,
|
|
1177
|
+
path,
|
|
1178
|
+
body: body || '',
|
|
1179
|
+
querystring
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
return this.transport.request(request, options, callback)
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
IndicesApi.prototype.putSettings = function indicesPutSettingsApi (params, options, callback) {
|
|
1186
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1187
|
+
|
|
1188
|
+
// check required parameters
|
|
1189
|
+
if (params.body == null) {
|
|
1190
|
+
const err = new this[kConfigurationError]('Missing required parameter: body')
|
|
1191
|
+
return handleError(err, callback)
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
let { method, body, index, ...querystring } = params
|
|
1195
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1196
|
+
|
|
1197
|
+
let path = ''
|
|
1198
|
+
if ((index) != null) {
|
|
1199
|
+
if (method == null) method = 'PUT'
|
|
1200
|
+
path = '/' + encodeURIComponent(index) + '/' + '_settings'
|
|
1201
|
+
} else {
|
|
1202
|
+
if (method == null) method = 'PUT'
|
|
1203
|
+
path = '/' + '_settings'
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
// build request object
|
|
1207
|
+
const request = {
|
|
1208
|
+
method,
|
|
1209
|
+
path,
|
|
1210
|
+
body: body || '',
|
|
1211
|
+
querystring
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
return this.transport.request(request, options, callback)
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
IndicesApi.prototype.putTemplate = function indicesPutTemplateApi (params, options, callback) {
|
|
1218
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1219
|
+
|
|
1220
|
+
// check required parameters
|
|
1221
|
+
if (params.name == null) {
|
|
1222
|
+
const err = new this[kConfigurationError]('Missing required parameter: name')
|
|
1223
|
+
return handleError(err, callback)
|
|
1224
|
+
}
|
|
1225
|
+
if (params.body == null) {
|
|
1226
|
+
const err = new this[kConfigurationError]('Missing required parameter: body')
|
|
1227
|
+
return handleError(err, callback)
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
let { method, body, name, ...querystring } = params
|
|
1231
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1232
|
+
|
|
1233
|
+
let path = ''
|
|
1234
|
+
if (method == null) method = 'PUT'
|
|
1235
|
+
path = '/' + '_template' + '/' + encodeURIComponent(name)
|
|
1236
|
+
|
|
1237
|
+
// build request object
|
|
1238
|
+
const request = {
|
|
1239
|
+
method,
|
|
1240
|
+
path,
|
|
1241
|
+
body: body || '',
|
|
1242
|
+
querystring
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
return this.transport.request(request, options, callback)
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
IndicesApi.prototype.recovery = function indicesRecoveryApi (params, options, callback) {
|
|
1249
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1250
|
+
|
|
1251
|
+
let { method, body, index, ...querystring } = params
|
|
1252
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1253
|
+
|
|
1254
|
+
let path = ''
|
|
1255
|
+
if ((index) != null) {
|
|
1256
|
+
if (method == null) method = 'GET'
|
|
1257
|
+
path = '/' + encodeURIComponent(index) + '/' + '_recovery'
|
|
1258
|
+
} else {
|
|
1259
|
+
if (method == null) method = 'GET'
|
|
1260
|
+
path = '/' + '_recovery'
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
// build request object
|
|
1264
|
+
const request = {
|
|
1265
|
+
method,
|
|
1266
|
+
path,
|
|
1267
|
+
body: null,
|
|
1268
|
+
querystring
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
return this.transport.request(request, options, callback)
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
IndicesApi.prototype.refresh = function indicesRefreshApi (params, options, callback) {
|
|
1275
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1276
|
+
|
|
1277
|
+
let { method, body, index, ...querystring } = params
|
|
1278
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1279
|
+
|
|
1280
|
+
let path = ''
|
|
1281
|
+
if ((index) != null) {
|
|
1282
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
1283
|
+
path = '/' + encodeURIComponent(index) + '/' + '_refresh'
|
|
1284
|
+
} else {
|
|
1285
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
1286
|
+
path = '/' + '_refresh'
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
// build request object
|
|
1290
|
+
const request = {
|
|
1291
|
+
method,
|
|
1292
|
+
path,
|
|
1293
|
+
body: body || '',
|
|
1294
|
+
querystring
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
return this.transport.request(request, options, callback)
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
IndicesApi.prototype.reloadSearchAnalyzers = function indicesReloadSearchAnalyzersApi (params, options, callback) {
|
|
1301
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1302
|
+
|
|
1303
|
+
// check required parameters
|
|
1304
|
+
if (params.index == null) {
|
|
1305
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
1306
|
+
return handleError(err, callback)
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
let { method, body, index, ...querystring } = params
|
|
1310
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1311
|
+
|
|
1312
|
+
let path = ''
|
|
1313
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
1314
|
+
path = '/' + encodeURIComponent(index) + '/' + '_reload_search_analyzers'
|
|
1315
|
+
|
|
1316
|
+
// build request object
|
|
1317
|
+
const request = {
|
|
1318
|
+
method,
|
|
1319
|
+
path,
|
|
1320
|
+
body: body || '',
|
|
1321
|
+
querystring
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
return this.transport.request(request, options, callback)
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
IndicesApi.prototype.resolveIndex = function indicesResolveIndexApi (params, options, callback) {
|
|
1328
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1329
|
+
|
|
1330
|
+
// check required parameters
|
|
1331
|
+
if (params.name == null) {
|
|
1332
|
+
const err = new this[kConfigurationError]('Missing required parameter: name')
|
|
1333
|
+
return handleError(err, callback)
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
let { method, body, name, ...querystring } = params
|
|
1337
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1338
|
+
|
|
1339
|
+
let path = ''
|
|
1340
|
+
if (method == null) method = 'GET'
|
|
1341
|
+
path = '/' + '_resolve' + '/' + 'index' + '/' + encodeURIComponent(name)
|
|
1342
|
+
|
|
1343
|
+
// build request object
|
|
1344
|
+
const request = {
|
|
1345
|
+
method,
|
|
1346
|
+
path,
|
|
1347
|
+
body: null,
|
|
1348
|
+
querystring
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
return this.transport.request(request, options, callback)
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
IndicesApi.prototype.rollover = function indicesRolloverApi (params, options, callback) {
|
|
1355
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1356
|
+
|
|
1357
|
+
// check required parameters
|
|
1358
|
+
if (params.alias == null) {
|
|
1359
|
+
const err = new this[kConfigurationError]('Missing required parameter: alias')
|
|
1360
|
+
return handleError(err, callback)
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
// check required url components
|
|
1364
|
+
if ((params.new_index != null || params.newIndex != null) && (params.alias == null)) {
|
|
1365
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: alias')
|
|
1366
|
+
return handleError(err, callback)
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
let { method, body, alias, newIndex, new_index, ...querystring } = params
|
|
1370
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1371
|
+
|
|
1372
|
+
let path = ''
|
|
1373
|
+
if ((alias) != null && (new_index || newIndex) != null) {
|
|
1374
|
+
if (method == null) method = 'POST'
|
|
1375
|
+
path = '/' + encodeURIComponent(alias) + '/' + '_rollover' + '/' + encodeURIComponent(new_index || newIndex)
|
|
1376
|
+
} else {
|
|
1377
|
+
if (method == null) method = 'POST'
|
|
1378
|
+
path = '/' + encodeURIComponent(alias) + '/' + '_rollover'
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
// build request object
|
|
1382
|
+
const request = {
|
|
1383
|
+
method,
|
|
1384
|
+
path,
|
|
1385
|
+
body: body || '',
|
|
1386
|
+
querystring
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
return this.transport.request(request, options, callback)
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
IndicesApi.prototype.segments = function indicesSegmentsApi (params, options, callback) {
|
|
1393
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1394
|
+
|
|
1395
|
+
let { method, body, index, ...querystring } = params
|
|
1396
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1397
|
+
|
|
1398
|
+
let path = ''
|
|
1399
|
+
if ((index) != null) {
|
|
1400
|
+
if (method == null) method = 'GET'
|
|
1401
|
+
path = '/' + encodeURIComponent(index) + '/' + '_segments'
|
|
1402
|
+
} else {
|
|
1403
|
+
if (method == null) method = 'GET'
|
|
1404
|
+
path = '/' + '_segments'
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
// build request object
|
|
1408
|
+
const request = {
|
|
1409
|
+
method,
|
|
1410
|
+
path,
|
|
1411
|
+
body: null,
|
|
1412
|
+
querystring
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
return this.transport.request(request, options, callback)
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
IndicesApi.prototype.shardStores = function indicesShardStoresApi (params, options, callback) {
|
|
1419
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1420
|
+
|
|
1421
|
+
let { method, body, index, ...querystring } = params
|
|
1422
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1423
|
+
|
|
1424
|
+
let path = ''
|
|
1425
|
+
if ((index) != null) {
|
|
1426
|
+
if (method == null) method = 'GET'
|
|
1427
|
+
path = '/' + encodeURIComponent(index) + '/' + '_shard_stores'
|
|
1428
|
+
} else {
|
|
1429
|
+
if (method == null) method = 'GET'
|
|
1430
|
+
path = '/' + '_shard_stores'
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
// build request object
|
|
1434
|
+
const request = {
|
|
1435
|
+
method,
|
|
1436
|
+
path,
|
|
1437
|
+
body: null,
|
|
1438
|
+
querystring
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
return this.transport.request(request, options, callback)
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
IndicesApi.prototype.shrink = function indicesShrinkApi (params, options, callback) {
|
|
1445
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1446
|
+
|
|
1447
|
+
// check required parameters
|
|
1448
|
+
if (params.index == null) {
|
|
1449
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
1450
|
+
return handleError(err, callback)
|
|
1451
|
+
}
|
|
1452
|
+
if (params.target == null) {
|
|
1453
|
+
const err = new this[kConfigurationError]('Missing required parameter: target')
|
|
1454
|
+
return handleError(err, callback)
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
// check required url components
|
|
1458
|
+
if (params.target != null && (params.index == null)) {
|
|
1459
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
|
|
1460
|
+
return handleError(err, callback)
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
let { method, body, index, target, ...querystring } = params
|
|
1464
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1465
|
+
|
|
1466
|
+
let path = ''
|
|
1467
|
+
if (method == null) method = 'PUT'
|
|
1468
|
+
path = '/' + encodeURIComponent(index) + '/' + '_shrink' + '/' + encodeURIComponent(target)
|
|
1469
|
+
|
|
1470
|
+
// build request object
|
|
1471
|
+
const request = {
|
|
1472
|
+
method,
|
|
1473
|
+
path,
|
|
1474
|
+
body: body || '',
|
|
1475
|
+
querystring
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
return this.transport.request(request, options, callback)
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
IndicesApi.prototype.simulateIndexTemplate = function indicesSimulateIndexTemplateApi (params, options, callback) {
|
|
1482
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1483
|
+
|
|
1484
|
+
// check required parameters
|
|
1485
|
+
if (params.name == null) {
|
|
1486
|
+
const err = new this[kConfigurationError]('Missing required parameter: name')
|
|
1487
|
+
return handleError(err, callback)
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
let { method, body, name, ...querystring } = params
|
|
1491
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1492
|
+
|
|
1493
|
+
let path = ''
|
|
1494
|
+
if (method == null) method = 'POST'
|
|
1495
|
+
path = '/' + '_index_template' + '/' + '_simulate_index' + '/' + encodeURIComponent(name)
|
|
1496
|
+
|
|
1497
|
+
// build request object
|
|
1498
|
+
const request = {
|
|
1499
|
+
method,
|
|
1500
|
+
path,
|
|
1501
|
+
body: body || '',
|
|
1502
|
+
querystring
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
return this.transport.request(request, options, callback)
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
IndicesApi.prototype.simulateTemplate = function indicesSimulateTemplateApi (params, options, callback) {
|
|
1509
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1510
|
+
|
|
1511
|
+
let { method, body, name, ...querystring } = params
|
|
1512
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1513
|
+
|
|
1514
|
+
let path = ''
|
|
1515
|
+
if ((name) != null) {
|
|
1516
|
+
if (method == null) method = 'POST'
|
|
1517
|
+
path = '/' + '_index_template' + '/' + '_simulate' + '/' + encodeURIComponent(name)
|
|
1518
|
+
} else {
|
|
1519
|
+
if (method == null) method = 'POST'
|
|
1520
|
+
path = '/' + '_index_template' + '/' + '_simulate'
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
// build request object
|
|
1524
|
+
const request = {
|
|
1525
|
+
method,
|
|
1526
|
+
path,
|
|
1527
|
+
body: body || '',
|
|
1528
|
+
querystring
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
return this.transport.request(request, options, callback)
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
IndicesApi.prototype.split = function indicesSplitApi (params, options, callback) {
|
|
1535
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1536
|
+
|
|
1537
|
+
// check required parameters
|
|
1538
|
+
if (params.index == null) {
|
|
1539
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
1540
|
+
return handleError(err, callback)
|
|
1541
|
+
}
|
|
1542
|
+
if (params.target == null) {
|
|
1543
|
+
const err = new this[kConfigurationError]('Missing required parameter: target')
|
|
1544
|
+
return handleError(err, callback)
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
// check required url components
|
|
1548
|
+
if (params.target != null && (params.index == null)) {
|
|
1549
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
|
|
1550
|
+
return handleError(err, callback)
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
let { method, body, index, target, ...querystring } = params
|
|
1554
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1555
|
+
|
|
1556
|
+
let path = ''
|
|
1557
|
+
if (method == null) method = 'PUT'
|
|
1558
|
+
path = '/' + encodeURIComponent(index) + '/' + '_split' + '/' + encodeURIComponent(target)
|
|
1559
|
+
|
|
1560
|
+
// build request object
|
|
1561
|
+
const request = {
|
|
1562
|
+
method,
|
|
1563
|
+
path,
|
|
1564
|
+
body: body || '',
|
|
1565
|
+
querystring
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
return this.transport.request(request, options, callback)
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
IndicesApi.prototype.stats = function indicesStatsApi (params, options, callback) {
|
|
1572
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1573
|
+
|
|
1574
|
+
let { method, body, metric, index, ...querystring } = params
|
|
1575
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1576
|
+
|
|
1577
|
+
let path = ''
|
|
1578
|
+
if ((index) != null && (metric) != null) {
|
|
1579
|
+
if (method == null) method = 'GET'
|
|
1580
|
+
path = '/' + encodeURIComponent(index) + '/' + '_stats' + '/' + encodeURIComponent(metric)
|
|
1581
|
+
} else if ((metric) != null) {
|
|
1582
|
+
if (method == null) method = 'GET'
|
|
1583
|
+
path = '/' + '_stats' + '/' + encodeURIComponent(metric)
|
|
1584
|
+
} else if ((index) != null) {
|
|
1585
|
+
if (method == null) method = 'GET'
|
|
1586
|
+
path = '/' + encodeURIComponent(index) + '/' + '_stats'
|
|
1587
|
+
} else {
|
|
1588
|
+
if (method == null) method = 'GET'
|
|
1589
|
+
path = '/' + '_stats'
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
// build request object
|
|
1593
|
+
const request = {
|
|
1594
|
+
method,
|
|
1595
|
+
path,
|
|
1596
|
+
body: null,
|
|
1597
|
+
querystring
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
return this.transport.request(request, options, callback)
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
IndicesApi.prototype.unfreeze = function indicesUnfreezeApi (params, options, callback) {
|
|
1604
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1605
|
+
|
|
1606
|
+
// check required parameters
|
|
1607
|
+
if (params.index == null) {
|
|
1608
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
1609
|
+
return handleError(err, callback)
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
let { method, body, index, ...querystring } = params
|
|
1613
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1614
|
+
|
|
1615
|
+
let path = ''
|
|
1616
|
+
if (method == null) method = 'POST'
|
|
1617
|
+
path = '/' + encodeURIComponent(index) + '/' + '_unfreeze'
|
|
1618
|
+
|
|
1619
|
+
// build request object
|
|
1620
|
+
const request = {
|
|
1621
|
+
method,
|
|
1622
|
+
path,
|
|
1623
|
+
body: body || '',
|
|
1624
|
+
querystring
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
return this.transport.request(request, options, callback)
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
IndicesApi.prototype.updateAliases = function indicesUpdateAliasesApi (params, options, callback) {
|
|
1631
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1632
|
+
|
|
1633
|
+
// check required parameters
|
|
1634
|
+
if (params.body == null) {
|
|
1635
|
+
const err = new this[kConfigurationError]('Missing required parameter: body')
|
|
1636
|
+
return handleError(err, callback)
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
let { method, body, ...querystring } = params
|
|
1640
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1641
|
+
|
|
1642
|
+
let path = ''
|
|
1643
|
+
if (method == null) method = 'POST'
|
|
1644
|
+
path = '/' + '_aliases'
|
|
1645
|
+
|
|
1646
|
+
// build request object
|
|
1647
|
+
const request = {
|
|
1648
|
+
method,
|
|
1649
|
+
path,
|
|
1650
|
+
body: body || '',
|
|
1651
|
+
querystring
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
return this.transport.request(request, options, callback)
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
IndicesApi.prototype.upgrade = function indicesUpgradeApi (params, options, callback) {
|
|
1658
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1659
|
+
|
|
1660
|
+
let { method, body, index, ...querystring } = params
|
|
1661
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1662
|
+
|
|
1663
|
+
let path = ''
|
|
1664
|
+
if (method == null) method = 'POST'
|
|
1665
|
+
path = '/' + encodeURIComponent(index) + '/' + '_upgrade'
|
|
1666
|
+
|
|
1667
|
+
// build request object
|
|
1668
|
+
const request = {
|
|
1669
|
+
method,
|
|
1670
|
+
path,
|
|
1671
|
+
body: body || '',
|
|
1672
|
+
querystring
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
return this.transport.request(request, options, callback)
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
IndicesApi.prototype.validateQuery = function indicesValidateQueryApi (params, options, callback) {
|
|
1679
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
1680
|
+
|
|
1681
|
+
// check required url components
|
|
1682
|
+
if (params.type != null && (params.index == null)) {
|
|
1683
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
|
|
1684
|
+
return handleError(err, callback)
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
let { method, body, index, type, ...querystring } = params
|
|
1688
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
1689
|
+
|
|
1690
|
+
let path = ''
|
|
1691
|
+
if ((index) != null && (type) != null) {
|
|
1692
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
1693
|
+
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_validate' + '/' + 'query'
|
|
1694
|
+
} else if ((index) != null) {
|
|
1695
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
1696
|
+
path = '/' + encodeURIComponent(index) + '/' + '_validate' + '/' + 'query'
|
|
1697
|
+
} else {
|
|
1698
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
1699
|
+
path = '/' + '_validate' + '/' + 'query'
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
// build request object
|
|
1703
|
+
const request = {
|
|
1704
|
+
method,
|
|
1705
|
+
path,
|
|
1706
|
+
body: body || '',
|
|
1707
|
+
querystring
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
return this.transport.request(request, options, callback)
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
Object.defineProperties(IndicesApi.prototype, {
|
|
1714
|
+
add_block: { get () { return this.addBlock } },
|
|
1715
|
+
clear_cache: { get () { return this.clearCache } },
|
|
1716
|
+
create_data_stream: { get () { return this.createDataStream } },
|
|
1717
|
+
data_streams_stats: { get () { return this.dataStreamsStats } },
|
|
1718
|
+
delete_alias: { get () { return this.deleteAlias } },
|
|
1719
|
+
delete_data_stream: { get () { return this.deleteDataStream } },
|
|
1720
|
+
delete_index_template: { get () { return this.deleteIndexTemplate } },
|
|
1721
|
+
delete_template: { get () { return this.deleteTemplate } },
|
|
1722
|
+
disk_usage: { get () { return this.diskUsage } },
|
|
1723
|
+
exists_alias: { get () { return this.existsAlias } },
|
|
1724
|
+
exists_index_template: { get () { return this.existsIndexTemplate } },
|
|
1725
|
+
exists_template: { get () { return this.existsTemplate } },
|
|
1726
|
+
exists_type: { get () { return this.existsType } },
|
|
1727
|
+
field_usage_stats: { get () { return this.fieldUsageStats } },
|
|
1728
|
+
flush_synced: { get () { return this.flushSynced } },
|
|
1729
|
+
get_alias: { get () { return this.getAlias } },
|
|
1730
|
+
get_data_stream: { get () { return this.getDataStream } },
|
|
1731
|
+
get_field_mapping: { get () { return this.getFieldMapping } },
|
|
1732
|
+
get_index_template: { get () { return this.getIndexTemplate } },
|
|
1733
|
+
get_mapping: { get () { return this.getMapping } },
|
|
1734
|
+
get_settings: { get () { return this.getSettings } },
|
|
1735
|
+
get_template: { get () { return this.getTemplate } },
|
|
1736
|
+
get_upgrade: { get () { return this.getUpgrade } },
|
|
1737
|
+
migrate_to_data_stream: { get () { return this.migrateToDataStream } },
|
|
1738
|
+
promote_data_stream: { get () { return this.promoteDataStream } },
|
|
1739
|
+
put_alias: { get () { return this.putAlias } },
|
|
1740
|
+
put_index_template: { get () { return this.putIndexTemplate } },
|
|
1741
|
+
put_mapping: { get () { return this.putMapping } },
|
|
1742
|
+
put_settings: { get () { return this.putSettings } },
|
|
1743
|
+
put_template: { get () { return this.putTemplate } },
|
|
1744
|
+
reload_search_analyzers: { get () { return this.reloadSearchAnalyzers } },
|
|
1745
|
+
resolve_index: { get () { return this.resolveIndex } },
|
|
1746
|
+
shard_stores: { get () { return this.shardStores } },
|
|
1747
|
+
simulate_index_template: { get () { return this.simulateIndexTemplate } },
|
|
1748
|
+
simulate_template: { get () { return this.simulateTemplate } },
|
|
1749
|
+
update_aliases: { get () { return this.updateAliases } },
|
|
1750
|
+
validate_query: { get () { return this.validateQuery } }
|
|
1751
|
+
})
|
|
1752
|
+
|
|
1753
|
+
module.exports = IndicesApi
|