@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,66 @@
|
|
|
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 = ['system_id', 'system_api_version', 'interval', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
|
|
27
|
+
const snakeCase = { systemId: 'system_id', systemApiVersion: 'system_api_version', errorTrace: 'error_trace', filterPath: 'filter_path' }
|
|
28
|
+
|
|
29
|
+
function MonitoringApi (transport, ConfigurationError) {
|
|
30
|
+
this.transport = transport
|
|
31
|
+
this[kConfigurationError] = ConfigurationError
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
MonitoringApi.prototype.bulk = function monitoringBulkApi (params, options, callback) {
|
|
35
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
36
|
+
|
|
37
|
+
// check required parameters
|
|
38
|
+
if (params.body == null) {
|
|
39
|
+
const err = new this[kConfigurationError]('Missing required parameter: body')
|
|
40
|
+
return handleError(err, callback)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
let { method, body, type, ...querystring } = params
|
|
44
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
45
|
+
|
|
46
|
+
let path = ''
|
|
47
|
+
if ((type) != null) {
|
|
48
|
+
if (method == null) method = 'POST'
|
|
49
|
+
path = '/' + '_monitoring' + '/' + encodeURIComponent(type) + '/' + 'bulk'
|
|
50
|
+
} else {
|
|
51
|
+
if (method == null) method = 'POST'
|
|
52
|
+
path = '/' + '_monitoring' + '/' + 'bulk'
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// build request object
|
|
56
|
+
const request = {
|
|
57
|
+
method,
|
|
58
|
+
path,
|
|
59
|
+
bulkBody: body,
|
|
60
|
+
querystring
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return this.transport.request(request, options, callback)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
module.exports = MonitoringApi
|
|
@@ -0,0 +1,70 @@
|
|
|
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 = ['search_type', 'max_concurrent_searches', 'typed_keys', 'pre_filter_shard_size', 'max_concurrent_shard_requests', 'rest_total_hits_as_int', 'ccs_minimize_roundtrips', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
|
|
27
|
+
const snakeCase = { searchType: 'search_type', maxConcurrentSearches: 'max_concurrent_searches', typedKeys: 'typed_keys', preFilterShardSize: 'pre_filter_shard_size', maxConcurrentShardRequests: 'max_concurrent_shard_requests', restTotalHitsAsInt: 'rest_total_hits_as_int', ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips', errorTrace: 'error_trace', filterPath: 'filter_path' }
|
|
28
|
+
|
|
29
|
+
function msearchApi (params, options, callback) {
|
|
30
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
31
|
+
|
|
32
|
+
// check required parameters
|
|
33
|
+
if (params.body == null) {
|
|
34
|
+
const err = new this[kConfigurationError]('Missing required parameter: body')
|
|
35
|
+
return handleError(err, callback)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// check required url components
|
|
39
|
+
if (params.type != null && (params.index == null)) {
|
|
40
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
|
|
41
|
+
return handleError(err, callback)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let { method, body, index, type, ...querystring } = params
|
|
45
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
46
|
+
|
|
47
|
+
let path = ''
|
|
48
|
+
if ((index) != null && (type) != null) {
|
|
49
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
50
|
+
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch'
|
|
51
|
+
} else if ((index) != null) {
|
|
52
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
53
|
+
path = '/' + encodeURIComponent(index) + '/' + '_msearch'
|
|
54
|
+
} else {
|
|
55
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
56
|
+
path = '/' + '_msearch'
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// build request object
|
|
60
|
+
const request = {
|
|
61
|
+
method,
|
|
62
|
+
path,
|
|
63
|
+
bulkBody: body,
|
|
64
|
+
querystring
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return this.transport.request(request, options, callback)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
module.exports = msearchApi
|
|
@@ -0,0 +1,70 @@
|
|
|
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 = ['search_type', 'typed_keys', 'max_concurrent_searches', 'rest_total_hits_as_int', 'ccs_minimize_roundtrips', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
|
|
27
|
+
const snakeCase = { searchType: 'search_type', typedKeys: 'typed_keys', maxConcurrentSearches: 'max_concurrent_searches', restTotalHitsAsInt: 'rest_total_hits_as_int', ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips', errorTrace: 'error_trace', filterPath: 'filter_path' }
|
|
28
|
+
|
|
29
|
+
function msearchTemplateApi (params, options, callback) {
|
|
30
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
31
|
+
|
|
32
|
+
// check required parameters
|
|
33
|
+
if (params.body == null) {
|
|
34
|
+
const err = new this[kConfigurationError]('Missing required parameter: body')
|
|
35
|
+
return handleError(err, callback)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// check required url components
|
|
39
|
+
if (params.type != null && (params.index == null)) {
|
|
40
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
|
|
41
|
+
return handleError(err, callback)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let { method, body, index, type, ...querystring } = params
|
|
45
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
46
|
+
|
|
47
|
+
let path = ''
|
|
48
|
+
if ((index) != null && (type) != null) {
|
|
49
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
50
|
+
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch' + '/' + 'template'
|
|
51
|
+
} else if ((index) != null) {
|
|
52
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
53
|
+
path = '/' + encodeURIComponent(index) + '/' + '_msearch' + '/' + 'template'
|
|
54
|
+
} else {
|
|
55
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
56
|
+
path = '/' + '_msearch' + '/' + 'template'
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// build request object
|
|
60
|
+
const request = {
|
|
61
|
+
method,
|
|
62
|
+
path,
|
|
63
|
+
bulkBody: body,
|
|
64
|
+
querystring
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return this.transport.request(request, options, callback)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
module.exports = msearchTemplateApi
|
|
@@ -0,0 +1,64 @@
|
|
|
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 = ['ids', 'term_statistics', 'field_statistics', 'fields', 'offsets', 'positions', 'payloads', 'preference', 'routing', 'realtime', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
|
|
27
|
+
const snakeCase = { termStatistics: 'term_statistics', fieldStatistics: 'field_statistics', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
|
|
28
|
+
|
|
29
|
+
function mtermvectorsApi (params, options, callback) {
|
|
30
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
31
|
+
|
|
32
|
+
// check required url components
|
|
33
|
+
if (params.type != null && (params.index == null)) {
|
|
34
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
|
|
35
|
+
return handleError(err, callback)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
let { method, body, index, type, ...querystring } = params
|
|
39
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
40
|
+
|
|
41
|
+
let path = ''
|
|
42
|
+
if ((index) != null && (type) != null) {
|
|
43
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
44
|
+
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mtermvectors'
|
|
45
|
+
} else if ((index) != null) {
|
|
46
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
47
|
+
path = '/' + encodeURIComponent(index) + '/' + '_mtermvectors'
|
|
48
|
+
} else {
|
|
49
|
+
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
50
|
+
path = '/' + '_mtermvectors'
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// build request object
|
|
54
|
+
const request = {
|
|
55
|
+
method,
|
|
56
|
+
path,
|
|
57
|
+
body: body || '',
|
|
58
|
+
querystring
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return this.transport.request(request, options, callback)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
module.exports = mtermvectorsApi
|
package/api/api/nodes.js
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
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 = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'interval', 'snapshots', 'threads', 'ignore_idle_threads', 'type', 'timeout', 'flat_settings', 'completion_fields', 'fielddata_fields', 'fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments']
|
|
27
|
+
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', ignoreIdleThreads: 'ignore_idle_threads', flatSettings: 'flat_settings', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments' }
|
|
28
|
+
|
|
29
|
+
function NodesApi (transport, ConfigurationError) {
|
|
30
|
+
this.transport = transport
|
|
31
|
+
this[kConfigurationError] = ConfigurationError
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
NodesApi.prototype.clearRepositoriesMeteringArchive = function nodesClearRepositoriesMeteringArchiveApi (params, options, callback) {
|
|
35
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
36
|
+
|
|
37
|
+
// check required parameters
|
|
38
|
+
if (params.node_id == null && params.nodeId == null) {
|
|
39
|
+
const err = new this[kConfigurationError]('Missing required parameter: node_id or nodeId')
|
|
40
|
+
return handleError(err, callback)
|
|
41
|
+
}
|
|
42
|
+
if (params.max_archive_version == null && params.maxArchiveVersion == null) {
|
|
43
|
+
const err = new this[kConfigurationError]('Missing required parameter: max_archive_version or maxArchiveVersion')
|
|
44
|
+
return handleError(err, callback)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// check required url components
|
|
48
|
+
if ((params.max_archive_version != null || params.maxArchiveVersion != null) && ((params.node_id == null && params.nodeId == null))) {
|
|
49
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: node_id')
|
|
50
|
+
return handleError(err, callback)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let { method, body, nodeId, node_id, maxArchiveVersion, max_archive_version, ...querystring } = params
|
|
54
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
55
|
+
|
|
56
|
+
let path = ''
|
|
57
|
+
if (method == null) method = 'DELETE'
|
|
58
|
+
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + '_repositories_metering' + '/' + encodeURIComponent(max_archive_version || maxArchiveVersion)
|
|
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
|
+
NodesApi.prototype.getRepositoriesMeteringInfo = function nodesGetRepositoriesMeteringInfoApi (params, options, callback) {
|
|
72
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
73
|
+
|
|
74
|
+
// check required parameters
|
|
75
|
+
if (params.node_id == null && params.nodeId == null) {
|
|
76
|
+
const err = new this[kConfigurationError]('Missing required parameter: node_id or nodeId')
|
|
77
|
+
return handleError(err, callback)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
let { method, body, nodeId, node_id, ...querystring } = params
|
|
81
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
82
|
+
|
|
83
|
+
let path = ''
|
|
84
|
+
if (method == null) method = 'GET'
|
|
85
|
+
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + '_repositories_metering'
|
|
86
|
+
|
|
87
|
+
// build request object
|
|
88
|
+
const request = {
|
|
89
|
+
method,
|
|
90
|
+
path,
|
|
91
|
+
body: null,
|
|
92
|
+
querystring
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return this.transport.request(request, options, callback)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
NodesApi.prototype.hotThreads = function nodesHotThreadsApi (params, options, callback) {
|
|
99
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
100
|
+
|
|
101
|
+
let { method, body, nodeId, node_id, ...querystring } = params
|
|
102
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
103
|
+
|
|
104
|
+
let path = ''
|
|
105
|
+
if ((node_id || nodeId) != null) {
|
|
106
|
+
if (method == null) method = 'GET'
|
|
107
|
+
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads'
|
|
108
|
+
} else if ((node_id || nodeId) != null) {
|
|
109
|
+
if (method == null) method = 'GET'
|
|
110
|
+
path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads'
|
|
111
|
+
} else if ((node_id || nodeId) != null) {
|
|
112
|
+
if (method == null) method = 'GET'
|
|
113
|
+
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads'
|
|
114
|
+
} else if ((node_id || nodeId) != null) {
|
|
115
|
+
if (method == null) method = 'GET'
|
|
116
|
+
path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads'
|
|
117
|
+
} else {
|
|
118
|
+
if (method == null) method = 'GET'
|
|
119
|
+
path = '/' + '_nodes' + '/' + 'hot_threads'
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// build request object
|
|
123
|
+
const request = {
|
|
124
|
+
method,
|
|
125
|
+
path,
|
|
126
|
+
body: null,
|
|
127
|
+
querystring
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return this.transport.request(request, options, callback)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
NodesApi.prototype.info = function nodesInfoApi (params, options, callback) {
|
|
134
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
135
|
+
|
|
136
|
+
let { method, body, nodeId, node_id, metric, ...querystring } = params
|
|
137
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
138
|
+
|
|
139
|
+
let path = ''
|
|
140
|
+
if ((node_id || nodeId) != null && (metric) != null) {
|
|
141
|
+
if (method == null) method = 'GET'
|
|
142
|
+
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + encodeURIComponent(metric)
|
|
143
|
+
} else if ((node_id || nodeId) != null) {
|
|
144
|
+
if (method == null) method = 'GET'
|
|
145
|
+
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId)
|
|
146
|
+
} else if ((metric) != null) {
|
|
147
|
+
if (method == null) method = 'GET'
|
|
148
|
+
path = '/' + '_nodes' + '/' + encodeURIComponent(metric)
|
|
149
|
+
} else {
|
|
150
|
+
if (method == null) method = 'GET'
|
|
151
|
+
path = '/' + '_nodes'
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// build request object
|
|
155
|
+
const request = {
|
|
156
|
+
method,
|
|
157
|
+
path,
|
|
158
|
+
body: null,
|
|
159
|
+
querystring
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return this.transport.request(request, options, callback)
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
NodesApi.prototype.reloadSecureSettings = function nodesReloadSecureSettingsApi (params, options, callback) {
|
|
166
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
167
|
+
|
|
168
|
+
let { method, body, nodeId, node_id, ...querystring } = params
|
|
169
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
170
|
+
|
|
171
|
+
let path = ''
|
|
172
|
+
if ((node_id || nodeId) != null) {
|
|
173
|
+
if (method == null) method = 'POST'
|
|
174
|
+
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'reload_secure_settings'
|
|
175
|
+
} else {
|
|
176
|
+
if (method == null) method = 'POST'
|
|
177
|
+
path = '/' + '_nodes' + '/' + 'reload_secure_settings'
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// build request object
|
|
181
|
+
const request = {
|
|
182
|
+
method,
|
|
183
|
+
path,
|
|
184
|
+
body: body || '',
|
|
185
|
+
querystring
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return this.transport.request(request, options, callback)
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
NodesApi.prototype.stats = function nodesStatsApi (params, options, callback) {
|
|
192
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
193
|
+
|
|
194
|
+
let { method, body, nodeId, node_id, metric, indexMetric, index_metric, ...querystring } = params
|
|
195
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
196
|
+
|
|
197
|
+
let path = ''
|
|
198
|
+
if ((node_id || nodeId) != null && (metric) != null && (index_metric || indexMetric) != null) {
|
|
199
|
+
if (method == null) method = 'GET'
|
|
200
|
+
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'stats' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index_metric || indexMetric)
|
|
201
|
+
} else if ((node_id || nodeId) != null && (metric) != null) {
|
|
202
|
+
if (method == null) method = 'GET'
|
|
203
|
+
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'stats' + '/' + encodeURIComponent(metric)
|
|
204
|
+
} else if ((metric) != null && (index_metric || indexMetric) != null) {
|
|
205
|
+
if (method == null) method = 'GET'
|
|
206
|
+
path = '/' + '_nodes' + '/' + 'stats' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index_metric || indexMetric)
|
|
207
|
+
} else if ((node_id || nodeId) != null) {
|
|
208
|
+
if (method == null) method = 'GET'
|
|
209
|
+
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'stats'
|
|
210
|
+
} else if ((metric) != null) {
|
|
211
|
+
if (method == null) method = 'GET'
|
|
212
|
+
path = '/' + '_nodes' + '/' + 'stats' + '/' + encodeURIComponent(metric)
|
|
213
|
+
} else {
|
|
214
|
+
if (method == null) method = 'GET'
|
|
215
|
+
path = '/' + '_nodes' + '/' + 'stats'
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// build request object
|
|
219
|
+
const request = {
|
|
220
|
+
method,
|
|
221
|
+
path,
|
|
222
|
+
body: null,
|
|
223
|
+
querystring
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return this.transport.request(request, options, callback)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
NodesApi.prototype.usage = function nodesUsageApi (params, options, callback) {
|
|
230
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
231
|
+
|
|
232
|
+
let { method, body, nodeId, node_id, metric, ...querystring } = params
|
|
233
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
234
|
+
|
|
235
|
+
let path = ''
|
|
236
|
+
if ((node_id || nodeId) != null && (metric) != null) {
|
|
237
|
+
if (method == null) method = 'GET'
|
|
238
|
+
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'usage' + '/' + encodeURIComponent(metric)
|
|
239
|
+
} else if ((node_id || nodeId) != null) {
|
|
240
|
+
if (method == null) method = 'GET'
|
|
241
|
+
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'usage'
|
|
242
|
+
} else if ((metric) != null) {
|
|
243
|
+
if (method == null) method = 'GET'
|
|
244
|
+
path = '/' + '_nodes' + '/' + 'usage' + '/' + encodeURIComponent(metric)
|
|
245
|
+
} else {
|
|
246
|
+
if (method == null) method = 'GET'
|
|
247
|
+
path = '/' + '_nodes' + '/' + 'usage'
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// build request object
|
|
251
|
+
const request = {
|
|
252
|
+
method,
|
|
253
|
+
path,
|
|
254
|
+
body: null,
|
|
255
|
+
querystring
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
return this.transport.request(request, options, callback)
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
Object.defineProperties(NodesApi.prototype, {
|
|
262
|
+
clear_repositories_metering_archive: { get () { return this.clearRepositoriesMeteringArchive } },
|
|
263
|
+
get_repositories_metering_info: { get () { return this.getRepositoriesMeteringInfo } },
|
|
264
|
+
hot_threads: { get () { return this.hotThreads } },
|
|
265
|
+
reload_secure_settings: { get () { return this.reloadSecureSettings } }
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
module.exports = NodesApi
|
|
@@ -0,0 +1,56 @@
|
|
|
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 = ['preference', 'routing', 'ignore_unavailable', 'expand_wildcards', 'keep_alive', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
|
|
27
|
+
const snakeCase = { ignoreUnavailable: 'ignore_unavailable', expandWildcards: 'expand_wildcards', keepAlive: 'keep_alive', errorTrace: 'error_trace', filterPath: 'filter_path' }
|
|
28
|
+
|
|
29
|
+
function openPointInTimeApi (params, options, callback) {
|
|
30
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
31
|
+
|
|
32
|
+
// check required parameters
|
|
33
|
+
if (params.index == null) {
|
|
34
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
35
|
+
return handleError(err, callback)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
let { method, body, index, ...querystring } = params
|
|
39
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
40
|
+
|
|
41
|
+
let path = ''
|
|
42
|
+
if (method == null) method = 'POST'
|
|
43
|
+
path = '/' + encodeURIComponent(index) + '/' + '_pit'
|
|
44
|
+
|
|
45
|
+
// build request object
|
|
46
|
+
const request = {
|
|
47
|
+
method,
|
|
48
|
+
path,
|
|
49
|
+
body: body || '',
|
|
50
|
+
querystring
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return this.transport.request(request, options, callback)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
module.exports = openPointInTimeApi
|
package/api/api/ping.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
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 = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
|
|
27
|
+
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
|
|
28
|
+
|
|
29
|
+
function pingApi (params, options, callback) {
|
|
30
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
31
|
+
|
|
32
|
+
let { method, body, ...querystring } = params
|
|
33
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
34
|
+
|
|
35
|
+
let path = ''
|
|
36
|
+
if (method == null) method = 'HEAD'
|
|
37
|
+
path = '/'
|
|
38
|
+
|
|
39
|
+
// build request object
|
|
40
|
+
const request = {
|
|
41
|
+
method,
|
|
42
|
+
path,
|
|
43
|
+
body: null,
|
|
44
|
+
querystring
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return this.transport.request(request, options, callback)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
module.exports = pingApi
|