@opensearch-project/opensearch 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -0
- package/.eslintrc.json +26 -0
- package/.prettierrc.json +5 -0
- package/.whitesource +15 -0
- package/ADMINS.md +18 -11
- package/COMPATIBILITY.md +24 -0
- package/DEVELOPER_GUIDE.md +22 -5
- package/MAINTAINERS.md +23 -18
- package/README.md +102 -106
- package/RELEASING.md +3 -3
- package/SECURITY.md +1 -1
- package/api/api/bulk.js +53 -26
- package/api/api/cat.js +354 -264
- package/api/api/clear_scroll.js +17 -17
- package/api/api/cluster.js +366 -219
- package/api/api/count.js +55 -24
- package/api/api/create.js +50 -24
- package/api/api/dangling_indices.js +95 -51
- package/api/api/delete.js +49 -22
- package/api/api/delete_by_query.js +88 -25
- package/api/api/delete_by_query_rethrottle.js +33 -19
- package/api/api/delete_script.js +31 -17
- package/api/api/exists.js +55 -22
- package/api/api/exists_source.js +60 -27
- package/api/api/explain.js +60 -22
- package/api/api/features.js +56 -35
- package/api/api/field_caps.js +36 -18
- package/api/api/get.js +55 -22
- package/api/api/get_script.js +30 -17
- package/api/api/get_script_context.js +15 -15
- package/api/api/get_script_languages.js +15 -15
- package/api/api/get_source.js +55 -22
- package/api/api/index.js +60 -28
- package/api/api/indices.js +1068 -857
- package/api/api/info.js +15 -15
- package/api/api/ingest.js +132 -96
- package/api/api/mget.js +50 -26
- package/api/api/msearch.js +49 -26
- package/api/api/msearch_template.js +53 -26
- package/api/api/mtermvectors.js +48 -24
- package/api/api/nodes.js +281 -154
- package/api/api/ping.js +15 -15
- package/api/api/put_script.js +40 -25
- package/api/api/rank_eval.js +37 -20
- package/api/api/reindex.js +38 -17
- package/api/api/reindex_rethrottle.js +32 -19
- package/api/api/render_search_template.js +18 -18
- package/api/api/scripts_painless_execute.js +15 -15
- package/api/api/scroll.js +31 -17
- package/api/api/search.js +108 -24
- package/api/api/search_shards.js +36 -18
- package/api/api/search_template.js +64 -26
- package/api/api/shutdown.js +66 -54
- package/api/api/snapshot.js +347 -224
- package/api/api/tasks.js +65 -46
- package/api/api/terms_enum.js +17 -17
- package/api/api/termvectors.js +57 -26
- package/api/api/update.js +64 -24
- package/api/api/update_by_query.js +89 -23
- package/api/api/update_by_query_rethrottle.js +33 -19
- package/api/index.js +267 -179
- package/api/new.d.ts +2042 -529
- package/api/opensearch_dashboards.d.ts +275 -0
- package/api/requestParams.d.ts +301 -69
- package/api/types.d.ts +6204 -5719
- package/api/utils.js +22 -22
- package/codecov.yml +2 -2
- package/index.d.ts +4779 -934
- package/index.js +153 -140
- package/index.mjs +9 -9
- package/lib/Connection.d.ts +37 -26
- package/lib/Connection.js +163 -168
- package/lib/Helpers.d.ts +103 -63
- package/lib/Helpers.js +398 -371
- package/lib/Serializer.d.ts +2 -2
- package/lib/Serializer.js +39 -39
- package/lib/Transport.d.ts +30 -12
- package/lib/Transport.js +383 -324
- package/lib/errors.d.ts +25 -7
- package/lib/errors.js +75 -71
- package/lib/pool/BaseConnectionPool.js +100 -97
- package/lib/pool/CloudConnectionPool.js +16 -16
- package/lib/pool/ConnectionPool.js +105 -105
- package/lib/pool/index.d.ts +8 -6
- package/lib/pool/index.js +6 -6
- package/package.json +13 -8
package/api/api/search.js
CHANGED
|
@@ -28,37 +28,121 @@
|
|
|
28
28
|
* under the License.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
'use strict'
|
|
31
|
+
'use strict';
|
|
32
32
|
|
|
33
33
|
/* eslint camelcase: 0 */
|
|
34
34
|
/* eslint no-unused-vars: 0 */
|
|
35
35
|
|
|
36
|
-
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
|
37
|
-
const acceptedQuerystring = [
|
|
38
|
-
|
|
36
|
+
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
|
|
37
|
+
const acceptedQuerystring = [
|
|
38
|
+
'analyzer',
|
|
39
|
+
'analyze_wildcard',
|
|
40
|
+
'ccs_minimize_roundtrips',
|
|
41
|
+
'default_operator',
|
|
42
|
+
'df',
|
|
43
|
+
'explain',
|
|
44
|
+
'stored_fields',
|
|
45
|
+
'docvalue_fields',
|
|
46
|
+
'from',
|
|
47
|
+
'ignore_unavailable',
|
|
48
|
+
'ignore_throttled',
|
|
49
|
+
'allow_no_indices',
|
|
50
|
+
'expand_wildcards',
|
|
51
|
+
'lenient',
|
|
52
|
+
'preference',
|
|
53
|
+
'q',
|
|
54
|
+
'routing',
|
|
55
|
+
'scroll',
|
|
56
|
+
'search_type',
|
|
57
|
+
'size',
|
|
58
|
+
'sort',
|
|
59
|
+
'_source',
|
|
60
|
+
'_source_excludes',
|
|
61
|
+
'_source_exclude',
|
|
62
|
+
'_source_includes',
|
|
63
|
+
'_source_include',
|
|
64
|
+
'terminate_after',
|
|
65
|
+
'stats',
|
|
66
|
+
'suggest_field',
|
|
67
|
+
'suggest_mode',
|
|
68
|
+
'suggest_size',
|
|
69
|
+
'suggest_text',
|
|
70
|
+
'timeout',
|
|
71
|
+
'track_scores',
|
|
72
|
+
'track_total_hits',
|
|
73
|
+
'allow_partial_search_results',
|
|
74
|
+
'typed_keys',
|
|
75
|
+
'version',
|
|
76
|
+
'seq_no_primary_term',
|
|
77
|
+
'request_cache',
|
|
78
|
+
'batched_reduce_size',
|
|
79
|
+
'max_concurrent_shard_requests',
|
|
80
|
+
'pre_filter_shard_size',
|
|
81
|
+
'rest_total_hits_as_int',
|
|
82
|
+
'min_compatible_shard_node',
|
|
83
|
+
'pretty',
|
|
84
|
+
'human',
|
|
85
|
+
'error_trace',
|
|
86
|
+
'source',
|
|
87
|
+
'filter_path',
|
|
88
|
+
];
|
|
89
|
+
const snakeCase = {
|
|
90
|
+
analyzeWildcard: 'analyze_wildcard',
|
|
91
|
+
ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips',
|
|
92
|
+
defaultOperator: 'default_operator',
|
|
93
|
+
storedFields: 'stored_fields',
|
|
94
|
+
docvalueFields: 'docvalue_fields',
|
|
95
|
+
ignoreUnavailable: 'ignore_unavailable',
|
|
96
|
+
ignoreThrottled: 'ignore_throttled',
|
|
97
|
+
allowNoIndices: 'allow_no_indices',
|
|
98
|
+
expandWildcards: 'expand_wildcards',
|
|
99
|
+
searchType: 'search_type',
|
|
100
|
+
_sourceExcludes: '_source_excludes',
|
|
101
|
+
_sourceExclude: '_source_exclude',
|
|
102
|
+
_sourceIncludes: '_source_includes',
|
|
103
|
+
_sourceInclude: '_source_include',
|
|
104
|
+
terminateAfter: 'terminate_after',
|
|
105
|
+
suggestField: 'suggest_field',
|
|
106
|
+
suggestMode: 'suggest_mode',
|
|
107
|
+
suggestSize: 'suggest_size',
|
|
108
|
+
suggestText: 'suggest_text',
|
|
109
|
+
trackScores: 'track_scores',
|
|
110
|
+
trackTotalHits: 'track_total_hits',
|
|
111
|
+
allowPartialSearchResults: 'allow_partial_search_results',
|
|
112
|
+
typedKeys: 'typed_keys',
|
|
113
|
+
seqNoPrimaryTerm: 'seq_no_primary_term',
|
|
114
|
+
requestCache: 'request_cache',
|
|
115
|
+
batchedReduceSize: 'batched_reduce_size',
|
|
116
|
+
maxConcurrentShardRequests: 'max_concurrent_shard_requests',
|
|
117
|
+
preFilterShardSize: 'pre_filter_shard_size',
|
|
118
|
+
restTotalHitsAsInt: 'rest_total_hits_as_int',
|
|
119
|
+
minCompatibleShardNode: 'min_compatible_shard_node',
|
|
120
|
+
errorTrace: 'error_trace',
|
|
121
|
+
filterPath: 'filter_path',
|
|
122
|
+
};
|
|
39
123
|
|
|
40
|
-
function searchApi
|
|
41
|
-
|
|
124
|
+
function searchApi(params, options, callback) {
|
|
125
|
+
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
42
126
|
|
|
43
127
|
// check required url components
|
|
44
|
-
if (params.type != null &&
|
|
45
|
-
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
|
|
46
|
-
return handleError(err, callback)
|
|
128
|
+
if (params.type != null && params.index == null) {
|
|
129
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: index');
|
|
130
|
+
return handleError(err, callback);
|
|
47
131
|
}
|
|
48
132
|
|
|
49
|
-
let { method, body, index, type, ...querystring } = params
|
|
50
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
133
|
+
let { method, body, index, type, ...querystring } = params;
|
|
134
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
|
|
51
135
|
|
|
52
|
-
let path = ''
|
|
53
|
-
if (
|
|
54
|
-
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
55
|
-
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search'
|
|
56
|
-
} else if (
|
|
57
|
-
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
58
|
-
path = '/' + encodeURIComponent(index) + '/' + '_search'
|
|
136
|
+
let path = '';
|
|
137
|
+
if (index != null && type != null) {
|
|
138
|
+
if (method == null) method = body == null ? 'GET' : 'POST';
|
|
139
|
+
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search';
|
|
140
|
+
} else if (index != null) {
|
|
141
|
+
if (method == null) method = body == null ? 'GET' : 'POST';
|
|
142
|
+
path = '/' + encodeURIComponent(index) + '/' + '_search';
|
|
59
143
|
} else {
|
|
60
|
-
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
61
|
-
path = '/' + '_search'
|
|
144
|
+
if (method == null) method = body == null ? 'GET' : 'POST';
|
|
145
|
+
path = '/' + '_search';
|
|
62
146
|
}
|
|
63
147
|
|
|
64
148
|
// build request object
|
|
@@ -66,10 +150,10 @@ function searchApi (params, options, callback) {
|
|
|
66
150
|
method,
|
|
67
151
|
path,
|
|
68
152
|
body: body || '',
|
|
69
|
-
querystring
|
|
70
|
-
}
|
|
153
|
+
querystring,
|
|
154
|
+
};
|
|
71
155
|
|
|
72
|
-
return this.transport.request(request, options, callback)
|
|
156
|
+
return this.transport.request(request, options, callback);
|
|
73
157
|
}
|
|
74
158
|
|
|
75
|
-
module.exports = searchApi
|
|
159
|
+
module.exports = searchApi;
|
package/api/api/search_shards.js
CHANGED
|
@@ -28,28 +28,46 @@
|
|
|
28
28
|
* under the License.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
'use strict'
|
|
31
|
+
'use strict';
|
|
32
32
|
|
|
33
33
|
/* eslint camelcase: 0 */
|
|
34
34
|
/* eslint no-unused-vars: 0 */
|
|
35
35
|
|
|
36
|
-
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
|
37
|
-
const acceptedQuerystring = [
|
|
38
|
-
|
|
36
|
+
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
|
|
37
|
+
const acceptedQuerystring = [
|
|
38
|
+
'preference',
|
|
39
|
+
'routing',
|
|
40
|
+
'local',
|
|
41
|
+
'ignore_unavailable',
|
|
42
|
+
'allow_no_indices',
|
|
43
|
+
'expand_wildcards',
|
|
44
|
+
'pretty',
|
|
45
|
+
'human',
|
|
46
|
+
'error_trace',
|
|
47
|
+
'source',
|
|
48
|
+
'filter_path',
|
|
49
|
+
];
|
|
50
|
+
const snakeCase = {
|
|
51
|
+
ignoreUnavailable: 'ignore_unavailable',
|
|
52
|
+
allowNoIndices: 'allow_no_indices',
|
|
53
|
+
expandWildcards: 'expand_wildcards',
|
|
54
|
+
errorTrace: 'error_trace',
|
|
55
|
+
filterPath: 'filter_path',
|
|
56
|
+
};
|
|
39
57
|
|
|
40
|
-
function searchShardsApi
|
|
41
|
-
|
|
58
|
+
function searchShardsApi(params, options, callback) {
|
|
59
|
+
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
42
60
|
|
|
43
|
-
let { method, body, index, ...querystring } = params
|
|
44
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
61
|
+
let { method, body, index, ...querystring } = params;
|
|
62
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
|
|
45
63
|
|
|
46
|
-
let path = ''
|
|
47
|
-
if (
|
|
48
|
-
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
49
|
-
path = '/' + encodeURIComponent(index) + '/' + '_search_shards'
|
|
64
|
+
let path = '';
|
|
65
|
+
if (index != null) {
|
|
66
|
+
if (method == null) method = body == null ? 'GET' : 'POST';
|
|
67
|
+
path = '/' + encodeURIComponent(index) + '/' + '_search_shards';
|
|
50
68
|
} else {
|
|
51
|
-
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
52
|
-
path = '/' + '_search_shards'
|
|
69
|
+
if (method == null) method = body == null ? 'GET' : 'POST';
|
|
70
|
+
path = '/' + '_search_shards';
|
|
53
71
|
}
|
|
54
72
|
|
|
55
73
|
// build request object
|
|
@@ -57,10 +75,10 @@ function searchShardsApi (params, options, callback) {
|
|
|
57
75
|
method,
|
|
58
76
|
path,
|
|
59
77
|
body: body || '',
|
|
60
|
-
querystring
|
|
61
|
-
}
|
|
78
|
+
querystring,
|
|
79
|
+
};
|
|
62
80
|
|
|
63
|
-
return this.transport.request(request, options, callback)
|
|
81
|
+
return this.transport.request(request, options, callback);
|
|
64
82
|
}
|
|
65
83
|
|
|
66
|
-
module.exports = searchShardsApi
|
|
84
|
+
module.exports = searchShardsApi;
|
|
@@ -28,43 +28,81 @@
|
|
|
28
28
|
* under the License.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
'use strict'
|
|
31
|
+
'use strict';
|
|
32
32
|
|
|
33
33
|
/* eslint camelcase: 0 */
|
|
34
34
|
/* eslint no-unused-vars: 0 */
|
|
35
35
|
|
|
36
|
-
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
|
37
|
-
const acceptedQuerystring = [
|
|
38
|
-
|
|
36
|
+
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
|
|
37
|
+
const acceptedQuerystring = [
|
|
38
|
+
'ignore_unavailable',
|
|
39
|
+
'ignore_throttled',
|
|
40
|
+
'allow_no_indices',
|
|
41
|
+
'expand_wildcards',
|
|
42
|
+
'preference',
|
|
43
|
+
'routing',
|
|
44
|
+
'scroll',
|
|
45
|
+
'search_type',
|
|
46
|
+
'explain',
|
|
47
|
+
'profile',
|
|
48
|
+
'typed_keys',
|
|
49
|
+
'rest_total_hits_as_int',
|
|
50
|
+
'ccs_minimize_roundtrips',
|
|
51
|
+
'pretty',
|
|
52
|
+
'human',
|
|
53
|
+
'error_trace',
|
|
54
|
+
'source',
|
|
55
|
+
'filter_path',
|
|
56
|
+
];
|
|
57
|
+
const snakeCase = {
|
|
58
|
+
ignoreUnavailable: 'ignore_unavailable',
|
|
59
|
+
ignoreThrottled: 'ignore_throttled',
|
|
60
|
+
allowNoIndices: 'allow_no_indices',
|
|
61
|
+
expandWildcards: 'expand_wildcards',
|
|
62
|
+
searchType: 'search_type',
|
|
63
|
+
typedKeys: 'typed_keys',
|
|
64
|
+
restTotalHitsAsInt: 'rest_total_hits_as_int',
|
|
65
|
+
ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips',
|
|
66
|
+
errorTrace: 'error_trace',
|
|
67
|
+
filterPath: 'filter_path',
|
|
68
|
+
};
|
|
39
69
|
|
|
40
|
-
function searchTemplateApi
|
|
41
|
-
|
|
70
|
+
function searchTemplateApi(params, options, callback) {
|
|
71
|
+
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
42
72
|
|
|
43
73
|
// check required parameters
|
|
44
74
|
if (params.body == null) {
|
|
45
|
-
const err = new this[kConfigurationError]('Missing required parameter: body')
|
|
46
|
-
return handleError(err, callback)
|
|
75
|
+
const err = new this[kConfigurationError]('Missing required parameter: body');
|
|
76
|
+
return handleError(err, callback);
|
|
47
77
|
}
|
|
48
78
|
|
|
49
79
|
// check required url components
|
|
50
|
-
if (params.type != null &&
|
|
51
|
-
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
|
|
52
|
-
return handleError(err, callback)
|
|
80
|
+
if (params.type != null && params.index == null) {
|
|
81
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: index');
|
|
82
|
+
return handleError(err, callback);
|
|
53
83
|
}
|
|
54
84
|
|
|
55
|
-
let { method, body, index, type, ...querystring } = params
|
|
56
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
85
|
+
let { method, body, index, type, ...querystring } = params;
|
|
86
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
|
|
57
87
|
|
|
58
|
-
let path = ''
|
|
59
|
-
if (
|
|
60
|
-
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
61
|
-
path =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
88
|
+
let path = '';
|
|
89
|
+
if (index != null && type != null) {
|
|
90
|
+
if (method == null) method = body == null ? 'GET' : 'POST';
|
|
91
|
+
path =
|
|
92
|
+
'/' +
|
|
93
|
+
encodeURIComponent(index) +
|
|
94
|
+
'/' +
|
|
95
|
+
encodeURIComponent(type) +
|
|
96
|
+
'/' +
|
|
97
|
+
'_search' +
|
|
98
|
+
'/' +
|
|
99
|
+
'template';
|
|
100
|
+
} else if (index != null) {
|
|
101
|
+
if (method == null) method = body == null ? 'GET' : 'POST';
|
|
102
|
+
path = '/' + encodeURIComponent(index) + '/' + '_search' + '/' + 'template';
|
|
65
103
|
} else {
|
|
66
|
-
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
67
|
-
path = '/' + '_search' + '/' + 'template'
|
|
104
|
+
if (method == null) method = body == null ? 'GET' : 'POST';
|
|
105
|
+
path = '/' + '_search' + '/' + 'template';
|
|
68
106
|
}
|
|
69
107
|
|
|
70
108
|
// build request object
|
|
@@ -72,10 +110,10 @@ function searchTemplateApi (params, options, callback) {
|
|
|
72
110
|
method,
|
|
73
111
|
path,
|
|
74
112
|
body: body || '',
|
|
75
|
-
querystring
|
|
76
|
-
}
|
|
113
|
+
querystring,
|
|
114
|
+
};
|
|
77
115
|
|
|
78
|
-
return this.transport.request(request, options, callback)
|
|
116
|
+
return this.transport.request(request, options, callback);
|
|
79
117
|
}
|
|
80
118
|
|
|
81
|
-
module.exports = searchTemplateApi
|
|
119
|
+
module.exports = searchTemplateApi;
|
package/api/api/shutdown.js
CHANGED
|
@@ -28,60 +28,60 @@
|
|
|
28
28
|
* under the License.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
'use strict'
|
|
31
|
+
'use strict';
|
|
32
32
|
|
|
33
33
|
/* eslint camelcase: 0 */
|
|
34
34
|
/* eslint no-unused-vars: 0 */
|
|
35
35
|
|
|
36
|
-
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
|
37
|
-
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
|
|
38
|
-
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
|
|
36
|
+
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
|
|
37
|
+
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
|
|
38
|
+
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
|
|
39
39
|
|
|
40
|
-
function ShutdownApi
|
|
41
|
-
this.transport = transport
|
|
42
|
-
this[kConfigurationError] = ConfigurationError
|
|
40
|
+
function ShutdownApi(transport, ConfigurationError) {
|
|
41
|
+
this.transport = transport;
|
|
42
|
+
this[kConfigurationError] = ConfigurationError;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
ShutdownApi.prototype.deleteNode = function shutdownDeleteNodeApi
|
|
46
|
-
|
|
45
|
+
ShutdownApi.prototype.deleteNode = function shutdownDeleteNodeApi(params, options, callback) {
|
|
46
|
+
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
47
47
|
|
|
48
48
|
// check required parameters
|
|
49
49
|
if (params.node_id == null && params.nodeId == null) {
|
|
50
|
-
const err = new this[kConfigurationError]('Missing required parameter: node_id or nodeId')
|
|
51
|
-
return handleError(err, callback)
|
|
50
|
+
const err = new this[kConfigurationError]('Missing required parameter: node_id or nodeId');
|
|
51
|
+
return handleError(err, callback);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
let { method, body, nodeId, node_id, ...querystring } = params
|
|
55
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
54
|
+
let { method, body, nodeId, node_id, ...querystring } = params;
|
|
55
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
|
|
56
56
|
|
|
57
|
-
let path = ''
|
|
58
|
-
if (method == null) method = 'DELETE'
|
|
59
|
-
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'shutdown'
|
|
57
|
+
let path = '';
|
|
58
|
+
if (method == null) method = 'DELETE';
|
|
59
|
+
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'shutdown';
|
|
60
60
|
|
|
61
61
|
// build request object
|
|
62
62
|
const request = {
|
|
63
63
|
method,
|
|
64
64
|
path,
|
|
65
65
|
body: body || '',
|
|
66
|
-
querystring
|
|
67
|
-
}
|
|
66
|
+
querystring,
|
|
67
|
+
};
|
|
68
68
|
|
|
69
|
-
return this.transport.request(request, options, callback)
|
|
70
|
-
}
|
|
69
|
+
return this.transport.request(request, options, callback);
|
|
70
|
+
};
|
|
71
71
|
|
|
72
|
-
ShutdownApi.prototype.getNode = function shutdownGetNodeApi
|
|
73
|
-
|
|
72
|
+
ShutdownApi.prototype.getNode = function shutdownGetNodeApi(params, options, callback) {
|
|
73
|
+
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
74
74
|
|
|
75
|
-
let { method, body, nodeId, node_id, ...querystring } = params
|
|
76
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
75
|
+
let { method, body, nodeId, node_id, ...querystring } = params;
|
|
76
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
|
|
77
77
|
|
|
78
|
-
let path = ''
|
|
78
|
+
let path = '';
|
|
79
79
|
if ((node_id || nodeId) != null) {
|
|
80
|
-
if (method == null) method = 'GET'
|
|
81
|
-
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'shutdown'
|
|
80
|
+
if (method == null) method = 'GET';
|
|
81
|
+
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'shutdown';
|
|
82
82
|
} else {
|
|
83
|
-
if (method == null) method = 'GET'
|
|
84
|
-
path = '/' + '_nodes' + '/' + 'shutdown'
|
|
83
|
+
if (method == null) method = 'GET';
|
|
84
|
+
path = '/' + '_nodes' + '/' + 'shutdown';
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
// build request object
|
|
@@ -89,47 +89,59 @@ ShutdownApi.prototype.getNode = function shutdownGetNodeApi (params, options, ca
|
|
|
89
89
|
method,
|
|
90
90
|
path,
|
|
91
91
|
body: null,
|
|
92
|
-
querystring
|
|
93
|
-
}
|
|
92
|
+
querystring,
|
|
93
|
+
};
|
|
94
94
|
|
|
95
|
-
return this.transport.request(request, options, callback)
|
|
96
|
-
}
|
|
95
|
+
return this.transport.request(request, options, callback);
|
|
96
|
+
};
|
|
97
97
|
|
|
98
|
-
ShutdownApi.prototype.putNode = function shutdownPutNodeApi
|
|
99
|
-
|
|
98
|
+
ShutdownApi.prototype.putNode = function shutdownPutNodeApi(params, options, callback) {
|
|
99
|
+
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
100
100
|
|
|
101
101
|
// check required parameters
|
|
102
102
|
if (params.node_id == null && params.nodeId == null) {
|
|
103
|
-
const err = new this[kConfigurationError]('Missing required parameter: node_id or nodeId')
|
|
104
|
-
return handleError(err, callback)
|
|
103
|
+
const err = new this[kConfigurationError]('Missing required parameter: node_id or nodeId');
|
|
104
|
+
return handleError(err, callback);
|
|
105
105
|
}
|
|
106
106
|
if (params.body == null) {
|
|
107
|
-
const err = new this[kConfigurationError]('Missing required parameter: body')
|
|
108
|
-
return handleError(err, callback)
|
|
107
|
+
const err = new this[kConfigurationError]('Missing required parameter: body');
|
|
108
|
+
return handleError(err, callback);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
let { method, body, nodeId, node_id, ...querystring } = params
|
|
112
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
111
|
+
let { method, body, nodeId, node_id, ...querystring } = params;
|
|
112
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
|
|
113
113
|
|
|
114
|
-
let path = ''
|
|
115
|
-
if (method == null) method = 'PUT'
|
|
116
|
-
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'shutdown'
|
|
114
|
+
let path = '';
|
|
115
|
+
if (method == null) method = 'PUT';
|
|
116
|
+
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'shutdown';
|
|
117
117
|
|
|
118
118
|
// build request object
|
|
119
119
|
const request = {
|
|
120
120
|
method,
|
|
121
121
|
path,
|
|
122
122
|
body: body || '',
|
|
123
|
-
querystring
|
|
124
|
-
}
|
|
123
|
+
querystring,
|
|
124
|
+
};
|
|
125
125
|
|
|
126
|
-
return this.transport.request(request, options, callback)
|
|
127
|
-
}
|
|
126
|
+
return this.transport.request(request, options, callback);
|
|
127
|
+
};
|
|
128
128
|
|
|
129
129
|
Object.defineProperties(ShutdownApi.prototype, {
|
|
130
|
-
delete_node: {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
130
|
+
delete_node: {
|
|
131
|
+
get() {
|
|
132
|
+
return this.deleteNode;
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
get_node: {
|
|
136
|
+
get() {
|
|
137
|
+
return this.getNode;
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
put_node: {
|
|
141
|
+
get() {
|
|
142
|
+
return this.putNode;
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
module.exports = ShutdownApi;
|