mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[ftr/services/es] use apiVersion from es plugin (#30733)
This commit is contained in:
parent
139b0d512d
commit
f87b767265
3 changed files with 25 additions and 1 deletions
|
@ -24,6 +24,7 @@ import { clientLogger } from './lib/client_logger';
|
|||
import { createClusters } from './lib/create_clusters';
|
||||
import { createProxy } from './lib/create_proxy';
|
||||
import filterHeaders from './lib/filter_headers';
|
||||
import { DEFAULT_API_VERSION } from './lib/default_api_version';
|
||||
|
||||
const DEFAULT_REQUEST_HEADERS = ['authorization'];
|
||||
|
||||
|
@ -57,7 +58,7 @@ export default function (kibana) {
|
|||
startupTimeout: Joi.number().default(5000),
|
||||
logQueries: Joi.boolean().default(false),
|
||||
ssl: sslSchema,
|
||||
apiVersion: Joi.string().default('master'),
|
||||
apiVersion: Joi.string().default(DEFAULT_API_VERSION),
|
||||
healthCheck: Joi.object({
|
||||
delay: Joi.number().default(2500)
|
||||
}).default(),
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* 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 DEFAULT_API_VERSION = 'master';
|
|
@ -21,10 +21,13 @@ import { format as formatUrl } from 'url';
|
|||
|
||||
import elasticsearch from 'elasticsearch';
|
||||
|
||||
import { DEFAULT_API_VERSION } from '../../../src/legacy/core_plugins/elasticsearch/lib/default_api_version';
|
||||
|
||||
export function EsProvider({ getService }) {
|
||||
const config = getService('config');
|
||||
|
||||
return new elasticsearch.Client({
|
||||
apiVersion: DEFAULT_API_VERSION,
|
||||
host: formatUrl(config.get('servers.elasticsearch')),
|
||||
requestTimeout: config.get('timeouts.esRequestTimeout'),
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue