diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchconfig._constructor_.md b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig._constructor_.md
new file mode 100644
index 0000000000000..55e5cf74fc512
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig._constructor_.md
@@ -0,0 +1,20 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) > [(constructor)](./kibana-plugin-server.elasticsearchconfig._constructor_.md)
+
+## ElasticsearchConfig.(constructor)
+
+Constructs a new instance of the `ElasticsearchConfig` class
+
+Signature:
+
+```typescript
+constructor(rawConfig: ElasticsearchConfigType);
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| rawConfig | ElasticsearchConfigType | |
+
diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.apiversion.md b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.apiversion.md
new file mode 100644
index 0000000000000..097654f1fb090
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.apiversion.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) > [apiVersion](./kibana-plugin-server.elasticsearchconfig.apiversion.md)
+
+## ElasticsearchConfig.apiVersion property
+
+Version of the Elasticsearch (6.7, 7.1 or `master`) client will be connecting to.
+
+Signature:
+
+```typescript
+readonly apiVersion: string;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.customheaders.md b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.customheaders.md
new file mode 100644
index 0000000000000..0b3998e59c5df
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.customheaders.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) > [customHeaders](./kibana-plugin-server.elasticsearchconfig.customheaders.md)
+
+## ElasticsearchConfig.customHeaders property
+
+Header names and values to send to Elasticsearch with every request. These headers cannot be overwritten by client-side headers and aren't affected by `requestHeadersWhitelist` configuration.
+
+Signature:
+
+```typescript
+readonly customHeaders: ElasticsearchConfigType['customHeaders'];
+```
diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.healthcheckdelay.md b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.healthcheckdelay.md
new file mode 100644
index 0000000000000..b5589727d80aa
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.healthcheckdelay.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) > [healthCheckDelay](./kibana-plugin-server.elasticsearchconfig.healthcheckdelay.md)
+
+## ElasticsearchConfig.healthCheckDelay property
+
+The interval between health check requests Kibana sends to the Elasticsearch.
+
+Signature:
+
+```typescript
+readonly healthCheckDelay: Duration;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.hosts.md b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.hosts.md
new file mode 100644
index 0000000000000..29770ba5e0795
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.hosts.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) > [hosts](./kibana-plugin-server.elasticsearchconfig.hosts.md)
+
+## ElasticsearchConfig.hosts property
+
+Hosts that the client will connect to. If sniffing is enabled, this list will be used as seeds to discover the rest of your cluster.
+
+Signature:
+
+```typescript
+readonly hosts: string[];
+```
diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.ignoreversionmismatch.md b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.ignoreversionmismatch.md
new file mode 100644
index 0000000000000..42e32f920c1db
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.ignoreversionmismatch.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) > [ignoreVersionMismatch](./kibana-plugin-server.elasticsearchconfig.ignoreversionmismatch.md)
+
+## ElasticsearchConfig.ignoreVersionMismatch property
+
+Whether to allow kibana to connect to a non-compatible elasticsearch node.
+
+Signature:
+
+```typescript
+readonly ignoreVersionMismatch: boolean;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.logqueries.md b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.logqueries.md
new file mode 100644
index 0000000000000..64de7f6504450
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.logqueries.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) > [logQueries](./kibana-plugin-server.elasticsearchconfig.logqueries.md)
+
+## ElasticsearchConfig.logQueries property
+
+Specifies whether all queries to the client should be logged (status code, method, query etc.).
+
+Signature:
+
+```typescript
+readonly logQueries: boolean;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.md b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.md
new file mode 100644
index 0000000000000..e478dc7b966a2
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.md
@@ -0,0 +1,41 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md)
+
+## ElasticsearchConfig class
+
+Wrapper of config schema.
+
+Signature:
+
+```typescript
+export declare class ElasticsearchConfig
+```
+
+## Constructors
+
+| Constructor | Modifiers | Description |
+| --- | --- | --- |
+| [(constructor)(rawConfig)](./kibana-plugin-server.elasticsearchconfig._constructor_.md) | | Constructs a new instance of the ElasticsearchConfig class |
+
+## Properties
+
+| Property | Modifiers | Type | Description |
+| --- | --- | --- | --- |
+| [apiVersion](./kibana-plugin-server.elasticsearchconfig.apiversion.md) | | string | Version of the Elasticsearch (6.7, 7.1 or master) client will be connecting to. |
+| [customHeaders](./kibana-plugin-server.elasticsearchconfig.customheaders.md) | | ElasticsearchConfigType['customHeaders'] | Header names and values to send to Elasticsearch with every request. These headers cannot be overwritten by client-side headers and aren't affected by requestHeadersWhitelist configuration. |
+| [healthCheckDelay](./kibana-plugin-server.elasticsearchconfig.healthcheckdelay.md) | | Duration | The interval between health check requests Kibana sends to the Elasticsearch. |
+| [hosts](./kibana-plugin-server.elasticsearchconfig.hosts.md) | | string[] | Hosts that the client will connect to. If sniffing is enabled, this list will be used as seeds to discover the rest of your cluster. |
+| [ignoreVersionMismatch](./kibana-plugin-server.elasticsearchconfig.ignoreversionmismatch.md) | | boolean | Whether to allow kibana to connect to a non-compatible elasticsearch node. |
+| [logQueries](./kibana-plugin-server.elasticsearchconfig.logqueries.md) | | boolean | Specifies whether all queries to the client should be logged (status code, method, query etc.). |
+| [password](./kibana-plugin-server.elasticsearchconfig.password.md) | | string | If Elasticsearch is protected with basic authentication, this setting provides the password that the Kibana server uses to perform its administrative functions. |
+| [pingTimeout](./kibana-plugin-server.elasticsearchconfig.pingtimeout.md) | | Duration | Timeout after which PING HTTP request will be aborted and retried. |
+| [requestHeadersWhitelist](./kibana-plugin-server.elasticsearchconfig.requestheaderswhitelist.md) | | string[] | List of Kibana client-side headers to send to Elasticsearch when request scoped cluster client is used. If this is an empty array then \*no\* client-side will be sent. |
+| [requestTimeout](./kibana-plugin-server.elasticsearchconfig.requesttimeout.md) | | Duration | Timeout after which HTTP request will be aborted and retried. |
+| [shardTimeout](./kibana-plugin-server.elasticsearchconfig.shardtimeout.md) | | Duration | Timeout for Elasticsearch to wait for responses from shards. Set to 0 to disable. |
+| [sniffInterval](./kibana-plugin-server.elasticsearchconfig.sniffinterval.md) | | false | Duration | Interval to perform a sniff operation and make sure the list of nodes is complete. If false then sniffing is disabled. |
+| [sniffOnConnectionFault](./kibana-plugin-server.elasticsearchconfig.sniffonconnectionfault.md) | | boolean | Specifies whether the client should immediately sniff for a more current list of nodes when a connection dies. |
+| [sniffOnStart](./kibana-plugin-server.elasticsearchconfig.sniffonstart.md) | | boolean | Specifies whether the client should attempt to detect the rest of the cluster when it is first instantiated. |
+| [ssl](./kibana-plugin-server.elasticsearchconfig.ssl.md) | | Pick<SslConfigSchema, Exclude<keyof SslConfigSchema, 'certificateAuthorities' | 'keystore' | 'truststore'>> & {
certificateAuthorities?: string[];
} | Set of settings configure SSL connection between Kibana and Elasticsearch that are required when xpack.ssl.verification_mode in Elasticsearch is set to either certificate or full. |
+| [username](./kibana-plugin-server.elasticsearchconfig.username.md) | | string | If Elasticsearch is protected with basic authentication, this setting provides the username that the Kibana server uses to perform its administrative functions. |
+
diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.password.md b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.password.md
new file mode 100644
index 0000000000000..ffe6f75e9874d
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.password.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) > [password](./kibana-plugin-server.elasticsearchconfig.password.md)
+
+## ElasticsearchConfig.password property
+
+If Elasticsearch is protected with basic authentication, this setting provides the password that the Kibana server uses to perform its administrative functions.
+
+Signature:
+
+```typescript
+readonly password?: string;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.pingtimeout.md b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.pingtimeout.md
new file mode 100644
index 0000000000000..09123f0969b60
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.pingtimeout.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) > [pingTimeout](./kibana-plugin-server.elasticsearchconfig.pingtimeout.md)
+
+## ElasticsearchConfig.pingTimeout property
+
+Timeout after which PING HTTP request will be aborted and retried.
+
+Signature:
+
+```typescript
+readonly pingTimeout: Duration;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.requestheaderswhitelist.md b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.requestheaderswhitelist.md
new file mode 100644
index 0000000000000..eeced56e3103f
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.requestheaderswhitelist.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) > [requestHeadersWhitelist](./kibana-plugin-server.elasticsearchconfig.requestheaderswhitelist.md)
+
+## ElasticsearchConfig.requestHeadersWhitelist property
+
+List of Kibana client-side headers to send to Elasticsearch when request scoped cluster client is used. If this is an empty array then \*no\* client-side will be sent.
+
+Signature:
+
+```typescript
+readonly requestHeadersWhitelist: string[];
+```
diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.requesttimeout.md b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.requesttimeout.md
new file mode 100644
index 0000000000000..dbd5ecb939673
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.requesttimeout.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) > [requestTimeout](./kibana-plugin-server.elasticsearchconfig.requesttimeout.md)
+
+## ElasticsearchConfig.requestTimeout property
+
+Timeout after which HTTP request will be aborted and retried.
+
+Signature:
+
+```typescript
+readonly requestTimeout: Duration;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.shardtimeout.md b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.shardtimeout.md
new file mode 100644
index 0000000000000..aa923042bf64f
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.shardtimeout.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) > [shardTimeout](./kibana-plugin-server.elasticsearchconfig.shardtimeout.md)
+
+## ElasticsearchConfig.shardTimeout property
+
+Timeout for Elasticsearch to wait for responses from shards. Set to 0 to disable.
+
+Signature:
+
+```typescript
+readonly shardTimeout: Duration;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.sniffinterval.md b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.sniffinterval.md
new file mode 100644
index 0000000000000..37fd2a7439535
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.sniffinterval.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) > [sniffInterval](./kibana-plugin-server.elasticsearchconfig.sniffinterval.md)
+
+## ElasticsearchConfig.sniffInterval property
+
+Interval to perform a sniff operation and make sure the list of nodes is complete. If `false` then sniffing is disabled.
+
+Signature:
+
+```typescript
+readonly sniffInterval: false | Duration;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.sniffonconnectionfault.md b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.sniffonconnectionfault.md
new file mode 100644
index 0000000000000..c703be548d34b
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.sniffonconnectionfault.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) > [sniffOnConnectionFault](./kibana-plugin-server.elasticsearchconfig.sniffonconnectionfault.md)
+
+## ElasticsearchConfig.sniffOnConnectionFault property
+
+Specifies whether the client should immediately sniff for a more current list of nodes when a connection dies.
+
+Signature:
+
+```typescript
+readonly sniffOnConnectionFault: boolean;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.sniffonstart.md b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.sniffonstart.md
new file mode 100644
index 0000000000000..26a7d9cc11a80
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.sniffonstart.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) > [sniffOnStart](./kibana-plugin-server.elasticsearchconfig.sniffonstart.md)
+
+## ElasticsearchConfig.sniffOnStart property
+
+Specifies whether the client should attempt to detect the rest of the cluster when it is first instantiated.
+
+Signature:
+
+```typescript
+readonly sniffOnStart: boolean;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.ssl.md b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.ssl.md
new file mode 100644
index 0000000000000..4d23c410f59fa
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.ssl.md
@@ -0,0 +1,15 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) > [ssl](./kibana-plugin-server.elasticsearchconfig.ssl.md)
+
+## ElasticsearchConfig.ssl property
+
+Set of settings configure SSL connection between Kibana and Elasticsearch that are required when `xpack.ssl.verification_mode` in Elasticsearch is set to either `certificate` or `full`.
+
+Signature:
+
+```typescript
+readonly ssl: Pick> & {
+ certificateAuthorities?: string[];
+ };
+```
diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.username.md b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.username.md
new file mode 100644
index 0000000000000..d0098d656befb
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.elasticsearchconfig.username.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) > [username](./kibana-plugin-server.elasticsearchconfig.username.md)
+
+## ElasticsearchConfig.username property
+
+If Elasticsearch is protected with basic authentication, this setting provides the username that the Kibana server uses to perform its administrative functions.
+
+Signature:
+
+```typescript
+readonly username?: string;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.md b/docs/development/core/server/kibana-plugin-server.md
index 482f014b226b9..9ec443d6482e8 100644
--- a/docs/development/core/server/kibana-plugin-server.md
+++ b/docs/development/core/server/kibana-plugin-server.md
@@ -19,6 +19,7 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [BasePath](./kibana-plugin-server.basepath.md) | Access or manipulate the Kibana base path |
| [ClusterClient](./kibana-plugin-server.clusterclient.md) | Represents an Elasticsearch cluster API client created by the platform. It allows to call API on behalf of the internal Kibana user and the actual user that is derived from the request headers (via asScoped(...)).See [ClusterClient](./kibana-plugin-server.clusterclient.md). |
| [CspConfig](./kibana-plugin-server.cspconfig.md) | CSP configuration for use in Kibana. |
+| [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) | Wrapper of config schema. |
| [ElasticsearchErrorHelpers](./kibana-plugin-server.elasticsearcherrorhelpers.md) | Helpers for working with errors returned from the Elasticsearch service.Since the internal data of errors are subject to change, consumers of the Elasticsearch service should always use these helpers to classify errors instead of checking error internals such as body.error.header[WWW-Authenticate] |
| [KibanaRequest](./kibana-plugin-server.kibanarequest.md) | Kibana specific abstraction for an incoming request. |
| [RouteValidationError](./kibana-plugin-server.routevalidationerror.md) | Error to return when the validation is not successful. |
diff --git a/src/core/server/elasticsearch/elasticsearch_config.ts b/src/core/server/elasticsearch/elasticsearch_config.ts
index 2f4160ad75e9d..df31f51361c19 100644
--- a/src/core/server/elasticsearch/elasticsearch_config.ts
+++ b/src/core/server/elasticsearch/elasticsearch_config.ts
@@ -31,7 +31,12 @@ export const DEFAULT_API_VERSION = '7.x';
export type ElasticsearchConfigType = TypeOf;
type SslConfigSchema = ElasticsearchConfigType['ssl'];
-const configSchema = schema.object({
+/**
+ * Validation schema for elasticsearch service config. It can be reused when plugins allow users
+ * to specify a local elasticsearch config.
+ * @public
+ */
+export const configSchema = schema.object({
sniffOnStart: schema.boolean({ defaultValue: false }),
sniffInterval: schema.oneOf([schema.duration(), schema.literal(false)], {
defaultValue: false,
@@ -148,6 +153,10 @@ export const config: ServiceConfigDescriptor = {
deprecations,
};
+/**
+ * Wrapper of config schema.
+ * @public
+ */
export class ElasticsearchConfig {
/**
* The interval between health check requests Kibana sends to the Elasticsearch.
diff --git a/src/core/server/elasticsearch/index.ts b/src/core/server/elasticsearch/index.ts
index 5d64fadfaa184..cfd72a6fd5e47 100644
--- a/src/core/server/elasticsearch/index.ts
+++ b/src/core/server/elasticsearch/index.ts
@@ -27,7 +27,7 @@ export {
} from './cluster_client';
export { IScopedClusterClient, ScopedClusterClient, Headers } from './scoped_cluster_client';
export { ElasticsearchClientConfig } from './elasticsearch_client_config';
-export { config } from './elasticsearch_config';
+export { config, configSchema, ElasticsearchConfig } from './elasticsearch_config';
export { ElasticsearchError, ElasticsearchErrorHelpers } from './errors';
export * from './api_types';
export * from './types';
diff --git a/src/core/server/index.ts b/src/core/server/index.ts
index cc838ddd1351d..52827b72ee0cc 100644
--- a/src/core/server/index.ts
+++ b/src/core/server/index.ts
@@ -39,7 +39,12 @@
* @packageDocumentation
*/
-import { ElasticsearchServiceSetup, IScopedClusterClient } from './elasticsearch';
+import {
+ ElasticsearchServiceSetup,
+ IScopedClusterClient,
+ configSchema as elasticsearchConfigSchema,
+} from './elasticsearch';
+
import { HttpServiceSetup } from './http';
import { IScopedRenderingClient } from './rendering';
import { PluginsServiceSetup, PluginsServiceStart, PluginOpaqueId } from './plugins';
@@ -78,6 +83,7 @@ export {
Headers,
ScopedClusterClient,
IScopedClusterClient,
+ ElasticsearchConfig,
ElasticsearchClientConfig,
ElasticsearchError,
ElasticsearchErrorHelpers,
@@ -347,3 +353,14 @@ export {
PluginOpaqueId,
UuidServiceSetup,
};
+
+/**
+ * Config schemas for the platform services.
+ *
+ * @alpha
+ */
+export const config = {
+ elasticsearch: {
+ schema: elasticsearchConfigSchema,
+ },
+};
diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md
index ad1907df571fb..053a60028fc5f 100644
--- a/src/core/server/server.api.md
+++ b/src/core/server/server.api.md
@@ -503,6 +503,49 @@ export class ClusterClient implements IClusterClient {
close(): void;
}
+// @alpha
+export const config: {
+ elasticsearch: {
+ schema: import("@kbn/config-schema").ObjectType<{
+ sniffOnStart: import("@kbn/config-schema").Type;
+ sniffInterval: import("@kbn/config-schema").Type;
+ sniffOnConnectionFault: import("@kbn/config-schema").Type;
+ hosts: import("@kbn/config-schema").Type;
+ preserveHost: import("@kbn/config-schema").Type;
+ username: import("@kbn/config-schema").Type;
+ password: import("@kbn/config-schema").Type;
+ requestHeadersWhitelist: import("@kbn/config-schema").Type;
+ customHeaders: import("@kbn/config-schema").Type>;
+ shardTimeout: import("@kbn/config-schema").Type;
+ requestTimeout: import("@kbn/config-schema").Type;
+ pingTimeout: import("@kbn/config-schema").Type;
+ startupTimeout: import("@kbn/config-schema").Type;
+ logQueries: import("@kbn/config-schema").Type;
+ ssl: import("@kbn/config-schema").ObjectType<{
+ verificationMode: import("@kbn/config-schema").Type<"none" | "full" | "certificate">;
+ certificateAuthorities: import("@kbn/config-schema").Type;
+ certificate: import("@kbn/config-schema").Type;
+ key: import("@kbn/config-schema").Type;
+ keyPassphrase: import("@kbn/config-schema").Type;
+ keystore: import("@kbn/config-schema").ObjectType<{
+ path: import("@kbn/config-schema").Type;
+ password: import("@kbn/config-schema").Type;
+ }>;
+ truststore: import("@kbn/config-schema").ObjectType<{
+ path: import("@kbn/config-schema").Type;
+ password: import("@kbn/config-schema").Type;
+ }>;
+ alwaysPresentCertificate: import("@kbn/config-schema").Type;
+ }>;
+ apiVersion: import("@kbn/config-schema").Type;
+ healthCheck: import("@kbn/config-schema").ObjectType<{
+ delay: import("@kbn/config-schema").Type;
+ }>;
+ ignoreVersionMismatch: import("@kbn/config-schema/target/types/types").ConditionalType;
+ }>;
+ };
+};
+
// @public
export type ConfigDeprecation = (config: Record, fromPath: string, logger: ConfigDeprecationLogger) => Record;
@@ -650,8 +693,6 @@ export interface DiscoveredPlugin {
readonly requiredPlugins: readonly PluginName[];
}
-// Warning: (ae-forgotten-export) The symbol "ElasticsearchConfig" needs to be exported by the entry point index.d.ts
-//
// @public (undocumented)
export type ElasticsearchClientConfig = Pick & Pick & {
pingTimeout?: ElasticsearchConfig['pingTimeout'] | ConfigOptions['pingTimeout'];
@@ -660,6 +701,31 @@ export type ElasticsearchClientConfig = Pick;
};
+// @public
+export class ElasticsearchConfig {
+ constructor(rawConfig: ElasticsearchConfigType);
+ readonly apiVersion: string;
+ // Warning: (ae-forgotten-export) The symbol "ElasticsearchConfigType" needs to be exported by the entry point index.d.ts
+ readonly customHeaders: ElasticsearchConfigType['customHeaders'];
+ readonly healthCheckDelay: Duration;
+ readonly hosts: string[];
+ readonly ignoreVersionMismatch: boolean;
+ readonly logQueries: boolean;
+ readonly password?: string;
+ readonly pingTimeout: Duration;
+ readonly requestHeadersWhitelist: string[];
+ readonly requestTimeout: Duration;
+ readonly shardTimeout: Duration;
+ readonly sniffInterval: false | Duration;
+ readonly sniffOnConnectionFault: boolean;
+ readonly sniffOnStart: boolean;
+ // Warning: (ae-forgotten-export) The symbol "SslConfigSchema" needs to be exported by the entry point index.d.ts
+ readonly ssl: Pick> & {
+ certificateAuthorities?: string[];
+ };
+ readonly username?: string;
+}
+
// @public (undocumented)
export interface ElasticsearchError extends Boom {
// (undocumented)
@@ -2133,7 +2199,6 @@ export const validBodyOutput: readonly ["data", "stream"];
// src/core/server/plugins/plugins_service.ts:44:5 - (ae-forgotten-export) The symbol "InternalPluginInfo" needs to be exported by the entry point index.d.ts
// src/core/server/plugins/types.ts:226:3 - (ae-forgotten-export) The symbol "KibanaConfigType" needs to be exported by the entry point index.d.ts
// src/core/server/plugins/types.ts:226:3 - (ae-forgotten-export) The symbol "SharedGlobalConfigKeys" needs to be exported by the entry point index.d.ts
-// src/core/server/plugins/types.ts:227:3 - (ae-forgotten-export) The symbol "ElasticsearchConfigType" needs to be exported by the entry point index.d.ts
// src/core/server/plugins/types.ts:228:3 - (ae-forgotten-export) The symbol "PathConfigType" needs to be exported by the entry point index.d.ts
```