Skip to content

Commit 07711a9

Browse files
Merge branch 'master' into 21721
2 parents 371e944 + 83678e1 commit 07711a9

File tree

26 files changed

+366
-303
lines changed

26 files changed

+366
-303
lines changed

docs/development/core/public/kibana-plugin-core-public.doclinksstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ export interface DocLinksStart
1717
| --- | --- | --- |
1818
| [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinksstart.doc_link_version.md) | <code>string</code> | |
1919
| [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinksstart.elastic_website_url.md) | <code>string</code> | |
20-
| [links](./kibana-plugin-core-public.doclinksstart.links.md) | <code>{</code><br/><code> readonly dashboard: {</code><br/><code> readonly drilldowns: string;</code><br/><code> };</code><br/><code> readonly filebeat: {</code><br/><code> readonly base: string;</code><br/><code> readonly installation: string;</code><br/><code> readonly configuration: string;</code><br/><code> readonly elasticsearchOutput: string;</code><br/><code> readonly startup: string;</code><br/><code> readonly exportedFields: string;</code><br/><code> };</code><br/><code> readonly auditbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly metricbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly heartbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly logstash: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly functionbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly winlogbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly aggs: {</code><br/><code> readonly date_histogram: string;</code><br/><code> readonly date_range: string;</code><br/><code> readonly filter: string;</code><br/><code> readonly filters: string;</code><br/><code> readonly geohash_grid: string;</code><br/><code> readonly histogram: string;</code><br/><code> readonly ip_range: string;</code><br/><code> readonly range: string;</code><br/><code> readonly significant_terms: string;</code><br/><code> readonly terms: string;</code><br/><code> readonly avg: string;</code><br/><code> readonly avg_bucket: string;</code><br/><code> readonly max_bucket: string;</code><br/><code> readonly min_bucket: string;</code><br/><code> readonly sum_bucket: string;</code><br/><code> readonly cardinality: string;</code><br/><code> readonly count: string;</code><br/><code> readonly cumulative_sum: string;</code><br/><code> readonly derivative: string;</code><br/><code> readonly geo_bounds: string;</code><br/><code> readonly geo_centroid: string;</code><br/><code> readonly max: string;</code><br/><code> readonly median: string;</code><br/><code> readonly min: string;</code><br/><code> readonly moving_avg: string;</code><br/><code> readonly percentile_ranks: string;</code><br/><code> readonly serial_diff: string;</code><br/><code> readonly std_dev: string;</code><br/><code> readonly sum: string;</code><br/><code> readonly top_hits: string;</code><br/><code> };</code><br/><code> readonly scriptedFields: {</code><br/><code> readonly scriptFields: string;</code><br/><code> readonly scriptAggs: string;</code><br/><code> readonly painless: string;</code><br/><code> readonly painlessApi: string;</code><br/><code> readonly painlessSyntax: string;</code><br/><code> readonly luceneExpressions: string;</code><br/><code> };</code><br/><code> readonly indexPatterns: {</code><br/><code> readonly loadingData: string;</code><br/><code> readonly introduction: string;</code><br/><code> };</code><br/><code> readonly kibana: string;</code><br/><code> readonly siem: {</code><br/><code> readonly guide: string;</code><br/><code> readonly gettingStarted: string;</code><br/><code> };</code><br/><code> readonly query: {</code><br/><code> readonly luceneQuerySyntax: string;</code><br/><code> readonly queryDsl: string;</code><br/><code> readonly kueryQuerySyntax: string;</code><br/><code> };</code><br/><code> readonly date: {</code><br/><code> readonly dateMath: string;</code><br/><code> };</code><br/><code> readonly management: Record&lt;string, string&gt;;</code><br/><code> }</code> | |
20+
| [links](./kibana-plugin-core-public.doclinksstart.links.md) | <code>{</code><br/><code> readonly dashboard: {</code><br/><code> readonly drilldowns: string;</code><br/><code> };</code><br/><code> readonly filebeat: {</code><br/><code> readonly base: string;</code><br/><code> readonly installation: string;</code><br/><code> readonly configuration: string;</code><br/><code> readonly elasticsearchOutput: string;</code><br/><code> readonly startup: string;</code><br/><code> readonly exportedFields: string;</code><br/><code> };</code><br/><code> readonly auditbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly metricbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly heartbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly logstash: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly functionbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly winlogbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly aggs: {</code><br/><code> readonly date_histogram: string;</code><br/><code> readonly date_range: string;</code><br/><code> readonly filter: string;</code><br/><code> readonly filters: string;</code><br/><code> readonly geohash_grid: string;</code><br/><code> readonly histogram: string;</code><br/><code> readonly ip_range: string;</code><br/><code> readonly range: string;</code><br/><code> readonly significant_terms: string;</code><br/><code> readonly terms: string;</code><br/><code> readonly avg: string;</code><br/><code> readonly avg_bucket: string;</code><br/><code> readonly max_bucket: string;</code><br/><code> readonly min_bucket: string;</code><br/><code> readonly sum_bucket: string;</code><br/><code> readonly cardinality: string;</code><br/><code> readonly count: string;</code><br/><code> readonly cumulative_sum: string;</code><br/><code> readonly derivative: string;</code><br/><code> readonly geo_bounds: string;</code><br/><code> readonly geo_centroid: string;</code><br/><code> readonly max: string;</code><br/><code> readonly median: string;</code><br/><code> readonly min: string;</code><br/><code> readonly moving_avg: string;</code><br/><code> readonly percentile_ranks: string;</code><br/><code> readonly serial_diff: string;</code><br/><code> readonly std_dev: string;</code><br/><code> readonly sum: string;</code><br/><code> readonly top_hits: string;</code><br/><code> };</code><br/><code> readonly scriptedFields: {</code><br/><code> readonly scriptFields: string;</code><br/><code> readonly scriptAggs: string;</code><br/><code> readonly painless: string;</code><br/><code> readonly painlessApi: string;</code><br/><code> readonly painlessSyntax: string;</code><br/><code> readonly luceneExpressions: string;</code><br/><code> };</code><br/><code> readonly indexPatterns: {</code><br/><code> readonly loadingData: string;</code><br/><code> readonly introduction: string;</code><br/><code> };</code><br/><code> readonly addData: string;</code><br/><code> readonly kibana: string;</code><br/><code> readonly siem: {</code><br/><code> readonly guide: string;</code><br/><code> readonly gettingStarted: string;</code><br/><code> };</code><br/><code> readonly query: {</code><br/><code> readonly luceneQuerySyntax: string;</code><br/><code> readonly queryDsl: string;</code><br/><code> readonly kueryQuerySyntax: string;</code><br/><code> };</code><br/><code> readonly date: {</code><br/><code> readonly dateMath: string;</code><br/><code> };</code><br/><code> readonly management: Record&lt;string, string&gt;;</code><br/><code> }</code> | |
2121

