Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [(constructor)](./kibana-plugin-server.elasticsearchconfig._constructor_.md)

## ElasticsearchConfig.(constructor)

Constructs a new instance of the `ElasticsearchConfig` class

<b>Signature:</b>

```typescript
constructor(rawConfig: ElasticsearchConfigType);
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| rawConfig | <code>ElasticsearchConfigType</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [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.

<b>Signature:</b>

```typescript
readonly apiVersion: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [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.

<b>Signature:</b>

```typescript
readonly customHeaders: ElasticsearchConfigType['customHeaders'];
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [healthCheckDelay](./kibana-plugin-server.elasticsearchconfig.healthcheckdelay.md)

## ElasticsearchConfig.healthCheckDelay property

The interval between health check requests Kibana sends to the Elasticsearch.

<b>Signature:</b>

```typescript
readonly healthCheckDelay: Duration;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [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.

<b>Signature:</b>

```typescript
readonly hosts: string[];
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [ignoreVersionMismatch](./kibana-plugin-server.elasticsearchconfig.ignoreversionmismatch.md)

## ElasticsearchConfig.ignoreVersionMismatch property

Whether to allow kibana to connect to a non-compatible elasticsearch node.

<b>Signature:</b>

```typescript
readonly ignoreVersionMismatch: boolean;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [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.).

<b>Signature:</b>

```typescript
readonly logQueries: boolean;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md)

## ElasticsearchConfig class

Wrapper of config schema.

<b>Signature:</b>

```typescript
export declare class ElasticsearchConfig
```

## Constructors

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(rawConfig)](./kibana-plugin-server.elasticsearchconfig._constructor_.md) | | Constructs a new instance of the <code>ElasticsearchConfig</code> class |

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [apiVersion](./kibana-plugin-server.elasticsearchconfig.apiversion.md) | | <code>string</code> | Version of the Elasticsearch (6.7, 7.1 or <code>master</code>) client will be connecting to. |
| [customHeaders](./kibana-plugin-server.elasticsearchconfig.customheaders.md) | | <code>ElasticsearchConfigType['customHeaders']</code> | 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 <code>requestHeadersWhitelist</code> configuration. |
| [healthCheckDelay](./kibana-plugin-server.elasticsearchconfig.healthcheckdelay.md) | | <code>Duration</code> | The interval between health check requests Kibana sends to the Elasticsearch. |
| [hosts](./kibana-plugin-server.elasticsearchconfig.hosts.md) | | <code>string[]</code> | 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) | | <code>boolean</code> | Whether to allow kibana to connect to a non-compatible elasticsearch node. |
| [logQueries](./kibana-plugin-server.elasticsearchconfig.logqueries.md) | | <code>boolean</code> | Specifies whether all queries to the client should be logged (status code, method, query etc.). |
| [password](./kibana-plugin-server.elasticsearchconfig.password.md) | | <code>string</code> | 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) | | <code>Duration</code> | Timeout after which PING HTTP request will be aborted and retried. |
| [requestHeadersWhitelist](./kibana-plugin-server.elasticsearchconfig.requestheaderswhitelist.md) | | <code>string[]</code> | 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) | | <code>Duration</code> | Timeout after which HTTP request will be aborted and retried. |
| [shardTimeout](./kibana-plugin-server.elasticsearchconfig.shardtimeout.md) | | <code>Duration</code> | Timeout for Elasticsearch to wait for responses from shards. Set to 0 to disable. |
| [sniffInterval](./kibana-plugin-server.elasticsearchconfig.sniffinterval.md) | | <code>false &#124; Duration</code> | Interval to perform a sniff operation and make sure the list of nodes is complete. If <code>false</code> then sniffing is disabled. |
| [sniffOnConnectionFault](./kibana-plugin-server.elasticsearchconfig.sniffonconnectionfault.md) | | <code>boolean</code> | 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) | | <code>boolean</code> | 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) | | <code>Pick&lt;SslConfigSchema, Exclude&lt;keyof SslConfigSchema, 'certificateAuthorities' &#124; 'keystore' &#124; 'truststore'&gt;&gt; &amp; {</code><br/><code> certificateAuthorities?: string[];</code><br/><code> }</code> | Set of settings configure SSL connection between Kibana and Elasticsearch that are required when <code>xpack.ssl.verification_mode</code> in Elasticsearch is set to either <code>certificate</code> or <code>full</code>. |
| [username](./kibana-plugin-server.elasticsearchconfig.username.md) | | <code>string</code> | If Elasticsearch is protected with basic authentication, this setting provides the username that the Kibana server uses to perform its administrative functions. |

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [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.

<b>Signature:</b>

```typescript
readonly password?: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [pingTimeout](./kibana-plugin-server.elasticsearchconfig.pingtimeout.md)

## ElasticsearchConfig.pingTimeout property

Timeout after which PING HTTP request will be aborted and retried.

<b>Signature:</b>

```typescript
readonly pingTimeout: Duration;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [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.

<b>Signature:</b>

```typescript
readonly requestHeadersWhitelist: string[];
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [requestTimeout](./kibana-plugin-server.elasticsearchconfig.requesttimeout.md)

## ElasticsearchConfig.requestTimeout property

Timeout after which HTTP request will be aborted and retried.

<b>Signature:</b>

```typescript
readonly requestTimeout: Duration;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [shardTimeout](./kibana-plugin-server.elasticsearchconfig.shardtimeout.md)

## ElasticsearchConfig.shardTimeout property

Timeout for Elasticsearch to wait for responses from shards. Set to 0 to disable.

<b>Signature:</b>

```typescript
readonly shardTimeout: Duration;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [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.

<b>Signature:</b>

```typescript
readonly sniffInterval: false | Duration;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [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.

<b>Signature:</b>

```typescript
readonly sniffOnConnectionFault: boolean;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [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.

<b>Signature:</b>

```typescript
readonly sniffOnStart: boolean;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [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`<!-- -->.

<b>Signature:</b>

```typescript
readonly ssl: Pick<SslConfigSchema, Exclude<keyof SslConfigSchema, 'certificateAuthorities' | 'keystore' | 'truststore'>> & {
certificateAuthorities?: string[];
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [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.

<b>Signature:</b>

```typescript
readonly username?: string;
```
1 change: 1 addition & 0 deletions docs/development/core/server/kibana-plugin-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <code>asScoped(...)</code>).<!-- -->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 <code>body.error.header[WWW-Authenticate]</code> |
| [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. |
Expand Down
11 changes: 10 additions & 1 deletion src/core/server/elasticsearch/elasticsearch_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ export const DEFAULT_API_VERSION = '7.x';
export type ElasticsearchConfigType = TypeOf<typeof configSchema>;
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,
Expand Down Expand Up @@ -148,6 +153,10 @@ export const config: ServiceConfigDescriptor<ElasticsearchConfigType> = {
deprecations,
};

/**
* Wrapper of config schema.
* @public
*/
export class ElasticsearchConfig {
/**
* The interval between health check requests Kibana sends to the Elasticsearch.
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/elasticsearch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
19 changes: 18 additions & 1 deletion src/core/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -78,6 +83,7 @@ export {
Headers,
ScopedClusterClient,
IScopedClusterClient,
ElasticsearchConfig,
ElasticsearchClientConfig,
ElasticsearchError,
ElasticsearchErrorHelpers,
Expand Down Expand Up @@ -347,3 +353,14 @@ export {
PluginOpaqueId,
UuidServiceSetup,
};

/**
* Config schemas for the platform services.
*
* @alpha
*/
export const config = {
elasticsearch: {
schema: elasticsearchConfigSchema,
},
};
Loading