Skip to content

Commit

Permalink
Implement preboot lifecycle stage.
Browse files Browse the repository at this point in the history
  • Loading branch information
azasypkin committed Jul 9, 2021
1 parent 1d2811e commit 7962391
Show file tree
Hide file tree
Showing 147 changed files with 3,370 additions and 804 deletions.
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-core-server](./kibana-plugin-core-server.md) &gt; [CorePreboot](./kibana-plugin-core-server.corepreboot.md) &gt; [elasticsearch](./kibana-plugin-core-server.corepreboot.elasticsearch.md)

## CorePreboot.elasticsearch property

[ElasticsearchServicePreboot](./kibana-plugin-core-server.elasticsearchservicepreboot.md)

<b>Signature:</b>

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

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [CorePreboot](./kibana-plugin-core-server.corepreboot.md) &gt; [http](./kibana-plugin-core-server.corepreboot.http.md)

## CorePreboot.http property


<b>Signature:</b>

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

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [CorePreboot](./kibana-plugin-core-server.corepreboot.md)

## CorePreboot interface


<b>Signature:</b>

```typescript
export interface CorePreboot
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [elasticsearch](./kibana-plugin-core-server.corepreboot.elasticsearch.md) | <code>ElasticsearchServicePreboot</code> | [ElasticsearchServicePreboot](./kibana-plugin-core-server.elasticsearchservicepreboot.md) |
| [http](./kibana-plugin-core-server.corepreboot.http.md) | <code>HttpServicePreboot</code> | |
| [preboot](./kibana-plugin-core-server.corepreboot.preboot.md) | <code>PrebootServicePreboot</code> | |

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

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [CorePreboot](./kibana-plugin-core-server.corepreboot.md) &gt; [preboot](./kibana-plugin-core-server.corepreboot.preboot.md)

## CorePreboot.preboot property


<b>Signature:</b>

```typescript
preboot: PrebootServicePreboot;
```
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ export interface DiscoveredPlugin
| [optionalPlugins](./kibana-plugin-core-server.discoveredplugin.optionalplugins.md) | <code>readonly PluginName[]</code> | An optional list of the other plugins that if installed and enabled \*\*may be\*\* leveraged by this plugin for some additional functionality but otherwise are not required for this plugin to work properly. |
| [requiredBundles](./kibana-plugin-core-server.discoveredplugin.requiredbundles.md) | <code>readonly PluginName[]</code> | List of plugin ids that this plugin's UI code imports modules from that are not in <code>requiredPlugins</code>. |
| [requiredPlugins](./kibana-plugin-core-server.discoveredplugin.requiredplugins.md) | <code>readonly PluginName[]</code> | An optional list of the other plugins that \*\*must be\*\* installed and enabled for this plugin to function properly. |
| [type](./kibana-plugin-core-server.discoveredplugin.type.md) | <code>PluginType</code> | Type of the plugin, defaults to <code>standard</code>. Plugins with the <code>preboot</code> type are only initialized and function at the preboot stage. |

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-core-server](./kibana-plugin-core-server.md) &gt; [DiscoveredPlugin](./kibana-plugin-core-server.discoveredplugin.md) &gt; [type](./kibana-plugin-core-server.discoveredplugin.type.md)

## DiscoveredPlugin.type property

Type of the plugin, defaults to `standard`<!-- -->. Plugins with the `preboot` type are only initialized and function at the preboot stage.

<b>Signature:</b>

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

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [ElasticsearchServicePreboot](./kibana-plugin-core-server.elasticsearchservicepreboot.md) &gt; [config](./kibana-plugin-core-server.elasticsearchservicepreboot.config.md)

## ElasticsearchServicePreboot.config property

Default Elasticsearch config.

<b>Signature:</b>

```typescript
readonly config: ElasticsearchConfig;
```

## Example


```js
const defaultConfig = core.elasticsearch.config;

```

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

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [ElasticsearchServicePreboot](./kibana-plugin-core-server.elasticsearchservicepreboot.md) &gt; [createClient](./kibana-plugin-core-server.elasticsearchservicepreboot.createclient.md)

## ElasticsearchServicePreboot.createClient property

Create application specific Elasticsearch cluster API client with customized config. See [IClusterClient](./kibana-plugin-core-server.iclusterclient.md)<!-- -->.

<b>Signature:</b>

```typescript
readonly createClient: (type: string, clientConfig?: Partial<ElasticsearchClientConfig>) => ICustomClusterClient;
```

## Example


```js
const client = elasticsearch.createClient('my-app-name', config);
const data = await client.asInternalUser.search();