docs/development/core/server/kibana-plugin-core-server.elasticsearchservicesetup.legacy.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
```typescript
1515
legacy: {
16+
readonly config$: Observable<ElasticsearchConfig>;
1617
readonly createClient: (type: string, clientConfig?: Partial<LegacyElasticsearchClientConfig>) => ILegacyCustomClusterClient;
1718
readonly client: ILegacyClusterClient;
1819
};

docs/development/core/server/kibana-plugin-core-server.elasticsearchservicesetup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ export interface ElasticsearchServiceSetup
1515

1616
| Property | Type | Description |
1717
| --- | --- | --- |
18-
| [legacy](./kibana-plugin-core-server.elasticsearchservicesetup.legacy.md) | <code>{</code><br/><code> readonly createClient: (type: string, clientConfig?: Partial&lt;LegacyElasticsearchClientConfig&gt;) =&gt; ILegacyCustomClusterClient;</code><br/><code> readonly client: ILegacyClusterClient;</code><br/><code> }</code> | |
18+
| [legacy](./kibana-plugin-core-server.elasticsearchservicesetup.legacy.md) | <code>{</code><br/><code> readonly config$: Observable&lt;ElasticsearchConfig&gt;;</code><br/><code> readonly createClient: (type: string, clientConfig?: Partial&lt;LegacyElasticsearchClientConfig&gt;) =&gt; ILegacyCustomClusterClient;</code><br/><code> readonly client: ILegacyClusterClient;</code><br/><code> }</code> | |
1919

docs/development/core/server/kibana-plugin-core-server.elasticsearchservicestart.legacy.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
```typescript
1515
legacy: {
16+
readonly config$: Observable<ElasticsearchConfig>;
1617
readonly createClient: (type: string, clientConfig?: Partial<LegacyElasticsearchClientConfig>) => ILegacyCustomClusterClient;
1718
readonly client: ILegacyClusterClient;
1819
};

