diff --git a/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap
index d90d0824a1237..b5c1f3ca843e4 100644
--- a/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap
+++ b/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap
@@ -5734,6 +5734,7 @@ exports[`Header renders 1`] = `
aria-controls="mockId"
aria-expanded={true}
className="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading"
+ id="mockId"
onClick={[Function]}
type="button"
>
diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md
index d22c7ae805827..1c17be50454c5 100644
--- a/src/core/public/public.api.md
+++ b/src/core/public/public.api.md
@@ -446,37 +446,7 @@ export class CoreSystem {
}
// @internal (undocumented)
-export const DEFAULT_APP_CATEGORIES: Readonly<{
- kibana: {
- id: string;
- label: string;
- euiIconType: string;
- order: number;
- };
- enterpriseSearch: {
- id: string;
- label: string;
- order: number;
- euiIconType: string;
- };
- observability: {
- id: string;
- label: string;
- euiIconType: string;
- order: number;
- };
- security: {
- id: string;
- label: string;
- order: number;
- euiIconType: string;
- };
- management: {
- id: string;
- label: string;
- order: number;
- };
-}>;
+export const DEFAULT_APP_CATEGORIES: Record
;
// @public (undocumented)
export interface DocLinksStart {
diff --git a/src/core/server/context/context_service.mock.ts b/src/core/server/context/context_service.mock.ts
index a8d895acad624..24e0d52100bb1 100644
--- a/src/core/server/context/context_service.mock.ts
+++ b/src/core/server/context/context_service.mock.ts
@@ -21,9 +21,9 @@ import type { PublicMethodsOf } from '@kbn/utility-types';
import { ContextService, ContextSetup } from './context_service';
import { contextMock } from '../../utils/context.mock';
-const createSetupContractMock = () => {
+const createSetupContractMock = (mockContext = {}) => {
const setupContract: jest.Mocked = {
- createContextContainer: jest.fn().mockImplementation(() => contextMock.create()),
+ createContextContainer: jest.fn().mockImplementation(() => contextMock.create(mockContext)),
};
return setupContract;
};
diff --git a/src/core/server/elasticsearch/version_check/ensure_es_version.ts b/src/core/server/elasticsearch/version_check/ensure_es_version.ts
index 5f926215d167f..70ff8857117de 100644
--- a/src/core/server/elasticsearch/version_check/ensure_es_version.ts
+++ b/src/core/server/elasticsearch/version_check/ensure_es_version.ts
@@ -72,7 +72,7 @@ export function mapNodesVersionCompatibility(
kibanaVersion: string,
ignoreVersionMismatch: boolean
): NodesVersionCompatibility {
- if (Object.keys(nodesInfo.nodes).length === 0) {
+ if (Object.keys(nodesInfo.nodes ?? {}).length === 0) {
return {
isCompatible: false,
message: 'Unable to retrieve version information from Elasticsearch nodes.',
diff --git a/src/core/server/index.ts b/src/core/server/index.ts
index 01797d073ae2e..e136c699f7246 100644
--- a/src/core/server/index.ts
+++ b/src/core/server/index.ts
@@ -60,7 +60,7 @@ import {
SavedObjectsServiceStart,
} from './saved_objects';
import { CapabilitiesSetup, CapabilitiesStart } from './capabilities';
-import { MetricsServiceStart } from './metrics';
+import { MetricsServiceSetup, MetricsServiceStart } from './metrics';
import { StatusServiceSetup } from './status';
import { Auditor, AuditTrailSetup, AuditTrailStart } from './audit_trail';
import { AppenderConfigType, appendersSchema, LoggingServiceSetup } from './logging';
@@ -320,8 +320,10 @@ export {
OpsServerMetrics,
OpsProcessMetrics,
MetricsServiceSetup,
+ MetricsServiceStart,
} from './metrics';
+export { AppCategory } from '../types';
export { DEFAULT_APP_CATEGORIES } from '../utils';
export {
@@ -414,6 +416,8 @@ export interface CoreSetup = KbnServer as any;
@@ -99,6 +100,7 @@ beforeEach(() => {
status: statusServiceMock.createInternalSetupContract(),
auditTrail: auditTrailServiceMock.createSetupContract(),
logging: loggingServiceMock.createInternalSetupContract(),
+ metrics: metricsServiceMock.createInternalSetupContract(),
},
plugins: { 'plugin-id': 'plugin-value' },
uiPlugins: {
diff --git a/src/core/server/legacy/legacy_service.ts b/src/core/server/legacy/legacy_service.ts
index fd3e3a694e6ae..4dc22be2a9971 100644
--- a/src/core/server/legacy/legacy_service.ts
+++ b/src/core/server/legacy/legacy_service.ts
@@ -302,6 +302,10 @@ export class LegacyService implements CoreService {
logging: {
configure: (config$) => setupDeps.core.logging.configure([], config$),
},
+ metrics: {
+ collectionInterval: setupDeps.core.metrics.collectionInterval,
+ getOpsMetrics$: setupDeps.core.metrics.getOpsMetrics$,
+ },
savedObjects: {
setClientFactoryProvider: setupDeps.core.savedObjects.setClientFactoryProvider,
addClientWrapper: setupDeps.core.savedObjects.addClientWrapper,
@@ -309,6 +313,7 @@ export class LegacyService implements CoreService {
getImportExportObjectLimit: setupDeps.core.savedObjects.getImportExportObjectLimit,
},
status: {
+ isStatusPageAnonymous: setupDeps.core.status.isStatusPageAnonymous,
core$: setupDeps.core.status.core$,
overall$: setupDeps.core.status.overall$,
set: () => {
diff --git a/src/core/server/metrics/metrics_service.mock.ts b/src/core/server/metrics/metrics_service.mock.ts
index caa7acc001db3..0d9e9af39317c 100644
--- a/src/core/server/metrics/metrics_service.mock.ts
+++ b/src/core/server/metrics/metrics_service.mock.ts
@@ -78,8 +78,8 @@ type MetricsServiceContract = PublicMethodsOf;
const createMock = () => {
const mocked: jest.Mocked = {
- setup: jest.fn().mockReturnValue(createInternalSetupContractMock()),
- start: jest.fn().mockReturnValue(createInternalStartContractMock()),
+ setup: jest.fn().mockReturnValue(createSetupContractMock()),
+ start: jest.fn().mockReturnValue(createStartContractMock()),
stop: jest.fn(),
};
return mocked;
diff --git a/src/core/server/metrics/metrics_service.test.ts b/src/core/server/metrics/metrics_service.test.ts
index 269931d0e33ad..384a56c8dba94 100644
--- a/src/core/server/metrics/metrics_service.test.ts
+++ b/src/core/server/metrics/metrics_service.test.ts
@@ -106,6 +106,25 @@ describe('MetricsService', () => {
`"#setup() needs to be run first"`
);
});
+
+ it('emits the last value on each getOpsMetrics$ call', async () => {
+ const firstMetrics = { metric: 'first' };
+ const secondMetrics = { metric: 'second' };
+ mockOpsCollector.collect
+ .mockResolvedValueOnce(firstMetrics)
+ .mockResolvedValueOnce(secondMetrics);
+
+ await metricsService.setup({ http: httpMock });
+ const { getOpsMetrics$ } = await metricsService.start();
+
+ const firstEmission = getOpsMetrics$().pipe(take(1)).toPromise();
+ jest.advanceTimersByTime(testInterval);
+ expect(await firstEmission).toEqual({ metric: 'first' });
+
+ const secondEmission = getOpsMetrics$().pipe(take(1)).toPromise();
+ jest.advanceTimersByTime(testInterval);
+ expect(await secondEmission).toEqual({ metric: 'second' });
+ });
});
describe('#stop', () => {
diff --git a/src/core/server/metrics/metrics_service.ts b/src/core/server/metrics/metrics_service.ts
index d4696b3aa9aaf..ab58a75d49a98 100644
--- a/src/core/server/metrics/metrics_service.ts
+++ b/src/core/server/metrics/metrics_service.ts
@@ -37,7 +37,7 @@ export class MetricsService
private readonly logger: Logger;
private metricsCollector?: OpsMetricsCollector;
private collectInterval?: NodeJS.Timeout;
- private metrics$ = new ReplaySubject();
+ private metrics$ = new ReplaySubject(1);
private service?: InternalMetricsServiceSetup;
constructor(private readonly coreContext: CoreContext) {
diff --git a/src/core/server/mocks.ts b/src/core/server/mocks.ts
index 52dccb6880882..7e001ffe28100 100644
--- a/src/core/server/mocks.ts
+++ b/src/core/server/mocks.ts
@@ -52,6 +52,8 @@ export { typeRegistryMock as savedObjectsTypeRegistryMock } from './saved_object
export { uiSettingsServiceMock } from './ui_settings/ui_settings_service.mock';
export { metricsServiceMock } from './metrics/metrics_service.mock';
export { renderingMock } from './rendering/rendering_service.mock';
+export { statusServiceMock } from './status/status_service.mock';
+export { contextServiceMock } from './context/context_service.mock';
export function pluginInitializerContextConfigMock(config: T) {
const globalConfig: SharedGlobalConfig = {
@@ -137,6 +139,7 @@ function createCoreSetupMock({
uiSettings: uiSettingsMock,
auditTrail: auditTrailServiceMock.createSetupContract(),
logging: loggingServiceMock.createSetupContract(),
+ metrics: metricsServiceMock.createSetupContract(),
getStartServices: jest
.fn, object, any]>, []>()
.mockResolvedValue([createCoreStartMock(), pluginStartDeps, pluginStartContract]),
@@ -173,6 +176,7 @@ function createInternalCoreSetupMock() {
uiSettings: uiSettingsServiceMock.createSetupContract(),
auditTrail: auditTrailServiceMock.createSetupContract(),
logging: loggingServiceMock.createInternalSetupContract(),
+ metrics: metricsServiceMock.createInternalSetupContract(),
};
return setupDeps;
}
@@ -182,7 +186,7 @@ function createInternalCoreStartMock() {
capabilities: capabilitiesServiceMock.createStartContract(),
elasticsearch: elasticsearchServiceMock.createInternalStart(),
http: httpServiceMock.createInternalStartContract(),
- metrics: metricsServiceMock.createStartContract(),
+ metrics: metricsServiceMock.createInternalStartContract(),
savedObjects: savedObjectsServiceMock.createInternalStartContract(),
uiSettings: uiSettingsServiceMock.createStartContract(),
auditTrail: auditTrailServiceMock.createStartContract(),
diff --git a/src/core/server/plugins/plugin_context.ts b/src/core/server/plugins/plugin_context.ts
index 6529e83b4d818..ab3f471fd7942 100644
--- a/src/core/server/plugins/plugin_context.ts
+++ b/src/core/server/plugins/plugin_context.ts
@@ -179,6 +179,10 @@ export function createPluginSetupContext(
logging: {
configure: (config$) => deps.logging.configure(['plugins', plugin.name], config$),
},
+ metrics: {
+ collectionInterval: deps.metrics.collectionInterval,
+ getOpsMetrics$: deps.metrics.getOpsMetrics$,
+ },
savedObjects: {
setClientFactoryProvider: deps.savedObjects.setClientFactoryProvider,
addClientWrapper: deps.savedObjects.addClientWrapper,
@@ -191,6 +195,7 @@ export function createPluginSetupContext(
set: deps.status.plugins.set.bind(null, plugin.name),
dependencies$: deps.status.plugins.getDependenciesStatus$(plugin.name),
derivedStatus$: deps.status.plugins.getDerivedStatus$(plugin.name),
+ isStatusPageAnonymous: deps.status.isStatusPageAnonymous,
},
uiSettings: {
register: deps.uiSettings.register,
diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md
index ef5eb55632ed1..11a14457784fd 100644
--- a/src/core/server/server.api.md
+++ b/src/core/server/server.api.md
@@ -164,6 +164,15 @@ import { UpdateDocumentByQueryParams } from 'elasticsearch';
import { UpdateDocumentParams } from 'elasticsearch';
import { Url } from 'url';
+// @public
+export interface AppCategory {
+ ariaLabel?: string;
+ euiIconType?: string;
+ id: string;
+ label: string;
+ order?: number;
+}
+
// Warning: (ae-forgotten-export) The symbol "ConsoleAppenderConfig" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FileAppenderConfig" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "LegacyAppenderConfig" needs to be exported by the entry point index.d.ts
@@ -416,6 +425,8 @@ export interface CoreSetup;
+export const DEFAULT_APP_CATEGORIES: Record;
// @public (undocumented)
export interface DeleteDocumentResponse {
@@ -1431,6 +1409,9 @@ export interface MetricsServiceSetup {
getOpsMetrics$: () => Observable;
}
+// @public
+export type MetricsServiceStart = MetricsServiceSetup;
+
// @public @deprecated (undocumented)
export type MIGRATION_ASSISTANCE_INDEX_ACTION = 'upgrade' | 'reindex';
@@ -2589,18 +2570,22 @@ export const ServiceStatusLevels: Readonly<{
available: Readonly<{
toString: () => "available";
valueOf: () => 0;
+ toJSON: () => "available";
}>;
degraded: Readonly<{
toString: () => "degraded";
valueOf: () => 1;
+ toJSON: () => "degraded";
}>;
unavailable: Readonly<{
toString: () => "unavailable";
valueOf: () => 2;
+ toJSON: () => "unavailable";
}>;
critical: Readonly<{
toString: () => "critical";
valueOf: () => 3;
+ toJSON: () => "critical";
}>;
}>;
@@ -2676,6 +2661,7 @@ export interface StatusServiceSetup {
dependencies$: Observable>;
// Warning: (ae-unresolved-link) The @link reference could not be resolved: The package "kibana" does not have an export "StatusSetup"
derivedStatus$: Observable;
+ isStatusPageAnonymous: () => boolean;
overall$: Observable;
set(status$: Observable): void;
}
diff --git a/src/core/server/server.ts b/src/core/server/server.ts
index c689e2cb70cc9..8502f563cb0c2 100644
--- a/src/core/server/server.ts
+++ b/src/core/server/server.ts
@@ -152,12 +152,15 @@ export class Server {
savedObjects: savedObjectsSetup,
});
- await this.metrics.setup({ http: httpSetup });
+ const metricsSetup = await this.metrics.setup({ http: httpSetup });
const statusSetup = await this.status.setup({
elasticsearch: elasticsearchServiceSetup,
pluginDependencies: pluginTree.asNames,
savedObjects: savedObjectsSetup,
+ environment: environmentSetup,
+ http: httpSetup,
+ metrics: metricsSetup,
});
const renderingSetup = await this.rendering.setup({
@@ -189,6 +192,7 @@ export class Server {
httpResources: httpResourcesSetup,
auditTrail: auditTrailSetup,
logging: loggingSetup,
+ metrics: metricsSetup,
};
const pluginsSetup = await this.plugins.setup(coreSetup);
diff --git a/src/core/server/status/legacy_status.test.ts b/src/core/server/status/legacy_status.test.ts
new file mode 100644
index 0000000000000..e3e55442cabd2
--- /dev/null
+++ b/src/core/server/status/legacy_status.test.ts
@@ -0,0 +1,114 @@
+/*
+ * 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.
+ */
+
+import { ServiceStatus, ServiceStatusLevels } from './types';
+import { calculateLegacyStatus } from './legacy_status';
+
+const available: ServiceStatus = { level: ServiceStatusLevels.available, summary: 'Available' };
+const degraded: ServiceStatus = {
+ level: ServiceStatusLevels.degraded,
+ summary: 'This is degraded!',
+};
+const unavailable: ServiceStatus = {
+ level: ServiceStatusLevels.unavailable,
+ summary: 'This is unavailable!',
+};
+const critical: ServiceStatus = {
+ level: ServiceStatusLevels.critical,
+ summary: 'This is critical!',
+};
+
+describe('calculateLegacyStatus', () => {
+ it('translates the overall status to the legacy format', () => {
+ const legacyStatus = calculateLegacyStatus({
+ overall: available,
+ core: {} as any,
+ plugins: {},
+ versionWithoutSnapshot: '1.1.1',
+ });
+
+ expect(legacyStatus.overall).toEqual({
+ state: 'green',
+ title: 'Green',
+ nickname: 'Looking good',
+ icon: 'success',
+ uiColor: 'secondary',
+ since: expect.any(String),
+ });
+ });
+
+ it('combines core and plugins statuses into statuses array in legacy format', () => {
+ const legacyStatus = calculateLegacyStatus({
+ overall: available,
+ core: {
+ elasticsearch: degraded,
+ savedObjects: critical,
+ },
+ plugins: {
+ a: available,
+ b: unavailable,
+ c: degraded,
+ },
+ versionWithoutSnapshot: '1.1.1',
+ });
+
+ expect(legacyStatus.statuses).toEqual([
+ {
+ icon: 'warning',
+ id: 'core:elasticsearch@1.1.1',
+ message: 'This is degraded!',
+ since: expect.any(String),
+ state: 'yellow',
+ uiColor: 'warning',
+ },
+ {
+ icon: 'danger',
+ id: 'core:savedObjects@1.1.1',
+ message: 'This is critical!',
+ since: expect.any(String),
+ state: 'red',
+ uiColor: 'danger',
+ },
+ {
+ icon: 'success',
+ id: 'plugin:a@1.1.1',
+ message: 'Available',
+ since: expect.any(String),
+ state: 'green',
+ uiColor: 'secondary',
+ },
+ {
+ icon: 'danger',
+ id: 'plugin:b@1.1.1',
+ message: 'This is unavailable!',
+ since: expect.any(String),
+ state: 'red',
+ uiColor: 'danger',
+ },
+ {
+ icon: 'warning',
+ id: 'plugin:c@1.1.1',
+ message: 'This is degraded!',
+ since: expect.any(String),
+ state: 'yellow',
+ uiColor: 'warning',
+ },
+ ]);
+ });
+});
diff --git a/src/core/server/status/legacy_status.ts b/src/core/server/status/legacy_status.ts
new file mode 100644
index 0000000000000..41777ae97c3da
--- /dev/null
+++ b/src/core/server/status/legacy_status.ts
@@ -0,0 +1,158 @@
+/*
+ * 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.
+ */
+
+import { pick } from 'lodash';
+import { i18n } from '@kbn/i18n';
+import { deepFreeze } from '@kbn/std';
+
+import { ServiceStatusLevels, ServiceStatus, CoreStatus } from './types';
+import { PluginName } from '../plugins';
+
+interface Deps {
+ overall: ServiceStatus;
+ core: CoreStatus;
+ plugins: Record;
+ versionWithoutSnapshot: string;
+}
+
+export interface LegacyStatusInfo {
+ overall: LegacyStatusOverall;
+ statuses: StatusComponentHttp[];
+}
+
+interface LegacyStatusOverall {
+ state: LegacyStatusState;
+ title: string;
+ nickname: string;
+ uiColor: LegacyStatusUiColor;
+ /** ISO-8601 date string w/o timezone */
+ since: string;
+ icon?: string;
+}
+
+type LegacyStatusState = 'green' | 'yellow' | 'red';
+type LegacyStatusIcon = 'danger' | 'warning' | 'success';
+type LegacyStatusUiColor = 'secondary' | 'warning' | 'danger';
+
+interface LegacyStateAttr {
+ id: LegacyStatusState;
+ state: LegacyStatusState;
+ title: string;
+ icon: LegacyStatusIcon;
+ uiColor: LegacyStatusUiColor;
+ nickname: string;
+}
+
+export const calculateLegacyStatus = ({
+ core,
+ overall,
+ plugins,
+ versionWithoutSnapshot,
+}: Deps): LegacyStatusInfo => {
+ const since = new Date().toISOString();
+ const overallLegacy: LegacyStatusOverall = {
+ since,
+ ...pick(STATUS_LEVEL_LEGACY_ATTRS[overall.level.toString()], [
+ 'state',
+ 'title',
+ 'nickname',
+ 'icon',
+ 'uiColor',
+ ]),
+ };
+ const coreStatuses = Object.entries(core).map(([serviceName, s]) =>
+ serviceStatusToHttpComponent(`core:${serviceName}@${versionWithoutSnapshot}`, s, since)
+ );
+ const pluginStatuses = Object.entries(plugins).map(([pluginName, s]) =>
+ serviceStatusToHttpComponent(`plugin:${pluginName}@${versionWithoutSnapshot}`, s, since)
+ );
+
+ const componentStatuses: StatusComponentHttp[] = [...coreStatuses, ...pluginStatuses];
+
+ return {
+ overall: overallLegacy,
+ statuses: componentStatuses,
+ };
+};
+
+interface StatusComponentHttp {
+ id: string;
+ state: LegacyStatusState;
+ message: string;
+ uiColor: LegacyStatusUiColor;
+ icon: string;
+ since: string;
+}
+
+const serviceStatusToHttpComponent = (
+ serviceName: string,
+ status: ServiceStatus,
+ since: string
+): StatusComponentHttp => ({
+ id: serviceName,
+ message: status.summary,
+ since,
+ ...serviceStatusAttrs(status),
+});
+
+const serviceStatusAttrs = (status: ServiceStatus) =>
+ pick(STATUS_LEVEL_LEGACY_ATTRS[status.level.toString()], ['state', 'icon', 'uiColor']);
+
+const STATUS_LEVEL_LEGACY_ATTRS = deepFreeze>({
+ [ServiceStatusLevels.critical.toString()]: {
+ id: 'red',
+ state: 'red',
+ title: i18n.translate('core.status.redTitle', {
+ defaultMessage: 'Red',
+ }),
+ icon: 'danger',
+ uiColor: 'danger',
+ nickname: 'Danger Will Robinson! Danger!',
+ },
+ [ServiceStatusLevels.unavailable.toString()]: {
+ id: 'red',
+ state: 'red',
+ title: i18n.translate('core.status.redTitle', {
+ defaultMessage: 'Red',
+ }),
+ icon: 'danger',
+ uiColor: 'danger',
+ nickname: 'Danger Will Robinson! Danger!',
+ },
+ [ServiceStatusLevels.degraded.toString()]: {
+ id: 'yellow',
+ state: 'yellow',
+ title: i18n.translate('core.status.yellowTitle', {
+ defaultMessage: 'Yellow',
+ }),
+ icon: 'warning',
+ uiColor: 'warning',
+ nickname: "I'll be back",
+ },
+ [ServiceStatusLevels.available.toString()]: {
+ id: 'green',
+ state: 'green',
+ title: i18n.translate('core.status.greenTitle', {
+ defaultMessage: 'Green',
+ }),
+ icon: 'success',
+ uiColor: 'secondary',
+ nickname: 'Looking good',
+ },
+});
diff --git a/src/legacy/server/status/lib/index.js b/src/core/server/status/routes/index.ts
similarity index 92%
rename from src/legacy/server/status/lib/index.js
rename to src/core/server/status/routes/index.ts
index 93db8b2d22561..db2e8daf0b9ac 100644
--- a/src/legacy/server/status/lib/index.js
+++ b/src/core/server/status/routes/index.ts
@@ -17,4 +17,4 @@
* under the License.
*/
-export { getKibanaInfoForStats } from './get_kibana_info_for_stats';
+export { registerStatusRoute } from './status';
diff --git a/src/core/server/status/routes/integration_tests/status.test.ts b/src/core/server/status/routes/integration_tests/status.test.ts
new file mode 100644
index 0000000000000..e0f86342e3a8a
--- /dev/null
+++ b/src/core/server/status/routes/integration_tests/status.test.ts
@@ -0,0 +1,322 @@
+/*
+ * 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.
+ */
+
+import { BehaviorSubject } from 'rxjs';
+import { first } from 'rxjs/operators';
+import supertest from 'supertest';
+import { omit } from 'lodash';
+
+import { createCoreContext, createHttpServer } from '../../../http/test_utils';
+import { ContextService } from '../../../context';
+import { metricsServiceMock } from '../../../metrics/metrics_service.mock';
+import { MetricsServiceSetup } from '../../../metrics';
+import { HttpService, InternalHttpServiceSetup } from '../../../http';
+
+import { registerStatusRoute } from '../status';
+import { ServiceStatus, ServiceStatusLevels } from '../../types';
+import { statusServiceMock } from '../../status_service.mock';
+
+const coreId = Symbol('core');
+
+describe('GET /api/status', () => {
+ let server: HttpService;
+ let httpSetup: InternalHttpServiceSetup;
+ let metrics: jest.Mocked;
+
+ const setupServer = async ({ allowAnonymous = true }: { allowAnonymous?: boolean } = {}) => {
+ const coreContext = createCoreContext({ coreId });
+ const contextService = new ContextService(coreContext);
+
+ server = createHttpServer(coreContext);
+ httpSetup = await server.setup({
+ context: contextService.setup({ pluginDependencies: new Map() }),
+ });
+
+ metrics = metricsServiceMock.createSetupContract();
+ const status = statusServiceMock.createSetupContract();
+ const pluginsStatus$ = new BehaviorSubject>({
+ a: { level: ServiceStatusLevels.available, summary: 'a is available' },
+ b: { level: ServiceStatusLevels.degraded, summary: 'b is degraded' },
+ c: { level: ServiceStatusLevels.unavailable, summary: 'c is unavailable' },
+ d: { level: ServiceStatusLevels.critical, summary: 'd is critical' },
+ });
+
+ const router = httpSetup.createRouter('');
+ registerStatusRoute({
+ router,
+ config: {
+ allowAnonymous,
+ packageInfo: {
+ branch: 'xbranch',
+ buildNum: 1234,
+ buildSha: 'xsha',
+ dist: true,
+ version: '9.9.9-SNAPSHOT',
+ },
+ serverName: 'xkibana',
+ uuid: 'xxxx-xxxxx',
+ },
+ metrics,
+ status: {
+ overall$: status.overall$,
+ core$: status.core$,
+ plugins$: pluginsStatus$,
+ },
+ });
+
+ // Register dummy auth provider for testing auth
+ httpSetup.registerAuth((req, res, auth) => {
+ if (req.headers.authorization === 'let me in') {
+ return auth.authenticated();
+ } else {
+ return auth.notHandled();
+ }
+ });
+
+ await server.start();
+ };
+
+ afterEach(async () => {
+ await server.stop();
+ });
+
+ describe('allowAnonymous: false', () => {
+ it('rejects requests with no credentials', async () => {
+ await setupServer({ allowAnonymous: false });
+ await supertest(httpSetup.server.listener).get('/api/status').expect(401);
+ });
+
+ it('rejects requests with bad credentials', async () => {
+ await setupServer({ allowAnonymous: false });
+ await supertest(httpSetup.server.listener)
+ .get('/api/status')
+ .set('Authorization', 'fake creds')
+ .expect(401);
+ });
+
+ it('accepts authenticated requests', async () => {
+ await setupServer({ allowAnonymous: false });
+ await supertest(httpSetup.server.listener)
+ .get('/api/status')
+ .set('Authorization', 'let me in')
+ .expect(200);
+ });
+ });
+
+ it('returns basic server info & metrics', async () => {
+ await setupServer();
+ const result = await supertest(httpSetup.server.listener).get('/api/status').expect(200);
+
+ expect(result.body.name).toEqual('xkibana');
+ expect(result.body.uuid).toEqual('xxxx-xxxxx');
+ expect(result.body.version).toEqual({
+ number: '9.9.9',
+ build_hash: 'xsha',
+ build_number: 1234,
+ build_snapshot: true,
+ });
+ const metricsMockValue = await metrics.getOpsMetrics$().pipe(first()).toPromise();
+ expect(result.body.metrics).toEqual({
+ last_updated: expect.any(String),
+ collection_interval_in_millis: metrics.collectionInterval,
+ ...omit(metricsMockValue, ['collected_at']),
+ requests: {
+ ...metricsMockValue.requests,
+ status_codes: metricsMockValue.requests.statusCodes,
+ },
+ });
+ });
+
+ describe('legacy status format', () => {
+ it('returns legacy status format when no query params provided', async () => {
+ await setupServer();
+ const result = await supertest(httpSetup.server.listener).get('/api/status').expect(200);
+ expect(result.body.status).toEqual({
+ overall: {
+ icon: 'success',
+ nickname: 'Looking good',
+ since: expect.any(String),
+ state: 'green',
+ title: 'Green',
+ uiColor: 'secondary',
+ },
+ statuses: [
+ {
+ icon: 'success',
+ id: 'core:elasticsearch@9.9.9',
+ message: 'Service is working',
+ since: expect.any(String),
+ state: 'green',
+ uiColor: 'secondary',
+ },
+ {
+ icon: 'success',
+ id: 'core:savedObjects@9.9.9',
+ message: 'Service is working',
+ since: expect.any(String),
+ state: 'green',
+ uiColor: 'secondary',
+ },
+ {
+ icon: 'success',
+ id: 'plugin:a@9.9.9',
+ message: 'a is available',
+ since: expect.any(String),
+ state: 'green',
+ uiColor: 'secondary',
+ },
+ {
+ icon: 'warning',
+ id: 'plugin:b@9.9.9',
+ message: 'b is degraded',
+ since: expect.any(String),
+ state: 'yellow',
+ uiColor: 'warning',
+ },
+ {
+ icon: 'danger',
+ id: 'plugin:c@9.9.9',
+ message: 'c is unavailable',
+ since: expect.any(String),
+ state: 'red',
+ uiColor: 'danger',
+ },
+ {
+ icon: 'danger',
+ id: 'plugin:d@9.9.9',
+ message: 'd is critical',
+ since: expect.any(String),
+ state: 'red',
+ uiColor: 'danger',
+ },
+ ],
+ });
+ });
+
+ it('returns legacy status format when v8format=false is provided', async () => {
+ await setupServer();
+ const result = await supertest(httpSetup.server.listener)
+ .get('/api/status?v8format=false')
+ .expect(200);
+ expect(result.body.status).toEqual({
+ overall: {
+ icon: 'success',
+ nickname: 'Looking good',
+ since: expect.any(String),
+ state: 'green',
+ title: 'Green',
+ uiColor: 'secondary',
+ },
+ statuses: [
+ {
+ icon: 'success',
+ id: 'core:elasticsearch@9.9.9',
+ message: 'Service is working',
+ since: expect.any(String),
+ state: 'green',
+ uiColor: 'secondary',
+ },
+ {
+ icon: 'success',
+ id: 'core:savedObjects@9.9.9',
+ message: 'Service is working',
+ since: expect.any(String),
+ state: 'green',
+ uiColor: 'secondary',
+ },
+ {
+ icon: 'success',
+ id: 'plugin:a@9.9.9',
+ message: 'a is available',
+ since: expect.any(String),
+ state: 'green',
+ uiColor: 'secondary',
+ },
+ {
+ icon: 'warning',
+ id: 'plugin:b@9.9.9',
+ message: 'b is degraded',
+ since: expect.any(String),
+ state: 'yellow',
+ uiColor: 'warning',
+ },
+ {
+ icon: 'danger',
+ id: 'plugin:c@9.9.9',
+ message: 'c is unavailable',
+ since: expect.any(String),
+ state: 'red',
+ uiColor: 'danger',
+ },
+ {
+ icon: 'danger',
+ id: 'plugin:d@9.9.9',
+ message: 'd is critical',
+ since: expect.any(String),
+ state: 'red',
+ uiColor: 'danger',
+ },
+ ],
+ });
+ });
+ });
+
+ describe('v8format', () => {
+ it('returns new status format when v8format=true is provided', async () => {
+ await setupServer();
+ const result = await supertest(httpSetup.server.listener)
+ .get('/api/status?v8format=true')
+ .expect(200);
+ expect(result.body.status).toEqual({
+ core: {
+ elasticsearch: {
+ level: 'available',
+ summary: 'Service is working',
+ },
+ savedObjects: {
+ level: 'available',
+ summary: 'Service is working',
+ },
+ },
+ overall: {
+ level: 'available',
+ summary: 'Service is working',
+ },
+ plugins: {
+ a: {
+ level: 'available',
+ summary: 'a is available',
+ },
+ b: {
+ level: 'degraded',
+ summary: 'b is degraded',
+ },
+ c: {
+ level: 'unavailable',
+ summary: 'c is unavailable',
+ },
+ d: {
+ level: 'critical',
+ summary: 'd is critical',
+ },
+ },
+ });
+ });
+ });
+});
diff --git a/src/core/server/status/routes/status.ts b/src/core/server/status/routes/status.ts
new file mode 100644
index 0000000000000..da01a44095529
--- /dev/null
+++ b/src/core/server/status/routes/status.ts
@@ -0,0 +1,177 @@
+/*
+ * 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.
+ */
+
+import { Observable, combineLatest, ReplaySubject } from 'rxjs';
+import { first } from 'rxjs/operators';
+import { schema } from '@kbn/config-schema';
+
+import { IRouter } from '../../http';
+import { MetricsServiceSetup } from '../../metrics';
+import { ServiceStatus, CoreStatus } from '../types';
+import { PluginName } from '../../plugins';
+import { calculateLegacyStatus, LegacyStatusInfo } from '../legacy_status';
+import { PackageInfo } from '../../config';
+
+const SNAPSHOT_POSTFIX = /-SNAPSHOT$/;
+
+interface Deps {
+ router: IRouter;
+ config: {
+ allowAnonymous: boolean;
+ packageInfo: PackageInfo;
+ serverName: string;
+ uuid: string;
+ };
+ metrics: MetricsServiceSetup;
+ status: {
+ overall$: Observable;
+ core$: Observable;
+ plugins$: Observable>;
+ };
+}
+
+interface StatusInfo {
+ overall: ServiceStatus;
+ core: CoreStatus;
+ plugins: Record;
+}
+
+interface StatusHttpBody {
+ name: string;
+ uuid: string;
+ version: {
+ number: string;
+ build_hash: string;
+ build_number: number;
+ build_snapshot: boolean;
+ };
+ status: StatusInfo | LegacyStatusInfo;
+ metrics: {
+ /** ISO-8601 date string w/o timezone */
+ last_updated: string;
+ collection_interval_in_millis: number;
+ process: {
+ memory: {
+ heap: {
+ total_in_bytes: number;
+ used_in_bytes: number;
+ size_limit: number;
+ };
+ resident_set_size_in_bytes: number;
+ };
+ event_loop_delay: number;
+ pid: number;
+ uptime_in_millis: number;
+ };
+ os: {
+ load: Record;
+ memory: {
+ total_in_bytes: number;
+ used_in_bytes: number;
+ free_in_bytes: number;
+ };
+ uptime_in_millis: number;
+ platform: string;
+ platformRelease: string;
+ };
+ response_times: {
+ max_in_millis: number;
+ };
+ requests: {
+ total: number;
+ disconnects: number;
+ statusCodes: Record;
+ status_codes: Record;
+ };
+ concurrent_connections: number;
+ };
+}
+
+export const registerStatusRoute = ({ router, config, metrics, status }: Deps) => {
+ // Since the status.plugins$ observable is not subscribed to elsewhere, we need to subscribe it here to eagerly load
+ // the plugins status when Kibana starts up so this endpoint responds quickly on first boot.
+ const combinedStatus$ = new ReplaySubject<
+ [ServiceStatus, CoreStatus, Record>]
+ >(1);
+ combineLatest([status.overall$, status.core$, status.plugins$]).subscribe(combinedStatus$);
+
+ router.get(
+ {
+ path: '/api/status',
+ options: {
+ authRequired: !config.allowAnonymous,
+ tags: ['api'], // ensures that unauthenticated calls receive a 401 rather than a 302 redirect to login page
+ },
+ validate: {
+ query: schema.object({
+ v8format: schema.boolean({ defaultValue: false }),
+ }),
+ },
+ },
+ async (context, req, res) => {
+ const { version, buildSha, buildNum } = config.packageInfo;
+ const versionWithoutSnapshot = version.replace(SNAPSHOT_POSTFIX, '');
+ const [overall, core, plugins] = await combinedStatus$.pipe(first()).toPromise();
+
+ let statusInfo: StatusInfo | LegacyStatusInfo;
+ if (req.query?.v8format) {
+ statusInfo = {
+ overall,
+ core,
+ plugins,
+ };
+ } else {
+ statusInfo = calculateLegacyStatus({
+ overall,
+ core,
+ plugins,
+ versionWithoutSnapshot,
+ });
+ }
+
+ const lastMetrics = await metrics.getOpsMetrics$().pipe(first()).toPromise();
+
+ const body: StatusHttpBody = {
+ name: config.serverName,
+ uuid: config.uuid,
+ version: {
+ number: versionWithoutSnapshot,
+ build_hash: buildSha,
+ build_number: buildNum,
+ build_snapshot: SNAPSHOT_POSTFIX.test(version),
+ },
+ status: statusInfo,
+ metrics: {
+ last_updated: lastMetrics.collected_at.toISOString(),
+ collection_interval_in_millis: metrics.collectionInterval,
+ os: lastMetrics.os,
+ process: lastMetrics.process,
+ response_times: lastMetrics.response_times,
+ concurrent_connections: lastMetrics.concurrent_connections,
+ requests: {
+ ...lastMetrics.requests,
+ status_codes: lastMetrics.requests.statusCodes,
+ },
+ },
+ };
+
+ return res.ok({ body });
+ }
+ );
+};
diff --git a/src/core/server/status/status_service.mock.ts b/src/core/server/status/status_service.mock.ts
index 930ee2970cf55..0ee2d03229a78 100644
--- a/src/core/server/status/status_service.mock.ts
+++ b/src/core/server/status/status_service.mock.ts
@@ -43,6 +43,7 @@ const createSetupContractMock = () => {
set: jest.fn(),
dependencies$: new BehaviorSubject({}),
derivedStatus$: new BehaviorSubject(available),
+ isStatusPageAnonymous: jest.fn().mockReturnValue(false),
};
return setupContract;
diff --git a/src/core/server/status/status_service.test.ts b/src/core/server/status/status_service.test.ts
index dcb1e0a559f5d..afacaff044b6f 100644
--- a/src/core/server/status/status_service.test.ts
+++ b/src/core/server/status/status_service.test.ts
@@ -24,6 +24,9 @@ import { StatusService } from './status_service';
import { first } from 'rxjs/operators';
import { mockCoreContext } from '../core_context.mock';
import { ServiceStatusLevelSnapshotSerializer } from './test_utils';
+import { environmentServiceMock } from '../environment/environment_service.mock';
+import { httpServiceMock } from '../http/http_service.mock';
+import { metricsServiceMock } from '../metrics/metrics_service.mock';
expect.addSnapshotSerializer(ServiceStatusLevelSnapshotSerializer);
@@ -44,18 +47,36 @@ describe('StatusService', () => {
summary: 'This is degraded!',
};
+ type SetupDeps = Parameters[0];
+ const setupDeps = (overrides: Partial): SetupDeps => {
+ return {
+ elasticsearch: {
+ status$: of(available),
+ },
+ savedObjects: {
+ status$: of(available),
+ },
+ pluginDependencies: new Map(),
+ environment: environmentServiceMock.createSetupContract(),
+ http: httpServiceMock.createInternalSetupContract(),
+ metrics: metricsServiceMock.createInternalSetupContract(),
+ ...overrides,
+ };
+ };
+
describe('setup', () => {
describe('core$', () => {
it('rolls up core status observables into single observable', async () => {
- const setup = await service.setup({
- elasticsearch: {
- status$: of(available),
- },
- savedObjects: {
- status$: of(degraded),
- },
- pluginDependencies: new Map(),
- });
+ const setup = await service.setup(
+ setupDeps({
+ elasticsearch: {
+ status$: of(available),
+ },
+ savedObjects: {
+ status$: of(degraded),
+ },
+ })
+ );
expect(await setup.core$.pipe(first()).toPromise()).toEqual({
elasticsearch: available,
savedObjects: degraded,
@@ -63,15 +84,16 @@ describe('StatusService', () => {
});
it('replays last event', async () => {
- const setup = await service.setup({
- elasticsearch: {
- status$: of(available),
- },
- savedObjects: {
- status$: of(degraded),
- },
- pluginDependencies: new Map(),
- });
+ const setup = await service.setup(
+ setupDeps({
+ elasticsearch: {
+ status$: of(available),
+ },
+ savedObjects: {
+ status$: of(degraded),
+ },
+ })
+ );
const subResult1 = await setup.core$.pipe(first()).toPromise();
const subResult2 = await setup.core$.pipe(first()).toPromise();
const subResult3 = await setup.core$.pipe(first()).toPromise();
@@ -92,15 +114,16 @@ describe('StatusService', () => {
it('does not emit duplicate events', async () => {
const elasticsearch$ = new BehaviorSubject(available);
const savedObjects$ = new BehaviorSubject(degraded);
- const setup = await service.setup({
- elasticsearch: {
- status$: elasticsearch$,
- },
- savedObjects: {
- status$: savedObjects$,
- },
- pluginDependencies: new Map(),
- });
+ const setup = await service.setup(
+ setupDeps({
+ elasticsearch: {
+ status$: elasticsearch$,
+ },
+ savedObjects: {
+ status$: savedObjects$,
+ },
+ })
+ );
const statusUpdates: CoreStatus[] = [];
const subscription = setup.core$.subscribe((status) => statusUpdates.push(status));
@@ -155,15 +178,16 @@ describe('StatusService', () => {
describe('overall$', () => {
it('exposes an overall summary', async () => {
- const setup = await service.setup({
- elasticsearch: {
- status$: of(degraded),
- },
- savedObjects: {
- status$: of(degraded),
- },
- pluginDependencies: new Map(),
- });
+ const setup = await service.setup(
+ setupDeps({
+ elasticsearch: {
+ status$: of(degraded),
+ },
+ savedObjects: {
+ status$: of(degraded),
+ },
+ })
+ );
expect(await setup.overall$.pipe(first()).toPromise()).toMatchObject({
level: ServiceStatusLevels.degraded,
summary: '[2] services are degraded',
@@ -171,15 +195,16 @@ describe('StatusService', () => {
});
it('replays last event', async () => {
- const setup = await service.setup({
- elasticsearch: {
- status$: of(degraded),
- },
- savedObjects: {
- status$: of(degraded),
- },
- pluginDependencies: new Map(),
- });
+ const setup = await service.setup(
+ setupDeps({
+ elasticsearch: {
+ status$: of(degraded),
+ },
+ savedObjects: {
+ status$: of(degraded),
+ },
+ })
+ );
const subResult1 = await setup.overall$.pipe(first()).toPromise();
const subResult2 = await setup.overall$.pipe(first()).toPromise();
const subResult3 = await setup.overall$.pipe(first()).toPromise();
@@ -200,15 +225,16 @@ describe('StatusService', () => {
it('does not emit duplicate events', async () => {
const elasticsearch$ = new BehaviorSubject(available);
const savedObjects$ = new BehaviorSubject(degraded);
- const setup = await service.setup({
- elasticsearch: {
- status$: elasticsearch$,
- },
- savedObjects: {
- status$: savedObjects$,
- },
- pluginDependencies: new Map(),
- });
+ const setup = await service.setup(
+ setupDeps({
+ elasticsearch: {
+ status$: elasticsearch$,
+ },
+ savedObjects: {
+ status$: savedObjects$,
+ },
+ })
+ );
const statusUpdates: ServiceStatus[] = [];
const subscription = setup.overall$.subscribe((status) => statusUpdates.push(status));
@@ -256,15 +282,16 @@ describe('StatusService', () => {
it('debounces events in quick succession', async () => {
const savedObjects$ = new BehaviorSubject(available);
- const setup = await service.setup({
- elasticsearch: {
- status$: new BehaviorSubject(available),
- },
- savedObjects: {
- status$: savedObjects$,
- },
- pluginDependencies: new Map(),
- });
+ const setup = await service.setup(
+ setupDeps({
+ elasticsearch: {
+ status$: new BehaviorSubject(available),
+ },
+ savedObjects: {
+ status$: savedObjects$,
+ },
+ })
+ );
const statusUpdates: ServiceStatus[] = [];
const subscription = setup.overall$.subscribe((status) => statusUpdates.push(status));
diff --git a/src/core/server/status/status_service.ts b/src/core/server/status/status_service.ts
index 8fe65eddb61d3..9acf93f2f8197 100644
--- a/src/core/server/status/status_service.ts
+++ b/src/core/server/status/status_service.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { Observable, combineLatest } from 'rxjs';
+import { Observable, combineLatest, Subscription } from 'rxjs';
import { map, distinctUntilChanged, shareReplay, take, debounceTime } from 'rxjs/operators';
import { isDeepStrictEqual } from 'util';
@@ -25,8 +25,12 @@ import { CoreService } from '../../types';
import { CoreContext } from '../core_context';
import { Logger } from '../logging';
import { InternalElasticsearchServiceSetup } from '../elasticsearch';
+import { InternalHttpServiceSetup } from '../http';
import { InternalSavedObjectsServiceSetup } from '../saved_objects';
import { PluginName } from '../plugins';
+import { InternalMetricsServiceSetup } from '../metrics';
+import { registerStatusRoute } from './routes';
+import { InternalEnvironmentServiceSetup } from '../environment';
import { config, StatusConfigType } from './status_config';
import { ServiceStatus, CoreStatus, InternalStatusServiceSetup } from './types';
@@ -35,7 +39,10 @@ import { PluginsStatusService } from './plugins_status';
interface SetupDeps {
elasticsearch: Pick;
+ environment: InternalEnvironmentServiceSetup;
pluginDependencies: ReadonlyMap;
+ http: InternalHttpServiceSetup;
+ metrics: InternalMetricsServiceSetup;
savedObjects: Pick;
}
@@ -44,13 +51,21 @@ export class StatusService implements CoreService {
private readonly config$: Observable;
private pluginsStatus?: PluginsStatusService;
+ private overallSubscription?: Subscription;
- constructor(coreContext: CoreContext) {
+ constructor(private readonly coreContext: CoreContext) {
this.logger = coreContext.logger.get('status');
this.config$ = coreContext.configService.atPath(config.path);
}
- public async setup({ elasticsearch, pluginDependencies, savedObjects }: SetupDeps) {
+ public async setup({
+ elasticsearch,
+ pluginDependencies,
+ http,
+ metrics,
+ savedObjects,
+ environment,
+ }: SetupDeps) {
const statusConfig = await this.config$.pipe(take(1)).toPromise();
const core$ = this.setupCoreStatus({ elasticsearch, savedObjects });
this.pluginsStatus = new PluginsStatusService({ core$, pluginDependencies });
@@ -73,6 +88,26 @@ export class StatusService implements CoreService {
shareReplay(1)
);
+ // Create an unused subscription to ensure all underlying lazy observables are started.
+ this.overallSubscription = overall$.subscribe();
+
+ const router = http.createRouter('');
+ registerStatusRoute({
+ router,
+ config: {
+ allowAnonymous: statusConfig.allowAnonymous,
+ packageInfo: this.coreContext.env.packageInfo,
+ serverName: http.getServerInfo().name,
+ uuid: environment.instanceUuid,
+ },
+ metrics,
+ status: {
+ overall$,
+ plugins$: this.pluginsStatus.getAll$(),
+ core$,
+ },
+ });
+
return {
core$,
overall$,
@@ -87,7 +122,12 @@ export class StatusService implements CoreService {
public start() {}
- public stop() {}
+ public stop() {
+ if (this.overallSubscription) {
+ this.overallSubscription.unsubscribe();
+ this.overallSubscription = undefined;
+ }
+ }
private setupCoreStatus({
elasticsearch,
diff --git a/src/core/server/status/types.ts b/src/core/server/status/types.ts
index 9fa33a8c6d40c..8efaede79e9d4 100644
--- a/src/core/server/status/types.ts
+++ b/src/core/server/status/types.ts
@@ -71,6 +71,9 @@ export const ServiceStatusLevels = deepFreeze({
available: {
toString: () => 'available',
valueOf: () => 0,
+ toJSON() {
+ return this.toString();
+ },
},
/**
* Some features may not be working.
@@ -78,6 +81,9 @@ export const ServiceStatusLevels = deepFreeze({
degraded: {
toString: () => 'degraded',
valueOf: () => 1,
+ toJSON() {
+ return this.toString();
+ },
},
/**
* The service is unavailable, but other functions that do not depend on this service should work.
@@ -85,6 +91,9 @@ export const ServiceStatusLevels = deepFreeze({
unavailable: {
toString: () => 'unavailable',
valueOf: () => 2,
+ toJSON() {
+ return this.toString();
+ },
},
/**
* Block all user functions and display the status page, reserved for Core services only.
@@ -92,6 +101,9 @@ export const ServiceStatusLevels = deepFreeze({
critical: {
toString: () => 'critical',
valueOf: () => 3,
+ toJSON() {
+ return this.toString();
+ },
},
});
@@ -217,11 +229,17 @@ export interface StatusServiceSetup {
* through the dependency tree
*/
derivedStatus$: Observable;
+
+ /**
+ * Whether or not the status HTTP APIs are available to unauthenticated users when an authentication provider is
+ * present.
+ */
+ isStatusPageAnonymous: () => boolean;
}
/** @internal */
-export interface InternalStatusServiceSetup extends Pick {
- isStatusPageAnonymous: () => boolean;
+export interface InternalStatusServiceSetup
+ extends Pick {
// Namespaced under `plugins` key to improve clarity that these are APIs for plugins specifically.
plugins: {
set(plugin: PluginName, status$: Observable): void;
diff --git a/src/core/utils/context.mock.ts b/src/core/utils/context.mock.ts
index de844f3f0f07d..273d64ec8f822 100644
--- a/src/core/utils/context.mock.ts
+++ b/src/core/utils/context.mock.ts
@@ -21,15 +21,13 @@ import { IContextContainer } from './context';
export type ContextContainerMock = jest.Mocked>;
-const createContextMock = () => {
+const createContextMock = (mockContext = {}) => {
const contextMock: ContextContainerMock = {
registerContext: jest.fn(),
- createHandler: jest.fn((id, handler) => (...args: any[]) =>
- Promise.resolve(handler({}, ...args))
- ),
+ createHandler: jest.fn(),
};
contextMock.createHandler.mockImplementation((pluginId, handler) => (...args) =>
- handler({}, ...args)
+ handler(mockContext, ...args)
);
return contextMock;
};
diff --git a/src/core/utils/default_app_categories.ts b/src/core/utils/default_app_categories.ts
index 1fb7c284c0dfd..809aaddb74172 100644
--- a/src/core/utils/default_app_categories.ts
+++ b/src/core/utils/default_app_categories.ts
@@ -18,9 +18,10 @@
*/
import { i18n } from '@kbn/i18n';
+import { AppCategory } from '../types';
/** @internal */
-export const DEFAULT_APP_CATEGORIES = Object.freeze({
+export const DEFAULT_APP_CATEGORIES: Record = Object.freeze({
kibana: {
id: 'kibana',
label: i18n.translate('core.ui.kibanaNavList.label', {
@@ -59,5 +60,6 @@ export const DEFAULT_APP_CATEGORIES = Object.freeze({
defaultMessage: 'Management',
}),
order: 5000,
+ euiIconType: 'managementApp',
},
});
diff --git a/src/dev/build/tasks/os_packages/docker_generator/run.ts b/src/dev/build/tasks/os_packages/docker_generator/run.ts
index 362c34d416743..19487efe1366c 100644
--- a/src/dev/build/tasks/os_packages/docker_generator/run.ts
+++ b/src/dev/build/tasks/os_packages/docker_generator/run.ts
@@ -40,7 +40,7 @@ export async function runDockerGenerator(
ubi: boolean = false
) {
// UBI var config
- const baseOSImage = ubi ? 'registry.access.redhat.com/ubi8/ubi-minimal:latest' : 'centos:8';
+ const baseOSImage = ubi ? 'docker.elastic.co/ubi8/ubi-minimal:latest' : 'centos:8';
const ubiVersionTag = 'ubi8';
const ubiImageFlavor = ubi ? `-${ubiVersionTag}` : '';
diff --git a/src/dev/code_coverage/ingest_coverage/team_assignment/ingestion_pipeline_painless.json b/src/dev/code_coverage/ingest_coverage/team_assignment/ingestion_pipeline_painless.json
index 30e78635ec2e9..017d208133cdc 100644
--- a/src/dev/code_coverage/ingest_coverage/team_assignment/ingestion_pipeline_painless.json
+++ b/src/dev/code_coverage/ingest_coverage/team_assignment/ingestion_pipeline_painless.json
@@ -1 +1 @@
-{"description":"Kibana code coverage team assignments","processors":[{"script":{"lang":"painless","source":"\n String path = ctx.coveredFilePath; \n if (path.indexOf('src/legacy/core_plugins/kibana/') == 0) {\n\n if (path.indexOf('src/legacy/core_plugins/kibana/common/utils') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/kibana/migrations') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/kibana/public') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/kibana/public/dashboard/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/kibana/public/dev_tools/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/kibana/public/discover/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/kibana/public/home') == 0) ctx.team = 'kibana-core-ui';\n else if (path.indexOf('src/legacy/core_plugins/kibana/public/home/np_ready/') == 0) ctx.team = 'kibana-core-ui';\n else if (path.indexOf('src/legacy/core_plugins/kibana/public/local_application_service/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/kibana/public/management/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/core_plugins/kibana/server/lib') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/core_plugins/kibana/server/lib/management/saved_objects') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/core_plugins/kibana/server/routes/api/management/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/core_plugins/kibana/server/routes/api/import/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/core_plugins/kibana/server/routes/api/export/') == 0) ctx.team = 'kibana-platform';\n else ctx.team = 'unknown';\n\n } else if (path.indexOf('src/legacy/core_plugins/') == 0) {\n\n if (path.indexOf('src/legacy/core_plugins/apm_oss/') == 0) ctx.team = 'apm-ui';\n else if (path.indexOf('src/legacy/core_plugins/console_legacy') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/elasticsearch') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/core_plugins/embeddable_api/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/core_plugins/input_control_vis') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/interpreter/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/core_plugins/kibana_react/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/core_plugins/newsfeed') == 0) ctx.team = 'kibana-core-ui';\n else if (path.indexOf('src/legacy/core_plugins/region_map') == 0) ctx.team = 'maps';\n else if (path.indexOf('src/legacy/core_plugins/status_page/public') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/core_plugins/testbed') == 0) ctx.team = 'kibana-platform';\n // else if (path.indexOf('src/legacy/core_plugins/tests_bundle/') == 0) ctx.team = 'kibana-platform';\n \n else if (path.indexOf('src/legacy/core_plugins/tile_map') == 0) ctx.team = 'maps';\n else if (path.indexOf('src/legacy/core_plugins/timelion') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/ui_metric/') == 0) ctx.team = 'pulse';\n else if (path.indexOf('src/legacy/core_plugins/vis_type_tagcloud') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/vis_type_vega') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/vis_type_vislib/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/visualizations/') == 0) ctx.team = 'kibana-app-arch';\n else ctx.team = 'unknown';\n\n } else if (path.indexOf('src/legacy/server/') == 0) {\n\n if (path.indexOf('src/legacy/server/config/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/server/http/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/server/i18n/') == 0) ctx.team = 'kibana-localization';\n else if (path.indexOf('src/legacy/server/index_patterns/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/server/keystore/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('src/legacy/server/logging/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/server/pid/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('src/legacy/server/sample_data/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/server/sass/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('src/legacy/server/saved_objects/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/server/status/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/server/url_shortening/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/server/utils/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('src/legacy/server/warnings/') == 0) ctx.team = 'kibana-operations';\n else ctx.team = 'unknown';\n\n } else if (path.indexOf('src/legacy/ui') == 0) {\n\n if (path.indexOf('src/legacy/ui/public/field_editor') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/ui/public/timefilter') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/ui/public/management') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/ui/public/state_management') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/ui/public/new_platform') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/ui/public/plugin_discovery') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/ui/public/chrome') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/ui/public/notify') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/ui/public/documentation_links') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/ui/public/autoload') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/ui/public/capabilities') == 0) ctx.team = 'kibana-security';\n else if (path.indexOf('src/legacy/ui/public/apm') == 0) ctx.team = 'apm-ui';\n\n } else if (path.indexOf('src/plugins/') == 0) {\n\n if (path.indexOf('src/plugins/advanced_settings/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/apm_oss/') == 0) ctx.team = 'apm-ui';\n else if (path.indexOf('src/plugins/bfetch/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/charts/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/charts/public/static/color_maps') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/plugins/console/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('src/plugins/dashboard/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/plugins/data/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/dev_tools/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('src/plugins/discover/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/plugins/embeddable/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/es_ui_shared/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('src/plugins/expressions/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/home/public') == 0) ctx.team = 'kibana-core-ui';\n else if (path.indexOf('src/plugins/home/server/tutorials') == 0) ctx.team = 'observability';\n else if (path.indexOf('src/plugins/home/server/services/') == 0) ctx.team = 'kibana-core-ui';\n else if (path.indexOf('src/plugins/home/') == 0) ctx.team = 'kibana-core-ui';\n else if (path.indexOf('src/plugins/index_pattern_management/public/service') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/index_pattern_management/public') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/plugins/input_control_vis/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/plugins/inspector/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/kibana_legacy/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/plugins/kibana_react/public/code_editor') == 0) ctx.team = 'kibana-canvas';\n else if (path.indexOf('src/plugins/kibana_react/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/kibana_utils/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/management/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/kibana_usage_collection/') == 0) ctx.team = 'pulse';\n else if (path.indexOf('src/plugins/legacy_export/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/plugins/maps_legacy/') == 0) ctx.team = 'maps';\n else if (path.indexOf('src/plugins/region_map/') == 0) ctx.team = 'maps';\n else if (path.indexOf('src/plugins/tile_map/') == 0) ctx.team = 'maps';\n else if (path.indexOf('src/plugins/timelion') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/plugins/navigation/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/newsfeed') == 0) ctx.team = 'kibana-core-ui';\n else if (path.indexOf('src/plugins/saved_objects_management/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/plugins/saved_objects/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/share/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/status_page/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/plugins/telemetry') == 0) ctx.team = 'pulse';\n else if (path.indexOf('src/plugins/testbed/server/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/plugins/ui_actions/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/usage_collection/') == 0) ctx.team = 'pulse';\n else if (path.indexOf('src/plugins/vis_default_editor') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/vis_type') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/plugins/visualizations/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/visualize/') == 0) ctx.team = 'kibana-app';\n else ctx.team = 'unknown';\n\n } else if (path.indexOf('x-pack/legacy/') == 0) {\n\n if (path.indexOf('x-pack/legacy/plugins/actions/') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/legacy/plugins/alerting/') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/legacy/plugins/apm/') == 0) ctx.team = 'apm-ui';\n else if (path.indexOf('x-pack/legacy/plugins/beats_management/') == 0) ctx.team = 'beats';\n else if (path.indexOf('x-pack/legacy/plugins/canvas/') == 0) ctx.team = 'kibana-canvas';\n else if (path.indexOf('x-pack/legacy/plugins/cross_cluster_replication/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/legacy/plugins/dashboard_mode/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('x-pack/legacy/plugins/encrypted_saved_objects/') == 0) ctx.team = 'kibana-security';\n else if (path.indexOf('x-pack/legacy/plugins/index_management/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/legacy/plugins/infra/') == 0) ctx.team = 'logs-metrics-ui';\n else if (path.indexOf('x-pack/legacy/plugins/ingest_manager/') == 0) ctx.team = 'ingest-management';\n else if (path.indexOf('x-pack/legacy/plugins/license_management/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/legacy/plugins/maps/') == 0) ctx.team = 'kibana-gis';\n else if (path.indexOf('x-pack/legacy/plugins/ml/') == 0) ctx.team = 'ml-ui';\n else if (path.indexOf('x-pack/legacy/plugins/monitoring/') == 0) ctx.team = 'stack-monitoring-ui';\n else if (path.indexOf('x-pack/legacy/plugins/reporting') == 0) ctx.team = 'kibana-reporting';\n else if (path.indexOf('x-pack/legacy/plugins/rollup/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/legacy/plugins/security/') == 0) ctx.team = 'kibana-security';\n else if (path.indexOf('x-pack/legacy/plugins/siem/') == 0) ctx.team = 'siem';\n else if (path.indexOf('x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules') == 0) ctx.team = 'security-intelligence-analytics';\n else if (path.indexOf('x-pack/legacy/plugins/snapshot_restore/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/legacy/plugins/spaces/') == 0) ctx.team = 'kibana-security';\n else if (path.indexOf('x-pack/legacy/plugins/task_manager') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/legacy/plugins/triggers_actions_ui/') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/legacy/plugins/upgrade_assistant/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/legacy/plugins/uptime') == 0) ctx.team = 'uptime';\n else if (path.indexOf('x-pack/legacy/plugins/xpack_main/server/') == 0) ctx.team = 'kibana-platform';\n\n else if (path.indexOf('x-pack/legacy/server/lib/create_router/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/legacy/server/lib/check_license/') == 0) ctx.team = 'es-ui'; \n else if (path.indexOf('x-pack/legacy/server/lib/') == 0) ctx.team = 'kibana-platform'; \n else ctx.team = 'unknown';\n\n } else if (path.indexOf('x-pack/plugins/') == 0) {\n\n if (path.indexOf('x-pack/plugins/actions/') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/plugins/advanced_ui_actions/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('x-pack/plugins/alerts') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/plugins/alerting_builtins') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/plugins/apm/') == 0) ctx.team = 'apm-ui';\n else if (path.indexOf('x-pack/plugins/beats_management/') == 0) ctx.team = 'beats';\n else if (path.indexOf('x-pack/plugins/canvas/') == 0) ctx.team = 'kibana-canvas';\n else if (path.indexOf('x-pack/plugins/case') == 0) ctx.team = 'siem';\n else if (path.indexOf('x-pack/plugins/cloud/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('x-pack/plugins/code/') == 0) ctx.team = 'code';\n else if (path.indexOf('x-pack/plugins/console_extensions/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/cross_cluster_replication/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/dashboard_enhanced') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('x-pack/plugins/dashboard_mode') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('x-pack/plugins/discover_enhanced') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('x-pack/plugins/embeddable_enhanced') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('x-pack/plugins/data_enhanced/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('x-pack/plugins/drilldowns/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('x-pack/plugins/encrypted_saved_objects/') == 0) ctx.team = 'kibana-security';\n else if (path.indexOf('x-pack/plugins/endpoint/') == 0) ctx.team = 'endpoint-app-team';\n else if (path.indexOf('x-pack/plugins/es_ui_shared/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/event_log/') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/plugins/features/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('x-pack/plugins/file_upload') == 0) ctx.team = 'kibana-gis';\n else if (path.indexOf('x-pack/plugins/global_search') == 0) ctx.team = 'kibana-platform';\n \n else if (path.indexOf('x-pack/plugins/graph/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('x-pack/plugins/grokdebugger/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/index_lifecycle_management/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/index_management/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/infra/') == 0) ctx.team = 'logs-metrics-ui';\n else if (path.indexOf('x-pack/plugins/ingest_manager/') == 0) ctx.team = 'ingest-management';\n else if (path.indexOf('x-pack/plugins/ingest_pipelines/') == 0) ctx.team = 'es-ui';\n \n else if (path.indexOf('x-pack/plugins/lens/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('x-pack/plugins/license_management/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/licensing/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('x-pack/plugins/lists/') == 0) ctx.team = 'siem';\n else if (path.indexOf('x-pack/plugins/logstash') == 0) ctx.team = 'logstash';\n else if (path.indexOf('x-pack/plugins/maps/') == 0) ctx.team = 'kibana-gis';\n else if (path.indexOf('x-pack/plugins/maps_legacy_licensing') == 0) ctx.team = 'maps';\n else if (path.indexOf('x-pack/plugins/ml/') == 0) ctx.team = 'ml-ui';\n else if (path.indexOf('x-pack/plugins/monitoring') == 0) ctx.team = 'stack-monitoring-ui';\n else if (path.indexOf('x-pack/plugins/observability/') == 0) ctx.team = 'apm-ui';\n else if (path.indexOf('x-pack/plugins/oss_telemetry/') == 0) ctx.team = 'pulse';\n else if (path.indexOf('x-pack/plugins/painless_lab/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/remote_clusters/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/reporting') == 0) ctx.team = 'kibana-reporting';\n else if (path.indexOf('x-pack/plugins/rollup/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/searchprofiler/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/security/') == 0) ctx.team = 'kibana-security';\n else if (path.indexOf('x-pack/plugins/security_solution/') == 0) ctx.team = 'siem';\n \n else if (path.indexOf('x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules') == 0) ctx.team = 'security-intelligence-analytics';\n else if (path.indexOf('x-pack/plugins/siem/') == 0) ctx.team = 'siem';\n else if (path.indexOf('x-pack/plugins/snapshot_restore/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/spaces/') == 0) ctx.team = 'kibana-security';\n else if (path.indexOf('x-pack/plugins/task_manager/') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/plugins/telemetry_collection_xpack/') == 0) ctx.team = 'pulse';\n else if (path.indexOf('x-pack/plugins/transform/') == 0) ctx.team = 'ml-ui';\n else if (path.indexOf('x-pack/plugins/translations/') == 0) ctx.team = 'kibana-localization';\n else if (path.indexOf('x-pack/plugins/triggers_actions_ui/') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/plugins/upgrade_assistant/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/ui_actions_enhanced') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('x-pack/plugins/uptime') == 0) ctx.team = 'uptime';\n \n else if (path.indexOf('x-pack/plugins/watcher/') == 0) ctx.team = 'es-ui';\n else ctx.team = 'unknown';\n\n } else if (path.indexOf('packages') == 0) {\n\n if (path.indexOf('packages/kbn-analytics/') == 0) ctx.team = 'pulse';\n else if (path.indexOf('packages/kbn-babel') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('packages/kbn-config-schema/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('packages/elastic-datemath') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('packages/kbn-dev-utils') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('packages/kbn-es/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('packages/kbn-eslint') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('packages/kbn-expect') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('packages/kbn-i18n/') == 0) ctx.team = 'kibana-localization';\n else if (path.indexOf('packages/kbn-interpreter/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('packages/kbn-optimizer/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('packages/kbn-pm/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('packages/kbn-test/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('packages/kbn-test-subj-selector/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('packages/kbn-ui-framework/') == 0) ctx.team = 'kibana-design';\n else if (path.indexOf('packages/kbn-ui-shared-deps/') == 0) ctx.team = 'kibana-operations';\n else ctx.team = 'unknown';\n\n } else {\n\n if (path.indexOf('config/kibana.yml') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/apm.js') == 0) ctx.team = 'apm-ui';\n else if (path.indexOf('src/core/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/core/public/i18n/') == 0) ctx.team = 'kibana-localization';\n else if (path.indexOf('src/core/server/csp/') == 0) ctx.team = 'kibana-security';\n else if (path.indexOf('src/dev/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('src/dev/i18n/') == 0) ctx.team = 'kibana-localization';\n else if (path.indexOf('src/dev/run_check_published_api_changes.ts') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('packages/kbn-es-archiver/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('src/optimize/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('src/setup_node_env/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('src/test_utils/') == 0) ctx.team = 'kibana-operations'; \n else ctx.team = 'unknown';\n }"}}]}
+{"description":"Kibana code coverage team assignments","processors":[{"script":{"lang":"painless","source":"\n String path = ctx.coveredFilePath; \n if (path.indexOf('src/legacy/core_plugins/kibana/') == 0) {\n\n if (path.indexOf('src/legacy/core_plugins/kibana/common/utils') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/kibana/migrations') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/kibana/public') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/kibana/public/dashboard/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/kibana/public/dev_tools/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/kibana/public/discover/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/kibana/public/home') == 0) ctx.team = 'kibana-core-ui';\n else if (path.indexOf('src/legacy/core_plugins/kibana/public/home/np_ready/') == 0) ctx.team = 'kibana-core-ui';\n else if (path.indexOf('src/legacy/core_plugins/kibana/public/local_application_service/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/kibana/public/management/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/core_plugins/kibana/server/lib') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/core_plugins/kibana/server/lib/management/saved_objects') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/core_plugins/kibana/server/routes/api/management/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/core_plugins/kibana/server/routes/api/import/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/core_plugins/kibana/server/routes/api/export/') == 0) ctx.team = 'kibana-platform';\n else ctx.team = 'unknown';\n\n } else if (path.indexOf('src/legacy/core_plugins/') == 0) {\n\n if (path.indexOf('src/legacy/core_plugins/apm_oss/') == 0) ctx.team = 'apm-ui';\n else if (path.indexOf('src/legacy/core_plugins/console_legacy') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/elasticsearch') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/core_plugins/embeddable_api/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/core_plugins/input_control_vis') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/interpreter/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/core_plugins/kibana_react/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/core_plugins/newsfeed') == 0) ctx.team = 'kibana-core-ui';\n else if (path.indexOf('src/legacy/core_plugins/region_map') == 0) ctx.team = 'maps';\n else if (path.indexOf('src/legacy/core_plugins/status_page/public') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/core_plugins/testbed') == 0) ctx.team = 'kibana-platform';\n // else if (path.indexOf('src/legacy/core_plugins/tests_bundle/') == 0) ctx.team = 'kibana-platform';\n \n else if (path.indexOf('src/legacy/core_plugins/tile_map') == 0) ctx.team = 'maps';\n else if (path.indexOf('src/legacy/core_plugins/timelion') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/ui_metric/') == 0) ctx.team = 'pulse';\n else if (path.indexOf('src/legacy/core_plugins/vis_type_tagcloud') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/vis_type_vega') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/vis_type_vislib/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/core_plugins/visualizations/') == 0) ctx.team = 'kibana-app-arch';\n else ctx.team = 'unknown';\n\n } else if (path.indexOf('src/legacy/server/') == 0) {\n\n if (path.indexOf('src/legacy/server/config/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/server/http/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/server/i18n/') == 0) ctx.team = 'kibana-localization';\n else if (path.indexOf('src/legacy/server/index_patterns/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/server/keystore/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('src/legacy/server/logging/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/server/pid/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('src/legacy/server/sample_data/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/server/sass/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('src/legacy/server/saved_objects/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/server/status/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/server/url_shortening/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/server/utils/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('src/legacy/server/warnings/') == 0) ctx.team = 'kibana-operations';\n else ctx.team = 'unknown';\n\n } else if (path.indexOf('src/legacy/ui') == 0) {\n\n if (path.indexOf('src/legacy/ui/public/field_editor') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/ui/public/timefilter') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/ui/public/management') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/legacy/ui/public/state_management') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/legacy/ui/public/new_platform') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/ui/public/plugin_discovery') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/ui/public/chrome') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/ui/public/notify') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/ui/public/documentation_links') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/ui/public/autoload') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/legacy/ui/public/capabilities') == 0) ctx.team = 'kibana-security';\n else if (path.indexOf('src/legacy/ui/public/apm') == 0) ctx.team = 'apm-ui';\n\n } else if (path.indexOf('src/plugins/') == 0) {\n\n if (path.indexOf('src/plugins/advanced_settings/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/apm_oss/') == 0) ctx.team = 'apm-ui';\n else if (path.indexOf('src/plugins/bfetch/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/charts/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/charts/public/static/color_maps') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/plugins/console/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('src/plugins/dashboard/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/plugins/data/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/dev_tools/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('src/plugins/discover/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/plugins/embeddable/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/es_ui_shared/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('src/plugins/expressions/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/home/public') == 0) ctx.team = 'kibana-core-ui';\n else if (path.indexOf('src/plugins/home/server/tutorials') == 0) ctx.team = 'observability';\n else if (path.indexOf('src/plugins/home/server/services/') == 0) ctx.team = 'kibana-core-ui';\n else if (path.indexOf('src/plugins/home/') == 0) ctx.team = 'kibana-core-ui';\n else if (path.indexOf('src/plugins/index_pattern_management/public/service') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/index_pattern_management/public') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/plugins/input_control_vis/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/plugins/inspector/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/kibana_legacy/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/plugins/kibana_react/public/code_editor') == 0) ctx.team = 'kibana-canvas';\n else if (path.indexOf('src/plugins/kibana_react/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/kibana_utils/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/management/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/kibana_usage_collection/') == 0) ctx.team = 'pulse';\n else if (path.indexOf('src/plugins/legacy_export/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/plugins/maps_legacy/') == 0) ctx.team = 'maps';\n else if (path.indexOf('src/plugins/region_map/') == 0) ctx.team = 'maps';\n else if (path.indexOf('src/plugins/tile_map/') == 0) ctx.team = 'maps';\n else if (path.indexOf('src/plugins/timelion') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/plugins/navigation/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/newsfeed') == 0) ctx.team = 'kibana-core-ui';\n else if (path.indexOf('src/plugins/saved_objects_management/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/plugins/saved_objects/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/share/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/status_page/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/plugins/telemetry') == 0) ctx.team = 'pulse';\n else if (path.indexOf('src/plugins/testbed/server/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/plugins/ui_actions/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/usage_collection/') == 0) ctx.team = 'pulse';\n else if (path.indexOf('src/plugins/vis_default_editor') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/vis_type') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('src/plugins/visualizations/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('src/plugins/visualize/') == 0) ctx.team = 'kibana-app';\n else ctx.team = 'unknown';\n\n } else if (path.indexOf('x-pack/legacy/') == 0) {\n\n if (path.indexOf('x-pack/legacy/plugins/actions/') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/legacy/plugins/alerting/') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/legacy/plugins/apm/') == 0) ctx.team = 'apm-ui';\n else if (path.indexOf('x-pack/legacy/plugins/beats_management/') == 0) ctx.team = 'beats';\n else if (path.indexOf('x-pack/legacy/plugins/canvas/') == 0) ctx.team = 'kibana-canvas';\n else if (path.indexOf('x-pack/legacy/plugins/cross_cluster_replication/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/legacy/plugins/dashboard_mode/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('x-pack/legacy/plugins/encrypted_saved_objects/') == 0) ctx.team = 'kibana-security';\n else if (path.indexOf('x-pack/legacy/plugins/index_management/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/legacy/plugins/infra/') == 0) ctx.team = 'logs-metrics-ui';\n else if (path.indexOf('x-pack/legacy/plugins/ingest_manager/') == 0) ctx.team = 'ingest-management';\n else if (path.indexOf('x-pack/legacy/plugins/license_management/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/legacy/plugins/maps/') == 0) ctx.team = 'kibana-gis';\n else if (path.indexOf('x-pack/legacy/plugins/ml/') == 0) ctx.team = 'ml-ui';\n else if (path.indexOf('x-pack/legacy/plugins/monitoring/') == 0) ctx.team = 'stack-monitoring-ui';\n else if (path.indexOf('x-pack/legacy/plugins/reporting') == 0) ctx.team = 'kibana-reporting';\n else if (path.indexOf('x-pack/legacy/plugins/rollup/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/legacy/plugins/security/') == 0) ctx.team = 'kibana-security';\n else if (path.indexOf('x-pack/legacy/plugins/siem/') == 0) ctx.team = 'siem';\n else if (path.indexOf('x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules') == 0) ctx.team = 'security-intelligence-analytics';\n else if (path.indexOf('x-pack/legacy/plugins/snapshot_restore/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/legacy/plugins/task_manager') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/legacy/plugins/triggers_actions_ui/') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/legacy/plugins/upgrade_assistant/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/legacy/plugins/uptime') == 0) ctx.team = 'uptime';\n else if (path.indexOf('x-pack/legacy/plugins/xpack_main/server/') == 0) ctx.team = 'kibana-platform';\n\n else if (path.indexOf('x-pack/legacy/server/lib/create_router/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/legacy/server/lib/check_license/') == 0) ctx.team = 'es-ui'; \n else if (path.indexOf('x-pack/legacy/server/lib/') == 0) ctx.team = 'kibana-platform'; \n else ctx.team = 'unknown';\n\n } else if (path.indexOf('x-pack/plugins/') == 0) {\n\n if (path.indexOf('x-pack/plugins/actions/') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/plugins/advanced_ui_actions/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('x-pack/plugins/alerts') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/plugins/alerting_builtins') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/plugins/apm/') == 0) ctx.team = 'apm-ui';\n else if (path.indexOf('x-pack/plugins/beats_management/') == 0) ctx.team = 'beats';\n else if (path.indexOf('x-pack/plugins/canvas/') == 0) ctx.team = 'kibana-canvas';\n else if (path.indexOf('x-pack/plugins/case') == 0) ctx.team = 'siem';\n else if (path.indexOf('x-pack/plugins/cloud/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('x-pack/plugins/code/') == 0) ctx.team = 'code';\n else if (path.indexOf('x-pack/plugins/console_extensions/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/cross_cluster_replication/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/dashboard_enhanced') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('x-pack/plugins/dashboard_mode') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('x-pack/plugins/discover_enhanced') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('x-pack/plugins/embeddable_enhanced') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('x-pack/plugins/data_enhanced/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('x-pack/plugins/drilldowns/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('x-pack/plugins/encrypted_saved_objects/') == 0) ctx.team = 'kibana-security';\n else if (path.indexOf('x-pack/plugins/endpoint/') == 0) ctx.team = 'endpoint-app-team';\n else if (path.indexOf('x-pack/plugins/es_ui_shared/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/event_log/') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/plugins/features/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('x-pack/plugins/file_upload') == 0) ctx.team = 'kibana-gis';\n else if (path.indexOf('x-pack/plugins/global_search') == 0) ctx.team = 'kibana-platform';\n \n else if (path.indexOf('x-pack/plugins/graph/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('x-pack/plugins/grokdebugger/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/index_lifecycle_management/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/index_management/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/infra/') == 0) ctx.team = 'logs-metrics-ui';\n else if (path.indexOf('x-pack/plugins/ingest_manager/') == 0) ctx.team = 'ingest-management';\n else if (path.indexOf('x-pack/plugins/ingest_pipelines/') == 0) ctx.team = 'es-ui';\n \n else if (path.indexOf('x-pack/plugins/lens/') == 0) ctx.team = 'kibana-app';\n else if (path.indexOf('x-pack/plugins/license_management/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/licensing/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('x-pack/plugins/lists/') == 0) ctx.team = 'siem';\n else if (path.indexOf('x-pack/plugins/logstash') == 0) ctx.team = 'logstash';\n else if (path.indexOf('x-pack/plugins/maps/') == 0) ctx.team = 'kibana-gis';\n else if (path.indexOf('x-pack/plugins/maps_legacy_licensing') == 0) ctx.team = 'maps';\n else if (path.indexOf('x-pack/plugins/ml/') == 0) ctx.team = 'ml-ui';\n else if (path.indexOf('x-pack/plugins/monitoring') == 0) ctx.team = 'stack-monitoring-ui';\n else if (path.indexOf('x-pack/plugins/observability/') == 0) ctx.team = 'apm-ui';\n else if (path.indexOf('x-pack/plugins/oss_telemetry/') == 0) ctx.team = 'pulse';\n else if (path.indexOf('x-pack/plugins/painless_lab/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/remote_clusters/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/reporting') == 0) ctx.team = 'kibana-reporting';\n else if (path.indexOf('x-pack/plugins/rollup/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/searchprofiler/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/security/') == 0) ctx.team = 'kibana-security';\n else if (path.indexOf('x-pack/plugins/security_solution/') == 0) ctx.team = 'siem';\n \n else if (path.indexOf('x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules') == 0) ctx.team = 'security-intelligence-analytics';\n else if (path.indexOf('x-pack/plugins/siem/') == 0) ctx.team = 'siem';\n else if (path.indexOf('x-pack/plugins/snapshot_restore/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/spaces/') == 0) ctx.team = 'kibana-security';\n else if (path.indexOf('x-pack/plugins/task_manager/') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/plugins/telemetry_collection_xpack/') == 0) ctx.team = 'pulse';\n else if (path.indexOf('x-pack/plugins/transform/') == 0) ctx.team = 'ml-ui';\n else if (path.indexOf('x-pack/plugins/translations/') == 0) ctx.team = 'kibana-localization';\n else if (path.indexOf('x-pack/plugins/triggers_actions_ui/') == 0) ctx.team = 'kibana-alerting-services';\n else if (path.indexOf('x-pack/plugins/upgrade_assistant/') == 0) ctx.team = 'es-ui';\n else if (path.indexOf('x-pack/plugins/ui_actions_enhanced') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('x-pack/plugins/uptime') == 0) ctx.team = 'uptime';\n \n else if (path.indexOf('x-pack/plugins/watcher/') == 0) ctx.team = 'es-ui';\n else ctx.team = 'unknown';\n\n } else if (path.indexOf('packages') == 0) {\n\n if (path.indexOf('packages/kbn-analytics/') == 0) ctx.team = 'pulse';\n else if (path.indexOf('packages/kbn-babel') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('packages/kbn-config-schema/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('packages/elastic-datemath') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('packages/kbn-dev-utils') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('packages/kbn-es/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('packages/kbn-eslint') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('packages/kbn-expect') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('packages/kbn-i18n/') == 0) ctx.team = 'kibana-localization';\n else if (path.indexOf('packages/kbn-interpreter/') == 0) ctx.team = 'kibana-app-arch';\n else if (path.indexOf('packages/kbn-optimizer/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('packages/kbn-pm/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('packages/kbn-test/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('packages/kbn-test-subj-selector/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('packages/kbn-ui-framework/') == 0) ctx.team = 'kibana-design';\n else if (path.indexOf('packages/kbn-ui-shared-deps/') == 0) ctx.team = 'kibana-operations';\n else ctx.team = 'unknown';\n\n } else {\n\n if (path.indexOf('config/kibana.yml') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/apm.js') == 0) ctx.team = 'apm-ui';\n else if (path.indexOf('src/core/') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('src/core/public/i18n/') == 0) ctx.team = 'kibana-localization';\n else if (path.indexOf('src/core/server/csp/') == 0) ctx.team = 'kibana-security';\n else if (path.indexOf('src/dev/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('src/dev/i18n/') == 0) ctx.team = 'kibana-localization';\n else if (path.indexOf('src/dev/run_check_published_api_changes.ts') == 0) ctx.team = 'kibana-platform';\n else if (path.indexOf('packages/kbn-es-archiver/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('src/optimize/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('src/setup_node_env/') == 0) ctx.team = 'kibana-operations';\n else if (path.indexOf('src/test_utils/') == 0) ctx.team = 'kibana-operations'; \n else ctx.team = 'unknown';\n }"}}]}
diff --git a/src/dev/jest/config.js b/src/dev/jest/config.js
index 486c8563c5456..5d31db63773fa 100644
--- a/src/dev/jest/config.js
+++ b/src/dev/jest/config.js
@@ -25,7 +25,6 @@ export default {
'/src/plugins',
'/src/legacy/ui',
'/src/core',
- '/src/legacy/core_plugins',
'/src/legacy/server',
'/src/cli',
'/src/cli_keystore',
@@ -51,14 +50,11 @@ export default {
'packages/kbn-ui-framework/src/services/**/*.js',
'!packages/kbn-ui-framework/src/services/index.js',
'!packages/kbn-ui-framework/src/services/**/*/index.js',
- 'src/legacy/core_plugins/**/*.{js,mjs,jsx,ts,tsx}',
- '!src/legacy/core_plugins/**/{__test__,__snapshots__}/**/*',
],
moduleNameMapper: {
'@elastic/eui$': '/node_modules/@elastic/eui/test-env',
'@elastic/eui/lib/(.*)?': '/node_modules/@elastic/eui/test-env/$1',
'^src/plugins/(.*)': '/src/plugins/$1',
- '^plugins/([^/.]*)(.*)': '/src/legacy/core_plugins/$1/public$2',
'^uiExports/(.*)': '/src/dev/jest/mocks/file_mock.js',
'^test_utils/(.*)': '/src/test_utils/public/$1',
'^fixtures/(.*)': '/src/fixtures/$1',
diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js
index e22dc03cf57aa..ba58dcdfa4d58 100644
--- a/src/dev/precommit_hook/casing_check_config.js
+++ b/src/dev/precommit_hook/casing_check_config.js
@@ -132,11 +132,6 @@ export const REMOVE_EXTENSION = ['packages/kbn-plugin-generator/template/**/*.ej
* @type {Array}
*/
export const TEMPORARILY_IGNORED_PATHS = [
- 'src/legacy/core_plugins/console/public/src/directives/helpExample.txt',
- 'src/legacy/core_plugins/console/public/src/sense_editor/theme-sense-dark.js',
- 'src/legacy/core_plugins/tile_map/public/__tests__/scaledCircleMarkers.png',
- 'src/legacy/core_plugins/tile_map/public/__tests__/shadedCircleMarkers.png',
- 'src/legacy/core_plugins/tile_map/public/__tests__/shadedGeohashGrid.png',
'src/fixtures/config_upgrade_from_4.0.0_to_4.0.1-snapshot.json',
'src/core/server/core_app/assets/favicons/android-chrome-192x192.png',
'src/core/server/core_app/assets/favicons/android-chrome-256x256.png',
diff --git a/src/legacy/core_plugins/elasticsearch/index.d.ts b/src/legacy/core_plugins/elasticsearch/index.d.ts
deleted file mode 100644
index 83e7bb19e57ba..0000000000000
--- a/src/legacy/core_plugins/elasticsearch/index.d.ts
+++ /dev/null
@@ -1,526 +0,0 @@
-/*
- * 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.
- */
-
-import {
- Client as ESClient,
- GenericParams,
- // root params
- BulkIndexDocumentsParams,
- ClearScrollParams,
- CountParams,
- CreateDocumentParams,
- DeleteDocumentParams,
- DeleteDocumentByQueryParams,
- DeleteScriptParams,
- DeleteTemplateParams,
- ExistsParams,
- ExplainParams,
- FieldStatsParams,
- GetParams,
- GetResponse,
- GetScriptParams,
- GetSourceParams,
- GetTemplateParams,
- IndexDocumentParams,
- InfoParams,
- MGetParams,
- MSearchParams,
- MSearchTemplateParams,
- MTermVectorsParams,
- PingParams,
- PutScriptParams,
- PutTemplateParams,
- ReindexParams,
- ReindexRethrottleParams,
- RenderSearchTemplateParams,
- ScrollParams,
- SearchParams,
- SearchShardsParams,
- SearchTemplateParams,
- SuggestParams,
- TermvectorsParams,
- UpdateDocumentParams,
- UpdateDocumentByQueryParams,
- MGetResponse,
- MSearchResponse,
- SearchResponse,
- // cat
- CatAliasesParams,
- CatAllocationParams,
- CatFielddataParams,
- CatHealthParams,
- CatHelpParams,
- CatIndicesParams,
- CatCommonParams,
- CatRecoveryParams,
- CatSegmentsParams,
- CatShardsParams,
- CatSnapshotsParams,
- CatTasksParams,
- CatThreadPoolParams,
- // cluster
- ClusterAllocationExplainParams,
- ClusterGetSettingsParams,
- ClusterHealthParams,
- ClusterPendingTasksParams,
- ClusterPutSettingsParams,
- ClusterRerouteParams,
- ClusterStateParams,
- ClusterStatsParams,
- // indices
- IndicesAnalyzeParams,
- IndicesClearCacheParams,
- IndicesCloseParams,
- IndicesCreateParams,
- IndicesDeleteParams,
- IndicesDeleteAliasParams,
- IndicesDeleteTemplateParams,
- IndicesExistsParams,
- IndicesExistsAliasParams,
- IndicesExistsTemplateParams,
- IndicesExistsTypeParams,
- IndicesFlushParams,
- IndicesFlushSyncedParams,
- IndicesForcemergeParams,
- IndicesGetParams,
- IndicesGetAliasParams,
- IndicesGetFieldMappingParams,
- IndicesGetMappingParams,
- IndicesGetSettingsParams,
- IndicesGetTemplateParams,
- IndicesGetUpgradeParams,
- IndicesOpenParams,
- IndicesPutAliasParams,
- IndicesPutMappingParams,
- IndicesPutSettingsParams,
- IndicesPutTemplateParams,
- IndicesRecoveryParams,
- IndicesRefreshParams,
- IndicesRolloverParams,
- IndicesSegmentsParams,
- IndicesShardStoresParams,
- IndicesShrinkParams,
- IndicesStatsParams,
- IndicesUpdateAliasesParams,
- IndicesUpgradeParams,
- IndicesValidateQueryParams,
- // ingest
- IngestDeletePipelineParams,
- IngestGetPipelineParams,
- IngestPutPipelineParams,
- IngestSimulateParams,
- // nodes
- NodesHotThreadsParams,
- NodesInfoParams,
- NodesStatsParams,
- // snapshot
- SnapshotCreateParams,
- SnapshotCreateRepositoryParams,
- SnapshotDeleteParams,
- SnapshotDeleteRepositoryParams,
- SnapshotGetParams,
- SnapshotGetRepositoryParams,
- SnapshotRestoreParams,
- SnapshotStatusParams,
- SnapshotVerifyRepositoryParams,
- // tasks
- TasksCancelParams,
- TasksGetParams,
- TasksListParams,
-} from 'elasticsearch';
-
-export class Cluster {
- public callWithRequest: CallClusterWithRequest;
- public callWithInternalUser: CallCluster;
- constructor(config: ClusterConfig);
-}
-
-export interface ClusterConfig {
- [option: string]: any;
-}
-
-export interface Request {
- headers: RequestHeaders;
-}
-
-interface RequestHeaders {
- [name: string]: string;
-}
-
-interface AssistantAPIClientParams extends GenericParams {
- path: '/_migration/assistance';
- method: 'GET';
-}
-
-type MIGRATION_ASSISTANCE_INDEX_ACTION = 'upgrade' | 'reindex';
-type MIGRATION_DEPRECATION_LEVEL = 'none' | 'info' | 'warning' | 'critical';
-
-export interface AssistanceAPIResponse {
- indices: {
- [indexName: string]: {
- action_required: MIGRATION_ASSISTANCE_INDEX_ACTION;
- };
- };
-}
-
-interface DeprecationAPIClientParams extends GenericParams {
- path: '/_migration/deprecations';
- method: 'GET';
-}
-
-export interface DeprecationInfo {
- level: MIGRATION_DEPRECATION_LEVEL;
- message: string;
- url: string;
- details?: string;
-}
-
-export interface IndexSettingsDeprecationInfo {
- [indexName: string]: DeprecationInfo[];
-}
-
-export interface DeprecationAPIResponse {
- cluster_settings: DeprecationInfo[];
- ml_settings: DeprecationInfo[];
- node_settings: DeprecationInfo[];
- index_settings: IndexSettingsDeprecationInfo;
-}
-
-export interface CallClusterOptions {
- wrap401Errors?: boolean;
- signal?: AbortSignal;
-}
-
-export interface CallClusterWithRequest {
- /* eslint-disable */
- (request: Request, endpoint: 'bulk', params: BulkIndexDocumentsParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'clearScroll', params: ClearScrollParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'count', params: CountParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'create', params: CreateDocumentParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'delete', params: DeleteDocumentParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'deleteByQuery', params: DeleteDocumentByQueryParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'deleteScript', params: DeleteScriptParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'deleteTemplate', params: DeleteTemplateParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'exists', params: ExistsParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'explain', params: ExplainParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'fieldStats', params: FieldStatsParams, options?: CallClusterOptions): ReturnType;
- // Generic types cannot be properly looked up with ReturnType. Hard code these explicitly.
- (request: Request, endpoint: 'get', params: GetParams, options?: CallClusterOptions): Promise>;
- (request: Request, endpoint: 'getScript', params: GetScriptParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'getSource', params: GetSourceParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'getTemplate', params: GetTemplateParams, options?: CallClusterOptions): ReturnType;
- // Generic types cannot be properly looked up with ReturnType. Hard code these explicitly.
- (request: Request, endpoint: 'index', params: IndexDocumentParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'info', params: InfoParams, options?: CallClusterOptions): ReturnType;
- // Generic types cannot be properly looked up with ReturnType. Hard code these explicitly.
- (request: Request, endpoint: 'mget', params: MGetParams, options?: CallClusterOptions): Promise>;
- (request: Request, endpoint: 'msearch', params: MSearchParams, options?: CallClusterOptions): Promise>;
- (request: Request, endpoint: 'msearchTemplate', params: MSearchTemplateParams, options?: CallClusterOptions): Promise>;
- (request: Request, endpoint: 'mtermvectors', params: MTermVectorsParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'ping', params: PingParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'putScript', params: PutScriptParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'putTemplate', params: PutTemplateParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'reindex', params: ReindexParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'reindexRethrottle', params: ReindexRethrottleParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'renderSearchTemplate', params: RenderSearchTemplateParams, options?: CallClusterOptions): ReturnType;
- // Generic types cannot be properly looked up with ReturnType. Hard code these explicitly.
- (request: Request, endpoint: 'scroll', params: ScrollParams, options?: CallClusterOptions): Promise>;
- (request: Request, endpoint: 'search', params: SearchParams, options?: CallClusterOptions): Promise>;
- (request: Request, endpoint: 'searchShards', params: SearchShardsParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'searchTemplate', params: SearchTemplateParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'suggest', params: SuggestParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'termvectors', params: TermvectorsParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'update', params: UpdateDocumentParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'updateByQuery', params: UpdateDocumentByQueryParams, options?: CallClusterOptions): ReturnType;
-
- // cat namespace
- (request: Request, endpoint: 'cat.aliases', params: CatAliasesParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cat.allocation', params: CatAllocationParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cat.count', params: CatAllocationParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cat.fielddata', params: CatFielddataParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cat.health', params: CatHealthParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cat.help', params: CatHelpParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cat.indices', params: CatIndicesParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cat.master', params: CatCommonParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cat.nodeattrs', params: CatCommonParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cat.nodes', params: CatCommonParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cat.pendingTasks', params: CatCommonParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cat.plugins', params: CatCommonParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cat.recovery', params: CatRecoveryParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cat.repositories', params: CatCommonParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cat.segments', params: CatSegmentsParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cat.shards', params: CatShardsParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cat.snapshots', params: CatSnapshotsParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cat.tasks', params: CatTasksParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cat.threadPool', params: CatThreadPoolParams, options?: CallClusterOptions): ReturnType;
-
- // cluster namespace
- (request: Request, endpoint: 'cluster.allocationExplain', params: ClusterAllocationExplainParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cluster.getSettings', params: ClusterGetSettingsParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cluster.health', params: ClusterHealthParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cluster.pendingTasks', params: ClusterPendingTasksParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cluster.putSettings', params: ClusterPutSettingsParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cluster.reroute', params: ClusterRerouteParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cluster.state', params: ClusterStateParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'cluster.stats', params: ClusterStatsParams, options?: CallClusterOptions): ReturnType;
-
- // indices namespace
- (request: Request, endpoint: 'indices.analyze', params: IndicesAnalyzeParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.clearCache', params: IndicesClearCacheParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.close', params: IndicesCloseParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.create', params: IndicesCreateParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.delete', params: IndicesDeleteParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.deleteAlias', params: IndicesDeleteAliasParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.deleteTemplate', params: IndicesDeleteTemplateParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.exists', params: IndicesExistsParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.existsAlias', params: IndicesExistsAliasParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.existsTemplate', params: IndicesExistsTemplateParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.existsType', params: IndicesExistsTypeParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.flush', params: IndicesFlushParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.flushSynced', params: IndicesFlushSyncedParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.forcemerge', params: IndicesForcemergeParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.get', params: IndicesGetParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.getAlias', params: IndicesGetAliasParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.getFieldMapping', params: IndicesGetFieldMappingParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.getMapping', params: IndicesGetMappingParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.getSettings', params: IndicesGetSettingsParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.getTemplate', params: IndicesGetTemplateParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.getUpgrade', params: IndicesGetUpgradeParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.open', params: IndicesOpenParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.putAlias', params: IndicesPutAliasParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.putMapping', params: IndicesPutMappingParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.putSettings', params: IndicesPutSettingsParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.putTemplate', params: IndicesPutTemplateParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.recovery', params: IndicesRecoveryParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.refresh', params: IndicesRefreshParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.rollover', params: IndicesRolloverParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.segments', params: IndicesSegmentsParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.shardStores', params: IndicesShardStoresParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.shrink', params: IndicesShrinkParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.stats', params: IndicesStatsParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.updateAliases', params: IndicesUpdateAliasesParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.upgrade', params: IndicesUpgradeParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'indices.validateQuery', params: IndicesValidateQueryParams, options?: CallClusterOptions): ReturnType;
-
- // ingest namepsace
- (request: Request, endpoint: 'ingest.deletePipeline', params: IngestDeletePipelineParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'ingest.getPipeline', params: IngestGetPipelineParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'ingest.putPipeline', params: IngestPutPipelineParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'ingest.simulate', params: IngestSimulateParams, options?: CallClusterOptions): ReturnType;
-
- // nodes namespace
- (request: Request, endpoint: 'nodes.hotThreads', params: NodesHotThreadsParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'nodes.info', params: NodesInfoParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'nodes.stats', params: NodesStatsParams, options?: CallClusterOptions): ReturnType;
-
- // snapshot namespace
- (request: Request, endpoint: 'snapshot.create', params: SnapshotCreateParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'snapshot.createRepository', params: SnapshotCreateRepositoryParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'snapshot.delete', params: SnapshotDeleteParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'snapshot.deleteRepository', params: SnapshotDeleteRepositoryParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'snapshot.get', params: SnapshotGetParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'snapshot.getRepository', params: SnapshotGetRepositoryParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'snapshot.restore', params: SnapshotRestoreParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'snapshot.status', params: SnapshotStatusParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'snapshot.verifyRepository', params: SnapshotVerifyRepositoryParams, options?: CallClusterOptions): ReturnType;
-
- // tasks namespace
- (request: Request, endpoint: 'tasks.cancel', params: TasksCancelParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'tasks.get', params: TasksGetParams, options?: CallClusterOptions): ReturnType;
- (request: Request, endpoint: 'tasks.list', params: TasksListParams, options?: CallClusterOptions): ReturnType;
-
- // other APIs accessed via transport.request
- (
- request: Request,
- endpoint: 'transport.request',
- clientParams: AssistantAPIClientParams,
- options?: {}
- ): Promise;
- (
- request: Request,
- endpoint: 'transport.request',
- clientParams: DeprecationAPIClientParams,
- options?: {}
- ): Promise;
-
- // Catch-all definition
- (
- request: Request,
- endpoint: string,
- clientParams?: any,
- options?: CallClusterOptions
- ): Promise;
- /* eslint-enable */
-}
-
-export interface CallCluster {
- /* eslint-disable */
- (endpoint: 'bulk', params: BulkIndexDocumentsParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'clearScroll', params: ClearScrollParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'count', params: CountParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'create', params: CreateDocumentParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'delete', params: DeleteDocumentParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'deleteByQuery', params: DeleteDocumentByQueryParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'deleteScript', params: DeleteScriptParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'deleteTemplate', params: DeleteTemplateParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'exists', params: ExistsParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'explain', params: ExplainParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'fieldStats', params: FieldStatsParams, options?: CallClusterOptions): ReturnType;
- // Generic types cannot be properly looked up with ReturnType. Hard code these explicitly.
- (endpoint: 'get', params: GetParams, options?: CallClusterOptions): Promise>;
- (endpoint: 'getScript', params: GetScriptParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'getSource', params: GetSourceParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'getTemplate', params: GetTemplateParams, options?: CallClusterOptions): ReturnType;
- // Generic types cannot be properly looked up with ReturnType. Hard code these explicitly.
- (endpoint: 'index', params: IndexDocumentParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'info', params: InfoParams, options?: CallClusterOptions): ReturnType;
- // Generic types cannot be properly looked up with ReturnType. Hard code these explicitly.
- (endpoint: 'mget', params: MGetParams, options?: CallClusterOptions): Promise>;
- (endpoint: 'msearch', params: MSearchParams, options?: CallClusterOptions): Promise>;
- (endpoint: 'msearchTemplate', params: MSearchTemplateParams, options?: CallClusterOptions): Promise>;
- (endpoint: 'mtermvectors', params: MTermVectorsParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'ping', params: PingParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'putScript', params: PutScriptParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'putTemplate', params: PutTemplateParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'reindex', params: ReindexParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'reindexRethrottle', params: ReindexRethrottleParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'renderSearchTemplate', params: RenderSearchTemplateParams, options?: CallClusterOptions): ReturnType;
- // Generic types cannot be properly looked up with ReturnType. Hard code these explicitly.
- (endpoint: 'scroll', params: ScrollParams, options?: CallClusterOptions): Promise>;
- (endpoint: 'search', params: SearchParams, options?: CallClusterOptions): Promise>;
- (endpoint: 'searchShards', params: SearchShardsParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'searchTemplate', params: SearchTemplateParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'suggest', params: SuggestParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'termvectors', params: TermvectorsParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'update', params: UpdateDocumentParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'updateByQuery', params: UpdateDocumentByQueryParams, options?: CallClusterOptions): ReturnType;
-
- // cat namespace
- (endpoint: 'cat.aliases', params: CatAliasesParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'cat.allocation', params: CatAllocationParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'cat.count', params: CatAllocationParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'cat.fielddata', params: CatFielddataParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'cat.health', params: CatHealthParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'cat.help', params: CatHelpParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'cat.indices', params: CatIndicesParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'cat.master', params: CatCommonParams, options?: CallClusterOptions): ReturnType;
- (endpoint: 'cat.nodeattrs', params: CatCommonParams, options?: CallClusterOptions): ReturnType