Skip to content

Commit

Permalink
[Console] Fix for _settings and x-pack autocomplete (elastic#60246) (
Browse files Browse the repository at this point in the history
…elastic#60483)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
jloleysens and elasticmachine authored Mar 18, 2020
1 parent 2eb7208 commit f73fa4e
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ require('./es_6_0/filter')(ES_6_0);
require('./es_6_0/globals')(ES_6_0);
register(ES_6_0);
require('./es_6_0/mappings')(ES_6_0);
require('./es_6_0/settings')(ES_6_0);
require('./es_6_0/query')(ES_6_0);
require('./es_6_0/reindex')(ES_6_0);
require('./es_6_0/search')(ES_6_0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@

const _ = require('lodash');

const BOOLEAN = {
__one_of: [true, false],
};
import { BOOLEAN } from './shared';

export default function(api) {
api.addEndpointDescription('put_mapping', {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { BOOLEAN } from './shared';

export default function(api) {
api.addEndpointDescription('put_settings', {
data_autocomplete_rules: {
refresh_interval: '1s',
number_of_shards: 1,
number_of_replicas: 1,
'blocks.read_only': BOOLEAN,
'blocks.read': BOOLEAN,
'blocks.write': BOOLEAN,
'blocks.metadata': BOOLEAN,
term_index_interval: 32,
term_index_divisor: 1,
'translog.flush_threshold_ops': 5000,
'translog.flush_threshold_size': '200mb',
'translog.flush_threshold_period': '30m',
'translog.disable_flush': BOOLEAN,
'cache.filter.max_size': '2gb',
'cache.filter.expire': '2h',
'gateway.snapshot_interval': '10s',
routing: {
allocation: {
include: {
tag: '',
},
exclude: {
tag: '',
},
require: {
tag: '',
},
total_shards_per_node: -1,
},
},
'recovery.initial_shards': {
__one_of: ['quorum', 'quorum-1', 'half', 'full', 'full-1'],
},
'ttl.disable_purge': BOOLEAN,
analysis: {
analyzer: {},
tokenizer: {},
filter: {},
char_filter: {},
},
'cache.query.enable': BOOLEAN,
shadow_replicas: BOOLEAN,
shared_filesystem: BOOLEAN,
data_path: 'path',
codec: {
__one_of: ['default', 'best_compression', 'lucene_default'],
},
},
});
}
22 changes: 22 additions & 0 deletions src/legacy/core_plugins/console/server/api_server/es_6_0/shared.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export const BOOLEAN = Object.freeze({
__one_of: [true, false],
});
Original file line number Diff line number Diff line change
@@ -1,108 +1,7 @@
{
"indices.put_settings": {
"data_autocomplete_rules": {
"refresh_interval": "1s",
"number_of_shards": 1,
"number_of_replicas": 1,
"blocks.read_only": {
"__one_of": [
false,
true
]
},
"blocks.read": {
"__one_of": [
true,
false
]
},
"blocks.write": {
"__one_of": [
true,
false
]
},
"blocks.metadata": {
"__one_of": [
true,
false
]
},
"term_index_interval": 32,
"term_index_divisor": 1,
"translog.flush_threshold_ops": 5000,
"translog.flush_threshold_size": "200mb",
"translog.flush_threshold_period": "30m",
"translog.disable_flush": {
"__one_of": [
true,
false
]
},
"cache.filter.max_size": "2gb",
"cache.filter.expire": "2h",
"gateway.snapshot_interval": "10s",
"routing": {
"allocation": {
"include": {
"tag": ""
},
"exclude": {
"tag": ""
},
"require": {
"tag": ""
},
"total_shards_per_node": -1
}
},
"recovery.initial_shards": {
"__one_of": [
"quorum",
"quorum-1",
"half",
"full",
"full-1"
]
},
"ttl.disable_purge": {
"__one_of": [
true,
false
]
},
"analysis": {
"analyzer": {},
"tokenizer": {},
"filter": {},
"char_filter": {}
},
"cache.query.enable": {
"__one_of": [
true,
false
]
},
"shadow_replicas": {
"__one_of": [
true,
false
]
},
"shared_filesystem": {
"__one_of": [
true,
false
]
},
"data_path": "path",
"codec": {
"__one_of": [
"default",
"best_compression",
"lucene_default"
]
}
"__scope_link": "put_settings"
}
}
}

0 comments on commit f73fa4e

Please sign in to comment.