docs/development/core/server/kibana-plugin-core-server.elasticsearchservicestart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ export interface ElasticsearchServiceStart
1717
| --- | --- | --- |
1818
| [client](./kibana-plugin-core-server.elasticsearchservicestart.client.md) | <code>IClusterClient</code> | A pre-configured [Elasticsearch client](./kibana-plugin-core-server.iclusterclient.md) |
1919
| [createClient](./kibana-plugin-core-server.elasticsearchservicestart.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)<!-- -->. |
20-
| [legacy](./kibana-plugin-core-server.elasticsearchservicestart.legacy.md) | <code>{</code><br/><code> readonly createClient: (type: string, clientConfig?: Partial&lt;LegacyElasticsearchClientConfig&gt;) =&gt; ILegacyCustomClusterClient;</code><br/><code> readonly client: ILegacyClusterClient;</code><br/><code> }</code> | |
20+
| [legacy](./kibana-plugin-core-server.elasticsearchservicestart.legacy.md) | <code>{</code><br/><code> readonly config$: Observable&lt;ElasticsearchConfig&gt;;</code><br/><code> readonly createClient: (type: string, clientConfig?: Partial&lt;LegacyElasticsearchClientConfig&gt;) =&gt; ILegacyCustomClusterClient;</code><br/><code> readonly client: ILegacyClusterClient;</code><br/><code> }</code> | |
2121

src/core/server/elasticsearch/elasticsearch_service.mock.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { ServiceStatus, ServiceStatusLevels } from '../status';
3434

