@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.
Files changed (103) hide show
  1. package/.dockerignore +5 -0
  2. package/LICENSE +202 -0
  3. package/README.md +232 -0
  4. package/api/api/async_search.js +141 -0
  5. package/api/api/autoscaling.js +147 -0
  6. package/api/api/bulk.js +70 -0
  7. package/api/api/cat.js +648 -0
  8. package/api/api/ccr.js +403 -0
  9. package/api/api/clear_scroll.js +55 -0
  10. package/api/api/close_point_in_time.js +50 -0
  11. package/api/api/cluster.js +420 -0
  12. package/api/api/count.js +64 -0
  13. package/api/api/create.js +69 -0
  14. package/api/api/dangling_indices.js +115 -0
  15. package/api/api/delete.js +65 -0
  16. package/api/api/delete_by_query.js +71 -0
  17. package/api/api/delete_by_query_rethrottle.js +60 -0
  18. package/api/api/delete_script.js +56 -0
  19. package/api/api/enrich.js +173 -0
  20. package/api/api/eql.js +150 -0
  21. package/api/api/exists.js +65 -0
  22. package/api/api/exists_source.js +74 -0
  23. package/api/api/explain.js +65 -0
  24. package/api/api/features.js +81 -0
  25. package/api/api/field_caps.js +55 -0
  26. package/api/api/fleet.js +65 -0
  27. package/api/api/get.js +65 -0
  28. package/api/api/get_script.js +56 -0
  29. package/api/api/get_script_context.js +50 -0
  30. package/api/api/get_script_languages.js +50 -0
  31. package/api/api/get_source.js +65 -0
  32. package/api/api/graph.js +72 -0
  33. package/api/api/ilm.js +317 -0
  34. package/api/api/index.js +71 -0
  35. package/api/api/indices.js +1753 -0
  36. package/api/api/info.js +50 -0
  37. package/api/api/ingest.js +200 -0
  38. package/api/api/license.js +188 -0
  39. package/api/api/logstash.js +125 -0
  40. package/api/api/mget.js +70 -0
  41. package/api/api/migration.js +60 -0
  42. package/api/api/ml.js +2010 -0
  43. package/api/api/monitoring.js +66 -0
  44. package/api/api/msearch.js +70 -0
  45. package/api/api/msearch_template.js +70 -0
  46. package/api/api/mtermvectors.js +64 -0
  47. package/api/api/nodes.js +268 -0
  48. package/api/api/open_point_in_time.js +56 -0
  49. package/api/api/ping.js +50 -0
  50. package/api/api/put_script.js +71 -0
  51. package/api/api/rank_eval.js +61 -0
  52. package/api/api/reindex.js +56 -0
  53. package/api/api/reindex_rethrottle.js +60 -0
  54. package/api/api/render_search_template.js +55 -0
  55. package/api/api/rollup.js +319 -0
  56. package/api/api/scripts_painless_execute.js +50 -0
  57. package/api/api/scroll.js +55 -0
  58. package/api/api/search.js +64 -0
  59. package/api/api/search_mvt.js +87 -0
  60. package/api/api/search_shards.js +55 -0
  61. package/api/api/search_template.js +70 -0
  62. package/api/api/searchable_snapshots.js +186 -0
  63. package/api/api/security.js +1261 -0
  64. package/api/api/shutdown.js +124 -0
  65. package/api/api/slm.js +256 -0
  66. package/api/api/snapshot.js +439 -0
  67. package/api/api/sql.js +203 -0
  68. package/api/api/ssl.js +55 -0
  69. package/api/api/tasks.js +108 -0
  70. package/api/api/terms_enum.js +56 -0
  71. package/api/api/termvectors.js +67 -0
  72. package/api/api/text_structure.js +65 -0
  73. package/api/api/transform.js +268 -0
  74. package/api/api/update.js +69 -0
  75. package/api/api/update_by_query.js +67 -0
  76. package/api/api/update_by_query_rethrottle.js +60 -0
  77. package/api/api/watcher.js +333 -0
  78. package/api/api/xpack.js +76 -0
  79. package/api/index.js +508 -0
  80. package/api/new.d.ts +1585 -0
  81. package/api/requestParams.d.ts +2920 -0
  82. package/api/types.d.ts +15420 -0
  83. package/api/utils.js +58 -0
  84. package/codecov.yml +14 -0
  85. package/index.d.ts +2991 -0
  86. package/index.js +349 -0
  87. package/index.mjs +29 -0
  88. package/lib/Connection.d.ts +99 -0
  89. package/lib/Connection.js +392 -0
  90. package/lib/Helpers.d.ts +124 -0
  91. package/lib/Helpers.js +770 -0
  92. package/lib/Serializer.d.ts +30 -0
  93. package/lib/Serializer.js +94 -0
  94. package/lib/Transport.d.ts +162 -0
  95. package/lib/Transport.js +689 -0
  96. package/lib/errors.d.ts +90 -0
  97. package/lib/errors.js +159 -0
  98. package/lib/pool/BaseConnectionPool.js +262 -0
  99. package/lib/pool/CloudConnectionPool.js +64 -0
  100. package/lib/pool/ConnectionPool.js +246 -0
  101. package/lib/pool/index.d.ts +220 -0
  102. package/lib/pool/index.js +30 -0
  103. package/package.json +106 -0