```

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-core-server](./kibana-plugin-core-server.md) &gt; [ElasticsearchServicePreboot](./kibana-plugin-core-server.elasticsearchservicepreboot.md)

## ElasticsearchServicePreboot interface


<b>Signature:</b>

```typescript
export interface ElasticsearchServicePreboot
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [config](./kibana-plugin-core-server.elasticsearchservicepreboot.config.md) | <code>ElasticsearchConfig</code> | Default Elasticsearch config. |
| [createClient](./kibana-plugin-core-server.elasticsearchservicepreboot.createclient.md) | <code>(type: string, clientConfig?: Partial&lt;ElasticsearchClientConfig&gt;) =&gt; ICustomClusterClient</code> | Create application specific Elasticsearch cluster API client with customized config. See [IClusterClient](./kibana-plugin-core-server.iclusterclient.md)<!-- -->. |

4 changes: 4 additions & 0 deletions docs/development/core/server/kibana-plugin-core-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| --- | --- |
| [AuthResultType](./kibana-plugin-core-server.authresulttype.md) | |
| [AuthStatus](./kibana-plugin-core-server.authstatus.md) | Status indicating an outcome of the authentication. |
| [PluginType](./kibana-plugin-core-server.plugintype.md) | |

## Interfaces

Expand All @@ -60,6 +61,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [CapabilitiesSetup](./kibana-plugin-core-server.capabilitiessetup.md) | APIs to manage the [Capabilities](./kibana-plugin-core-server.capabilities.md) that will be used by the application.<!-- -->Plugins relying on capabilities to toggle some of their features should register them during the setup phase using the <code>registerProvider</code> method.<!-- -->Plugins having the responsibility to restrict capabilities depending on a given context should register their capabilities switcher using the <code>registerSwitcher</code> method.<!-- -->Refers to the methods documentation for complete description and examples. |
| [CapabilitiesStart](./kibana-plugin-core-server.capabilitiesstart.md) | APIs to access the application [Capabilities](./kibana-plugin-core-server.capabilities.md)<!-- -->. |
| [ContextSetup](./kibana-plugin-core-server.contextsetup.md) | An object that handles registration of context providers and configuring handlers with context. |
| [CorePreboot](./kibana-plugin-core-server.corepreboot.md) | |
| [CoreSetup](./kibana-plugin-core-server.coresetup.md) | Context passed to the plugins <code>setup</code> method. |
| [CoreStart](./kibana-plugin-core-server.corestart.md) | Context passed to the plugins <code>start</code> method. |
| [CoreStatus](./kibana-plugin-core-server.corestatus.md) | Status of core services. |
Expand All @@ -73,6 +75,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [DeprecationSettings](./kibana-plugin-core-server.deprecationsettings.md) | UiSettings deprecation field options. |
| [DeprecationsServiceSetup](./kibana-plugin-core-server.deprecationsservicesetup.md) | The deprecations service provides a way for the Kibana platform to communicate deprecated features and configs with its users. These deprecations are only communicated if the deployment is using these features. Allowing for a user tailored experience for upgrading the stack version.<!-- -->The Deprecation service is consumed by the upgrade assistant to assist with the upgrade experience.<!-- -->If a deprecated feature can be resolved without manual user intervention. Using correctiveActions.api allows the Upgrade Assistant to use this api to correct the deprecation upon a user trigger. |
| [DiscoveredPlugin](./kibana-plugin-core-server.discoveredplugin.md) | Small container object used to expose information about discovered plugins that may or may not have been started. |
| [ElasticsearchServicePreboot](./kibana-plugin-core-server.elasticsearchservicepreboot.md) | |
| [ElasticsearchServiceSetup](./kibana-plugin-core-server.elasticsearchservicesetup.md) | |
| [ElasticsearchServiceStart](./kibana-plugin-core-server.elasticsearchservicestart.md) | |
| [ElasticsearchStatusMeta](./kibana-plugin-core-server.elasticsearchstatusmeta.md) | |
Expand Down Expand Up @@ -132,6 +135,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [PluginConfigDescriptor](./kibana-plugin-core-server.pluginconfigdescriptor.md) | Describes a plugin configuration properties. |
| [PluginInitializerContext](./kibana-plugin-core-server.plugininitializercontext.md) | Context that's available to plugins during initialization stage. |
| [PluginManifest](./kibana-plugin-core-server.pluginmanifest.md) | Describes the set of required and optional properties plugin can define in its mandatory JSON manifest file. |
| [PrebootPlugin](./kibana-plugin-core-server.prebootplugin.md) | |
| [RegisterDeprecationsConfig](./kibana-plugin-core-server.registerdeprecationsconfig.md) | |
| [RequestHandlerContext](./kibana-plugin-core-server.requesthandlercontext.md) | Plugin specific context passed to a route handler.<!-- -->Provides the following clients and services: - [savedObjects.client](./kibana-plugin-core-server.savedobjectsclient.md) - Saved Objects client which uses the credentials of the incoming request - [savedObjects.typeRegistry](./kibana-plugin-core-server.isavedobjecttyperegistry.md) - Type registry containing all the registered types. - [elasticsearch.client](./kibana-plugin-core-server.iscopedclusterclient.md) - Elasticsearch data client which uses the credentials of the incoming request - [elasticsearch.legacy.client](./kibana-plugin-core-server.legacyscopedclusterclient.md) - The legacy Elasticsearch data client which uses the credentials of the incoming request - [uiSettings.client](./kibana-plugin-core-server.iuisettingsclient.md) - uiSettings client which uses the credentials of the incoming request |
| [ResolveCapabilitiesOptions](./kibana-plugin-core-server.resolvecapabilitiesoptions.md) | Defines a set of additional options for the <code>resolveCapabilities</code> method of [CapabilitiesStart](./kibana-plugin-core-server.capabilitiesstart.md)<!-- -->. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ The `plugin` export at the root of a plugin's `server` directory should conform
<b>Signature:</b>

