Skip to content

Commit fb73b4b

Browse files
authored
Master should use the latest version of ES (#780)
The `master` branch should work with the latest snapshot of Elasticsearch. - Use `8.0.0-SNAPSHOT` - Code generation - Updated scripts and CI conf
1 parent f260549 commit fb73b4b

File tree

68 files changed

+2076
-933
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2076
-933
lines changed

.ci/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ services:
2222
- elasticsearch-oss
2323

2424
elasticsearch-oss:
25-
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-7.0.0-beta1}
25+
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-8.0.0-SNAPSHOT}
2626
volumes:
2727
- esvol:/tmp
2828
networks:
@@ -58,7 +58,7 @@ services:
5858
command: ["npm", "run", "test:integration"]
5959

6060
elasticsearch-platinum:
61-
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-7.0.0-beta1}
61+
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-8.0.0-SNAPSHOT}
6262
ports:
6363
- "9200:9200"
6464
networks:

.ci/test-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
ELASTICSEARCH_VERSION:
3-
- 7.0.0-beta1
3+
- 8.0.0-SNAPSHOT
44

55
NODE_JS_VERSION:
66
- 11

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ node_js:
1111

1212
env:
1313
global:
14-
- ELASTICSEARCH_VERSION=7.0.0-beta1
14+
- ELASTICSEARCH_VERSION=8.0.0-SNAPSHOT
1515
- QUIET=true
1616

1717
before_install:
18-
- wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ELASTICSEARCH_VERSION}-linux-x86_64.tar.gz
18+
- wget https://snapshots.elastic.co/downloads/elasticsearch/elasticsearch-${ELASTICSEARCH_VERSION}-linux-x86_64.tar.gz
1919
- tar -xzf elasticsearch-${ELASTICSEARCH_VERSION}-linux-x86_64.tar.gz
2020
- ./elasticsearch-${ELASTICSEARCH_VERSION}/bin/elasticsearch -Enode.attr.testattr=test -Epath.repo=/tmp -Erepositories.url.allowed_urls='http://snapshot.*' &> /dev/null &
2121

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/ccr.follow_stats.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ function buildCcrFollowStats (opts) {
5151
options = {}
5252
}
5353

54+
// check required parameters
55+
if (params['index'] == null) {
56+
const err = new ConfigurationError('Missing required parameter: index')
57+
return handleError(err, callback)
58+
}
59+
5460
// validate headers object
5561
if (options.headers != null && typeof options.headers !== 'object') {
5662
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)

api/api/xpack.migration.upgrade.js renamed to api/api/ccr.forget_follower.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,25 @@
2222
/* eslint camelcase: 0 */
2323
/* eslint no-unused-vars: 0 */
2424

25-
function buildXpackMigrationUpgrade (opts) {
25+
function buildCcrForgetFollower (opts) {
2626
// eslint-disable-next-line no-unused-vars
2727
const { makeRequest, ConfigurationError, handleError } = opts
2828
/**
29-
* Perform a [xpack.migration.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-upgrade.html) request
29+
* Perform a [ccr.forget_follower](http://www.elastic.co/guide/en/elasticsearch/reference/current) request
3030
*
31-
* @param {string} index - The name of the index
32-
* @param {boolean} wait_for_completion - Should the request block until the upgrade operation is completed
31+
* @param {string} index - the name of the leader index for which specified follower retention leases should be removed
32+
* @param {object} body - the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index
3333
*/
3434

3535
const acceptedQuerystring = [
36-
'wait_for_completion'
36+
3737
]
3838

3939
const snakeCase = {
40-
waitForCompletion: 'wait_for_completion'
40+
4141
}
4242

43-
return function xpackMigrationUpgrade (params, options, callback) {
43+
return function ccrForgetFollower (params, options, callback) {
4444
options = options || {}
4545
if (typeof options === 'function') {
4646
callback = options
@@ -57,6 +57,10 @@ function buildXpackMigrationUpgrade (opts) {
5757
const err = new ConfigurationError('Missing required parameter: index')
5858
return handleError(err, callback)
5959
}
60+
if (params['body'] == null) {
61+
const err = new ConfigurationError('Missing required parameter: body')
62+
return handleError(err, callback)
63+
}
6064

6165
// validate headers object
6266
if (options.headers != null && typeof options.headers !== 'object') {
@@ -79,7 +83,7 @@ function buildXpackMigrationUpgrade (opts) {
7983

8084
var path = ''
8185

82-
path = '/' + '_migration' + '/' + 'upgrade' + '/' + encodeURIComponent(index)
86+
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'forget_follower'
8387

8488
// build request object
8589
const request = {
@@ -120,4 +124,4 @@ function buildXpackMigrationUpgrade (opts) {
120124
}
121125
}
122126

123-
module.exports = buildXpackMigrationUpgrade
127+
module.exports = buildCcrForgetFollower

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',
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
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 } = 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 = null
71+
var { method, body, transformId, transform_id } = params
72+
var querystring = semicopy(params, ['method', 'body', 'transformId', 'transform_id'])
73+
74+
if (method == null) {
75+
method = 'DELETE'
76+
}
77+
78+
var ignore = options.ignore || null
79+
if (typeof ignore === 'number') {
80+
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+
const requestOptions = {
96+
ignore,
97+
requestTimeout: options.requestTimeout || null,
98+
maxRetries: options.maxRetries || null,
99+
asStream: options.asStream || false,
100+
headers: options.headers || null,
101+
querystring: options.querystring || null,
102+
compression: options.compression || false,
103+
warnings
104+
}
105+
106+
return makeRequest(request, requestOptions, callback)
107+
108+
function semicopy (obj, exclude) {
109+
var target = {}
110+
var keys = Object.keys(obj)
111+
for (var i = 0, len = keys.length; i < len; i++) {
112+
var key = keys[i]
113+
if (exclude.indexOf(key) === -1) {
114+
target[snakeCase[key] || key] = obj[key]
115+
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
116+
warnings = warnings || []
117+
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
118+
}
119+
}
120+
}
121+
return target
122+
}
123+
}
124+
}
125+
126+
module.exports = buildDataFrameDeleteDataFrameTransform

0 commit comments

Comments
 (0)