@@ -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 infoApi (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 = 'GET'
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 = infoApi
@@ -0,0 +1,200 @@
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 = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'summary', 'verbose']
27
+ const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' }
28
+
29
+ function IngestApi (transport, ConfigurationError) {
30
+ this.transport = transport
31
+ this[kConfigurationError] = ConfigurationError
32
+ }
33
+
34
+ IngestApi.prototype.deletePipeline = function ingestDeletePipelineApi (params, options, callback) {
35
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
36
+
37
+ // check required parameters
38
+ if (params.id == null) {
39
+ const err = new this[kConfigurationError]('Missing required parameter: id')
40
+ return handleError(err, callback)
41
+ }
42
+
43
+ let { method, body, id, ...querystring } = params
44
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
45
+
46
+ let path = ''
47
+ if (method == null) method = 'DELETE'
48
+ path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
49
+
50
+ // build request object
51
+ const request = {
52
+ method,
53
+ path,
54
+ body: body || '',
55
+ querystring
56
+ }
57
+
58
+ return this.transport.request(request, options, callback)
59
+ }
60
+
61
+ IngestApi.prototype.geoIpStats = function ingestGeoIpStatsApi (params, options, callback) {
62
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
63
+
64
+ let { method, body, ...querystring } = params
65
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
66
+
67
+ let path = ''
68
+ if (method == null) method = 'GET'
69
+ path = '/' + '_ingest' + '/' + 'geoip' + '/' + 'stats'
70
+
71
+ // build request object
72
+ const request = {
73
+ method,
74
+ path,
75
+ body: null,
76
+ querystring
77
+ }
78
+
79
+ return this.transport.request(request, options, callback)
80
+ }
81
+
82
+ IngestApi.prototype.getPipeline = function ingestGetPipelineApi (params, options, callback) {
83
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
84
+
85
+ let { method, body, id, ...querystring } = params
86
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
87
+
88
+ let path = ''
89
+ if ((id) != null) {
90
+ if (method == null) method = 'GET'
91
+ path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
92
+ } else {
93
+ if (method == null) method = 'GET'
94
+ path = '/' + '_ingest' + '/' + 'pipeline'
95
+ }
96
+
97
+ // build request object
98
+ const request = {
99
+ method,
100
+ path,
101
+ body: null,
102
+ querystring
103
+ }
104
+
105
+ return this.transport.request(request, options, callback)
106
+ }
107
+
108
+ IngestApi.prototype.processorGrok = function ingestProcessorGrokApi (params, options, callback) {
109
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
110
+
111
+ let { method, body, ...querystring } = params
112
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
113
+
114
+ let path = ''
115
+ if (method == null) method = 'GET'
116
+ path = '/' + '_ingest' + '/' + 'processor' + '/' + 'grok'
117
+
118
+ // build request object
119
+ const request = {
120
+ method,
121
+ path,
122
+ body: null,
123
+ querystring
124
+ }
125
+
126
+ return this.transport.request(request, options, callback)
127
+ }
128
+
129
+ IngestApi.prototype.putPipeline = function ingestPutPipelineApi (params, options, callback) {
130
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
131
+
132
+ // check required parameters
133
+ if (params.id == null) {
134
+ const err = new this[kConfigurationError]('Missing required parameter: id')
135
+ return handleError(err, callback)
136
+ }
137
+ if (params.body == null) {
138
+ const err = new this[kConfigurationError]('Missing required parameter: body')
139
+ return handleError(err, callback)
140
+ }
141
+
142
+ let { method, body, id, ...querystring } = params
143
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
144
+
145
+ let path = ''
146
+ if (method == null) method = 'PUT'
147
+ path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
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
+ IngestApi.prototype.simulate = function ingestSimulateApi (params, options, callback) {
161
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
162
+
163
+ // check required parameters
164
+ if (params.body == null) {
165
+ const err = new this[kConfigurationError]('Missing required parameter: body')
166
+ return handleError(err, callback)
167
+ }
168
+
169
+ let { method, body, id, ...querystring } = params
170
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
171
+
172
+ let path = ''
173
+ if ((id) != null) {
174
+ if (method == null) method = body == null ? 'GET' : 'POST'
175
+ path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id) + '/' + '_simulate'
176
+ } else {
177
+ if (method == null) method = body == null ? 'GET' : 'POST'
178
+ path = '/' + '_ingest' + '/' + 'pipeline' + '/' + '_simulate'
179
+ }
180
+
181
+ // build request object
182
+ const request = {
183
+ method,
184
+ path,
185
+ body: body || '',
186
+ querystring
187
+ }
188
+
189
+ return this.transport.request(request, options, callback)
190
+ }
191
+
192
+ Object.defineProperties(IngestApi.prototype, {
193
+ delete_pipeline: { get () { return this.deletePipeline } },
194
+ geo_ip_stats: { get () { return this.geoIpStats } },
195
+ get_pipeline: { get () { return this.getPipeline } },
196
+ processor_grok: { get () { return this.processorGrok } },
197
+ put_pipeline: { get () { return this.putPipeline } }
198
+ })
199
+
200
+ module.exports = IngestApi
@@ -0,0 +1,188 @@
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', 'local', 'accept_enterprise', 'acknowledge', 'type']
27
+ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', acceptEnterprise: 'accept_enterprise' }
28
+
29
+ function LicenseApi (transport, ConfigurationError) {
30
+ this.transport = transport
31
+ this[kConfigurationError] = ConfigurationError
32
+ }
33
+
34
+ LicenseApi.prototype.delete = function licenseDeleteApi (params, options, callback) {
35
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
36
+
37
+ let { method, body, ...querystring } = params
38
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
39
+
40
+ let path = ''
41
+ if (method == null) method = 'DELETE'
42
+ path = '/' + '_license'
43
+
44
+ // build request object
45
+ const request = {
46
+ method,
47
+ path,
48
+ body: body || '',
49
+ querystring
50
+ }
51
+
52
+ return this.transport.request(request, options, callback)
53
+ }
54
+
55
+ LicenseApi.prototype.get = function licenseGetApi (params, options, callback) {
56
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
57
+
58
+ let { method, body, ...querystring } = params
59
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
60
+
61
+ let path = ''
62
+ if (method == null) method = 'GET'
63
+ path = '/' + '_license'
64
+
65
+ // build request object
66
+ const request = {
67
+ method,
68
+ path,
69
+ body: null,
70
+ querystring
71
+ }
72
+
73
+ return this.transport.request(request, options, callback)
74
+ }
75
+
76
+ LicenseApi.prototype.getBasicStatus = function licenseGetBasicStatusApi (params, options, callback) {
77
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
78
+
79
+ let { method, body, ...querystring } = params
80
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
81
+
82
+ let path = ''
83
+ if (method == null) method = 'GET'
84
+ path = '/' + '_license' + '/' + 'basic_status'
85
+
86
+ // build request object
87
+ const request = {
88
+ method,
89
+ path,
90
+ body: null,
91
+ querystring
92
+ }
93
+
94
+ return this.transport.request(request, options, callback)
95
+ }
96
+
97
+ LicenseApi.prototype.getTrialStatus = function licenseGetTrialStatusApi (params, options, callback) {
98
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
99
+
100
+ let { method, body, ...querystring } = params
101
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
102
+
103
+ let path = ''
104
+ if (method == null) method = 'GET'
105
+ path = '/' + '_license' + '/' + 'trial_status'
106
+
107
+ // build request object
108
+ const request = {
109
+ method,
110
+ path,
111
+ body: null,
112
+ querystring
113
+ }
114
+
115
+ return this.transport.request(request, options, callback)
116
+ }
117
+
118
+ LicenseApi.prototype.post = function licensePostApi (params, options, callback) {
119
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
120
+
121
+ let { method, body, ...querystring } = params
122
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
123
+
124
+ let path = ''
125
+ if (method == null) method = 'PUT'
126
+ path = '/' + '_license'
127
+
128
+ // build request object
129
+ const request = {
130
+ method,
131
+ path,
132
+ body: body || '',
133
+ querystring
134
+ }
135
+
136
+ return this.transport.request(request, options, callback)
137
+ }
138
+
139
+ LicenseApi.prototype.postStartBasic = function licensePostStartBasicApi (params, options, callback) {
140
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
141
+
142
+ let { method, body, ...querystring } = params
143
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
144
+
145
+ let path = ''
146
+ if (method == null) method = 'POST'
147
+ path = '/' + '_license' + '/' + 'start_basic'
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
+ LicenseApi.prototype.postStartTrial = function licensePostStartTrialApi (params, options, callback) {
161
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
162
+
163
+ let { method, body, ...querystring } = params
164
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
165
+
166
+ let path = ''
167
+ if (method == null) method = 'POST'
168
+ path = '/' + '_license' + '/' + 'start_trial'
169
+
170
+ // build request object
171
+ const request = {
172
+ method,
173
+ path,
174
+ body: body || '',
175
+ querystring
176
+ }
177
+
178
+ return this.transport.request(request, options, callback)
179
+ }
180
+
181
+ Object.defineProperties(LicenseApi.prototype, {
182
+ get_basic_status: { get () { return this.getBasicStatus } },
183
+ get_trial_status: { get () { return this.getTrialStatus } },
184
+ post_start_basic: { get () { return this.postStartBasic } },
185
+ post_start_trial: { get () { return this.postStartTrial } }
186
+ })
187
+
188
+ module.exports = LicenseApi
@@ -0,0 +1,125 @@
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 LogstashApi (transport, ConfigurationError) {
30
+ this.transport = transport
31
+ this[kConfigurationError] = ConfigurationError
32
+ }
33
+
34
+ LogstashApi.prototype.deletePipeline = function logstashDeletePipelineApi (params, options, callback) {
35
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
36
+
37
+ // check required parameters
38
+ if (params.id == null) {
39
+ const err = new this[kConfigurationError]('Missing required parameter: id')
40
+ return handleError(err, callback)
41
+ }
42
+
43
+ let { method, body, id, ...querystring } = params
44
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
45
+
46
+ let path = ''
47
+ if (method == null) method = 'DELETE'
48
+ path = '/' + '_logstash' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
49
+
50
+ // build request object
51
+ const request = {
52
+ method,
53
+ path,
54
+ body: body || '',
55
+ querystring
56
+ }
57
+
58
+ return this.transport.request(request, options, callback)
59
+ }
60
+
61
+ LogstashApi.prototype.getPipeline = function logstashGetPipelineApi (params, options, callback) {
62
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
63
+
64
+ // check required parameters
65
+ if (params.id == null) {
66
+ const err = new this[kConfigurationError]('Missing required parameter: id')
67
+ return handleError(err, callback)
68
+ }
69
+
70
+ let { method, body, id, ...querystring } = params
71
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
72
+
73
+ let path = ''
74
+ if (method == null) method = 'GET'
75
+ path = '/' + '_logstash' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
76
+
77
+ // build request object
78
+ const request = {
79
+ method,
80
+ path,
81
+ body: null,
82
+ querystring
83
+ }
84
+
85
+ return this.transport.request(request, options, callback)
86
+ }
87
+
88
+ LogstashApi.prototype.putPipeline = function logstashPutPipelineApi (params, options, callback) {
89
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
90
+
91
+ // check required parameters
92
+ if (params.id == null) {
93
+ const err = new this[kConfigurationError]('Missing required parameter: id')
94
+ return handleError(err, callback)
95
+ }
96
+ if (params.body == null) {
97
+ const err = new this[kConfigurationError]('Missing required parameter: body')
98
+ return handleError(err, callback)
99
+ }
100
+
101
+ let { method, body, id, ...querystring } = params
102
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
103
+
104
+ let path = ''
105
+ if (method == null) method = 'PUT'
106
+ path = '/' + '_logstash' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
107
+
108
+ // build request object
109
+ const request = {
110
+ method,
111
+ path,
112
+ body: body || '',
113
+ querystring
114
+ }
115
+
116
+ return this.transport.request(request, options, callback)
117
+ }
118
+
119
+ Object.defineProperties(LogstashApi.prototype, {
120
+ delete_pipeline: { get () { return this.deletePipeline } },
121
+ get_pipeline: { get () { return this.getPipeline } },
122
+ put_pipeline: { get () { return this.putPipeline } }
123
+ })
124
+
125
+ module.exports = LogstashApi
@@ -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 = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
27
+ const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', errorTrace: 'error_trace', filterPath: 'filter_path' }
28
+
29
+ function mgetApi (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) + '/' + '_mget'
51
+ } else if ((index) != null) {
52
+ if (method == null) method = body == null ? 'GET' : 'POST'
53
+ path = '/' + encodeURIComponent(index) + '/' + '_mget'
54
+ } else {
55
+ if (method == null) method = body == null ? 'GET' : 'POST'
56
+ path = '/' + '_mget'
57
+ }
58
+
59
+ // build request object
60
+ const request = {
61
+ method,
62
+ path,
63
+ body: body || '',
64
+ querystring
65
+ }
66
+
67
+ return this.transport.request(request, options, callback)
68
+ }
69
+
70
+ module.exports = mgetApi
@@ -0,0 +1,60 @@
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 MigrationApi (transport, ConfigurationError) {
30
+ this.transport = transport
31
+ this[kConfigurationError] = ConfigurationError
32
+ }
33
+
34
+ MigrationApi.prototype.deprecations = function migrationDeprecationsApi (params, options, callback) {
35
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
36
+
37
+ let { method, body, index, ...querystring } = params
38
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
39
+
40
+ let path = ''
41
+ if ((index) != null) {
42
+ if (method == null) method = 'GET'
43
+ path = '/' + encodeURIComponent(index) + '/' + '_migration' + '/' + 'deprecations'
44
+ } else {
45
+ if (method == null) method = 'GET'
46
+ path = '/' + '_migration' + '/' + 'deprecations'
47
+ }
48
+
49
+ // build request object
50
+ const request = {
51
+ method,
52
+ path,
53
+ body: null,
54
+ querystring
55
+ }
56
+
57
+ return this.transport.request(request, options, callback)
58
+ }
59
+
60
+ module.exports = MigrationApi