```typescript
export declare type PluginInitializer<TSetup, TStart, TPluginsSetup extends object = object, TPluginsStart extends object = object> = (core: PluginInitializerContext) => Plugin<TSetup, TStart, TPluginsSetup, TPluginsStart> | AsyncPlugin<TSetup, TStart, TPluginsSetup, TPluginsStart>;
export declare type PluginInitializer<TSetup, TStart, TPluginsSetup extends object = object, TPluginsStart extends object = object> = (core: PluginInitializerContext) => Plugin<TSetup, TStart, TPluginsSetup, TPluginsStart> | PrebootPlugin<TSetup, TPluginsSetup> | AsyncPlugin<TSetup, TStart, TPluginsSetup, TPluginsStart>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ env: {
mode: EnvironmentMode;
packageInfo: Readonly<PackageInfo>;
instanceUuid: string;
configs: readonly string[];
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface PluginInitializerContext<ConfigSchema = unknown>
| Property | Type | Description |
| --- | --- | --- |
| [config](./kibana-plugin-core-server.plugininitializercontext.config.md) | <code>{</code><br/><code> legacy: {</code><br/><code> globalConfig$: Observable&lt;SharedGlobalConfig&gt;;</code><br/><code> get: () =&gt; SharedGlobalConfig;</code><br/><code> };</code><br/><code> create: &lt;T = ConfigSchema&gt;() =&gt; Observable&lt;T&gt;;</code><br/><code> get: &lt;T = ConfigSchema&gt;() =&gt; T;</code><br/><code> }</code> | Accessors for the plugin's configuration |
| [env](./kibana-plugin-core-server.plugininitializercontext.env.md) | <code>{</code><br/><code> mode: EnvironmentMode;</code><br/><code> packageInfo: Readonly&lt;PackageInfo&gt;;</code><br/><code> instanceUuid: string;</code><br/><code> }</code> | |
| [env](./kibana-plugin-core-server.plugininitializercontext.env.md) | <code>{</code><br/><code> mode: EnvironmentMode;</code><br/><code> packageInfo: Readonly&lt;PackageInfo&gt;;</code><br/><code> instanceUuid: string;</code><br/><code> configs: readonly string[];</code><br/><code> }</code> | |
| [logger](./kibana-plugin-core-server.plugininitializercontext.logger.md) | <code>LoggerFactory</code> | instance already bound to the plugin's logging context |
| [opaqueId](./kibana-plugin-core-server.plugininitializercontext.opaqueid.md) | <code>PluginOpaqueId</code> | |

Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Should never be used in code outside of Core but is exported for documentation p
| [requiredPlugins](./kibana-plugin-core-server.pluginmanifest.requiredplugins.md) | <code>readonly PluginName[]</code> | An optional list of the other plugins that \*\*must be\*\* installed and enabled for this plugin to function properly. |
| [server](./kibana-plugin-core-server.pluginmanifest.server.md) | <code>boolean</code> | Specifies whether plugin includes some server-side specific functionality. |
| [serviceFolders](./kibana-plugin-core-server.pluginmanifest.servicefolders.md) | <code>readonly string[]</code> | Only used for the automatically generated API documentation. Specifying service folders will cause your plugin API reference to be broken up into sub sections. |
| [type](./kibana-plugin-core-server.pluginmanifest.type.md) | <code>PluginType</code> | Type of the plugin, defaults to <code>standard</code>. Plugins with the <code>preboot</code> type are only initialized and function at the preboot stage. |
| [ui](./kibana-plugin-core-server.pluginmanifest.ui.md) | <code>boolean</code> | Specifies whether plugin includes some client/browser specific functionality that should be included into client bundle via <code>public/ui_plugin.js</code> file. |
| [version](./kibana-plugin-core-server.pluginmanifest.version.md) | <code>string</code> | Version of the plugin. |

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-core-server](./kibana-plugin-core-server.md) &gt; [PluginManifest](./kibana-plugin-core-server.pluginmanifest.md) &gt; [type](./kibana-plugin-core-server.pluginmanifest.type.md)

## PluginManifest.type property

Type of the plugin, defaults to `standard`<!-- -->. Plugins with the `preboot` type are only initialized and function at the preboot stage.

<b>Signature:</b>

```typescript
readonly type: PluginType;
```
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-core-server](./kibana-plugin-core-server.md) &gt; [PluginType](./kibana-plugin-core-server.plugintype.md)

## PluginType enum


<b>Signature:</b>

```typescript
export declare enum PluginType
```

## Enumeration Members

| Member | Value | Description |
| --- | --- | --- |
| preboot | <code>&quot;preboot&quot;</code> | |
| standard | <code>&quot;standard&quot;</code> | |

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

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [PrebootPlugin](./kibana-plugin-core-server.prebootplugin.md)

## PrebootPlugin interface

<b>Signature:</b>

```typescript
export interface PrebootPlugin<TSetup = void, TPluginsSetup extends object = object>
```

## Methods

| Method | Description |
| --- | --- |
| [setup(core, plugins)](./kibana-plugin-core-server.prebootplugin.setup.md) | |
| [stop()](./kibana-plugin-core-server.prebootplugin.stop.md) | |

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

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [PrebootPlugin](./kibana-plugin-core-server.prebootplugin.md) &gt; [setup](./kibana-plugin-core-server.prebootplugin.setup.md)

## PrebootPlugin.setup() method

<b>Signature:</b>

```typescript
setup(core: CorePreboot, plugins: TPluginsSetup): TSetup;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| core | <code>CorePreboot</code> | |
| plugins | <code>TPluginsSetup</code> | |

<b>Returns:</b>

`TSetup`

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-core-server](./kibana-plugin-core-server.md) &gt; [PrebootPlugin](./kibana-plugin-core-server.prebootplugin.md) &gt; [stop](./kibana-plugin-core-server.prebootplugin.stop.md)

## PrebootPlugin.stop() method

<b>Signature:</b>

```typescript
stop?(): void;
```
<b>Returns:</b>
`void`
3 changes: 3 additions & 0 deletions examples/preboot_example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `prebootExample` plugin

The example of the `preboot` plugin.
16 changes: 16 additions & 0 deletions examples/preboot_example/kibana.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"id": "prebootExample",
"owner": {
"name": "Platform Security",
"githubTeam": "kibana-security"
},
"description": "The example of the `preboot` plugin.",
"version": "8.0.0",
"kibanaVersion": "kibana",
"configPath": ["prebootExample"],
"type": "preboot",
"server": true,
"ui": true,
"requiredPlugins": [],
"requiredBundles": []
}
Loading

0 comments on commit 7962391

Please sign in to comment.