Skip to content

Commit 2e62e4a

Browse files
committed
Merge branch '7.x' of https://github.com/elastic/elasticsearch-js into 7.x
2 parents 060d4ae + b0861fa commit 2e62e4a

35 files changed

+1107
-89
lines changed

.ci/test-matrix.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
ELASTICSEARCH_VERSION:
3+
- 7.2.0
34
- 7.1.0
45
- 7.0.0
56

api/api/cat.indices.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ function buildCatIndices (opts) {
3939
* @param {boolean} pri - Set to true to return stats only for primary shards
4040
* @param {list} s - Comma-separated list of column names or column aliases to sort by
4141
* @param {boolean} v - Verbose mode. Display column headers
42+
* @param {boolean} include_unloaded_segments - If set to true segment stats will include stats for segments that are not currently loaded into memory
4243
*/
4344

4445
const acceptedQuerystring = [
@@ -52,6 +53,7 @@ function buildCatIndices (opts) {
5253
'pri',
5354
's',
5455
'v',
56+
'include_unloaded_segments',
5557
'pretty',
5658
'human',
5759
'error_trace',
@@ -61,6 +63,7 @@ function buildCatIndices (opts) {
6163

6264
const snakeCase = {
6365
masterTimeout: 'master_timeout',
66+
includeUnloadedSegments: 'include_unloaded_segments',
6467
errorTrace: 'error_trace',
6568
filterPath: 'filter_path'
6669
}

api/api/cluster.health.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ function buildClusterHealth (opts) {
2929
* Perform a [cluster.health](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html) request
3030
*
3131
* @param {list} index - Limit the information returned to a specific index
32+
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
3233
* @param {enum} level - Specify the level of detail for returned information
3334
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
3435
* @param {time} master_timeout - Explicit operation timeout for connection to master node
@@ -42,6 +43,7 @@ function buildClusterHealth (opts) {
4243
*/
4344

4445
const acceptedQuerystring = [
46+
'expand_wildcards',
4547
'level',
4648
'local',
4749
'master_timeout',
@@ -60,6 +62,7 @@ function buildClusterHealth (opts) {
6062
]
6163

6264
const snakeCase = {
65+
expandWildcards: 'expand_wildcards',
6366
masterTimeout: 'master_timeout',
6467
waitForActiveShards: 'wait_for_active_shards',
6568
waitForNodes: 'wait_for_nodes',

api/api/create.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ function buildCreate (opts) {
3232
* @param {string} index - The name of the index
3333
* @param {string} type - The type of the document
3434
* @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
35-
* @param {string} parent - ID of the parent document
3635
* @param {enum} refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.
3736
* @param {string} routing - Specific routing value
3837
* @param {time} timeout - Explicit operation timeout
@@ -44,7 +43,6 @@ function buildCreate (opts) {
4443

4544
const acceptedQuerystring = [
4645
'wait_for_active_shards',
47-
'parent',
4846
'refresh',
4947
'routing',
5048
'timeout',
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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+
function buildDataFrameDeleteDataFrameTransform (opts) {
26+
// eslint-disable-next-line no-unused-vars
27+
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
28+
/**
29+
* Perform a [data_frame.delete_data_frame_transform](https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-data-frame-transform.html) request
30+
*
31+
* @param {string} transform_id - The id of the transform to delete
32+
*/
33+
34+
const acceptedQuerystring = [
35+
36+
]
37+
38+
const snakeCase = {
39+
40+
}
41+
42+
return function dataFrameDeleteDataFrameTransform (params, options, callback) {
43+
options = options || {}
44+
if (typeof options === 'function') {
45+
callback = options
46+
options = {}
47+
}
48+
if (typeof params === 'function' || params == null) {
49+
callback = params
50+
params = {}
51+
options = {}
52+
}
53+
54+
// check required parameters
55+
if (params['transform_id'] == null && params['transformId'] == null) {
56+
const err = new ConfigurationError('Missing required parameter: transform_id or transformId')
57+
return handleError(err, callback)
58+
}
59+
if (params.body != null) {
60+
const err = new ConfigurationError('This API does not require a body')
61+
return handleError(err, callback)
62+
}
63+
64+
// validate headers object
65+
if (options.headers != null && typeof options.headers !== 'object') {
66+
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
67+
return handleError(err, callback)
68+
}
69+
70+
var warnings = []
71+
var { method, body, transformId, transform_id, ...querystring } = params
72+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
73+
74+
if (method == null) {
75+
method = 'DELETE'
76+
}
77+
78+
var ignore = options.ignore
79+
if (typeof ignore === 'number') {
80+
options.ignore = [ignore]
81+
}
82+
83+
var path = ''
84+
85+
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId)
86+
87+
// build request object
88+
const request = {
89+
method,
90+
path,
91+
body: '',
92+
querystring
93+
}
94+
95+
options.warnings = warnings.length === 0 ? null : warnings
96+
return makeRequest(request, options, callback)
97+
}
98+
}
99+
100+
module.exports = buildDataFrameDeleteDataFrameTransform
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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+
function buildDataFrameGetDataFrameTransform (opts) {
26+
// eslint-disable-next-line no-unused-vars
27+
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
28+
/**
29+
* Perform a [data_frame.get_data_frame_transform](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html) request
30+
*
31+
* @param {string} transform_id - The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms
32+
* @param {int} from - skips a number of transform configs, defaults to 0
33+
* @param {int} size - specifies a max number of transforms to get, defaults to 100
34+
*/
35+
36+
const acceptedQuerystring = [
37+
'from',
38+
'size'
39+
]
40+
41+
const snakeCase = {
42+
43+
}
44+
45+
return function dataFrameGetDataFrameTransform (params, options, callback) {
46+
options = options || {}
47+
if (typeof options === 'function') {
48+
callback = options
49+
options = {}
50+
}
51+
if (typeof params === 'function' || params == null) {
52+
callback = params
53+
params = {}
54+
options = {}
55+
}
56+
57+
// check required parameters
58+
if (params.body != null) {
59+
const err = new ConfigurationError('This API does not require a body')
60+
return handleError(err, callback)
61+
}
62+
63+
// validate headers object
64+
if (options.headers != null && typeof options.headers !== 'object') {
65+
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
66+
return handleError(err, callback)
67+
}
68+
69+
var warnings = []
70+
var { method, body, transformId, transform_id, ...querystring } = params
71+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
72+
73+
if (method == null) {
74+
method = 'GET'
75+
}
76+
77+
var ignore = options.ignore
78+
if (typeof ignore === 'number') {
79+
options.ignore = [ignore]
80+
}
81+
82+
var path = ''
83+
84+
if ((transform_id || transformId) != null) {
85+
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId)
86+
} else {
87+
path = '/' + '_data_frame' + '/' + 'transforms'
88+
}
89+
90+
// build request object
91+
const request = {
92+
method,
93+
path,
94+
body: null,
95+
querystring
96+
}
97+
98+
options.warnings = warnings.length === 0 ? null : warnings
99+
return makeRequest(request, options, callback)
100+
}
101+
}
102+
103+
module.exports = buildDataFrameGetDataFrameTransform
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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+
function buildDataFrameGetDataFrameTransformStats (opts) {
26+
// eslint-disable-next-line no-unused-vars
27+
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
28+
/**
29+
* Perform a [data_frame.get_data_frame_transform_stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html) request
30+
*
31+
* @param {string} transform_id - The id of the transform for which to get stats. '_all' or '*' implies all transforms
32+
* @param {number} from - skips a number of transform stats, defaults to 0
33+
* @param {number} size - specifies a max number of transform stats to get, defaults to 100
34+
*/
35+
36+
const acceptedQuerystring = [
37+
'from',
38+
'size'
39+
]
40+
41+
const snakeCase = {
42+
43+
}
44+
45+
return function dataFrameGetDataFrameTransformStats (params, options, callback) {
46+
options = options || {}
47+
if (typeof options === 'function') {
48+
callback = options
49+
options = {}
50+
}
51+
if (typeof params === 'function' || params == null) {
52+
callback = params
53+
params = {}
54+
options = {}
55+
}
56+
57+
// check required parameters
58+
if (params.body != null) {
59+
const err = new ConfigurationError('This API does not require a body')
60+
return handleError(err, callback)
61+
}
62+
63+
// validate headers object
64+
if (options.headers != null && typeof options.headers !== 'object') {
65+
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
66+
return handleError(err, callback)
67+
}
68+
69+
var warnings = []
70+
var { method, body, transformId, transform_id, ...querystring } = params
71+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
72+
73+
if (method == null) {
74+
method = 'GET'
75+
}
76+
77+
var ignore = options.ignore
78+
if (typeof ignore === 'number') {
79+
options.ignore = [ignore]
80+
}
81+
82+
var path = ''
83+
84+
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stats'
85+
86+
// build request object
87+
const request = {
88+
method,
89+
path,
90+
body: null,
91+
querystring
92+
}
93+
94+
options.warnings = warnings.length === 0 ? null : warnings
95+
return makeRequest(request, options, callback)
96+
}
97+
}
98+
99+
module.exports = buildDataFrameGetDataFrameTransformStats

0 commit comments

Comments
 (0)