3535
interface MockedElasticSearchServiceSetup {
3636
legacy: {
37+
config$: BehaviorSubject<ElasticsearchConfig>;
3738
createClient: jest.Mock<ILegacyCustomClusterClient, any>;
3839
client: jest.Mocked<ILegacyClusterClient>;
3940
};
@@ -49,6 +50,7 @@ type MockedElasticSearchServiceStart = MockedElasticSearchServiceSetup & {
4950
const createSetupContractMock = () => {
5051
const setupContract: MockedElasticSearchServiceSetup = {
5152
legacy: {
53+
config$: new BehaviorSubject({} as ElasticsearchConfig),
5254
createClient: jest.fn(),
5355
client: legacyClientMock.createClusterClient(),
5456
},
@@ -65,6 +67,7 @@ const createStartContractMock = () => {
6567
client: elasticsearchClientMock.createClusterClient(),
6668
createClient: jest.fn(),
6769
legacy: {
70+
config$: new BehaviorSubject({} as ElasticsearchConfig),
6871
createClient: jest.fn(),
6972
client: legacyClientMock.createClusterClient(),
7073
},
@@ -99,7 +102,6 @@ const createInternalSetupContractMock = () => {
99102
summary: 'Elasticsearch is available',
100103
}),
101104
legacy: {
102-
config$: new BehaviorSubject({} as ElasticsearchConfig),
103105
...createSetupContractMock().legacy,
104106
},
105107
};

src/core/server/elasticsearch/elasticsearch_service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export class ElasticsearchService
123123
client: this.client!,
124124
createClient,
125125
legacy: {
126+
config$: this.config$,
126127
client: this.legacyClient,
127128
createClient: this.createLegacyCustomClient,
128129
},

src/core/server/elasticsearch/types.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,14 @@ export interface ElasticsearchServiceSetup {
3737
/**
3838
* @deprecated
3939
* Use {@link ElasticsearchServiceStart.legacy} instead.
40-
*
41-
* */
40+
*/
4241
legacy: {
42+
/**
43+
* Provide direct access to the current elasticsearch configuration.
44+
*
45+
* @deprecated this will be removed in a later version.
46+
*/
47+
readonly config$: Observable<ElasticsearchConfig>;
4348
/**
4449
* @deprecated
4550
* Use {@link ElasticsearchServiceStart.legacy | ElasticsearchServiceStart.legacy.createClient} instead.
@@ -82,11 +87,7 @@ export interface ElasticsearchServiceSetup {
8287
}
8388

8489
/** @internal */
85-
export interface InternalElasticsearchServiceSetup {
86-
// Required for the BWC with the legacy Kibana only.
87-
readonly legacy: ElasticsearchServiceSetup['legacy'] & {
88-
readonly config$: Observable<ElasticsearchConfig>;
89-
};
90+
export interface InternalElasticsearchServiceSetup extends ElasticsearchServiceSetup {
9091
esNodesCompatibility$: Observable<NodesVersionCompatibility>;
9192
status$: Observable<ServiceStatus<ElasticsearchStatusMeta>>;
9293
}
@@ -132,6 +133,12 @@ export interface ElasticsearchServiceStart {
132133
* Switch to the new elasticsearch client as soon as https://github.com/elastic/kibana/issues/35508 done.
133134
* */
134135
legacy: {
136+
/**
137+
* Provide direct access to the current elasticsearch configuration.
138+
*
139+
* @deprecated this will be removed in a later version.
140+
*/
141+
readonly config$: Observable<ElasticsearchConfig>;
135142
/**
136143
* Create application specific Elasticsearch cluster API client with customized config. See {@link ILegacyClusterClient}.
137144
*

src/core/server/legacy/legacy_service.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,7 @@ export class LegacyService implements CoreService {
288288
capabilities: setupDeps.core.capabilities,
289289
context: setupDeps.core.context,
290290
elasticsearch: {
291-
legacy: {
292-
client: setupDeps.core.elasticsearch.legacy.client,
293-
createClient: setupDeps.core.elasticsearch.legacy.createClient,
294-
},
291+
legacy: setupDeps.core.elasticsearch.legacy,
295292
},
296293
http: {
297294
createCookieSessionStorageFactory: setupDeps.core.http.createCookieSessionStorageFactory,

src/core/server/server.api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ export class ElasticsearchConfig {
716716
export interface ElasticsearchServiceSetup {
717717
// @deprecated (undocumented)
718718
legacy: {
719+
readonly config$: Observable<ElasticsearchConfig>;
719720
readonly createClient: (type: string, clientConfig?: Partial<LegacyElasticsearchClientConfig>) => ILegacyCustomClusterClient;
720721
readonly client: ILegacyClusterClient;
721722
};
@@ -727,6 +728,7 @@ export interface ElasticsearchServiceStart {
727728
readonly createClient: (type: string, clientConfig?: Partial<ElasticsearchClientConfig>) => ICustomClusterClient;
728729
// @deprecated (undocumented)
729730
legacy: {
731+
readonly config$: Observable<ElasticsearchConfig>;
730732
readonly createClient: (type: string, clientConfig?: Partial<LegacyElasticsearchClientConfig>) => ILegacyCustomClusterClient;
731733
readonly client: ILegacyClusterClient;
732734
};

0 commit comments

Comments
 (0)