2020-03-20 19:02:15 +01:00
|
|
|
/*
|
|
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
|
|
* or more contributor license agreements. Licensed under the Elastic License;
|
|
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
|
|
*/
|
|
|
|
import { Observable } from 'rxjs';
|
2020-07-14 23:50:22 +02:00
|
|
|
import { IRouter, ILegacyClusterClient, Logger } from 'kibana/server';
|
|
|
|
import { UsageCollectionSetup } from 'src/plugins/usage_collection/server';
|
|
|
|
import { TelemetryCollectionManagerPluginSetup } from 'src/plugins/telemetry_collection_manager/server';
|
2020-03-20 19:02:15 +01:00
|
|
|
import { LicenseFeature, ILicense } from '../../licensing/server';
|
2020-07-14 23:50:22 +02:00
|
|
|
import { PluginStartContract as ActionsPluginsStartContact } from '../../actions/server';
|
|
|
|
import {
|
|
|
|
PluginStartContract as AlertingPluginStartContract,
|
|
|
|
PluginSetupContract as AlertingPluginSetupContract,
|
|
|
|
} from '../../alerts/server';
|
|
|
|
import { InfraPluginSetup } from '../../infra/server';
|
|
|
|
import { LicensingPluginSetup } from '../../licensing/server';
|
|
|
|
import { PluginSetupContract as FeaturesPluginSetupContract } from '../../features/server';
|
2020-07-17 17:13:40 +02:00
|
|
|
import { EncryptedSavedObjectsPluginSetup } from '../../encrypted_saved_objects/server';
|
2020-08-03 21:05:12 +02:00
|
|
|
import { CloudSetup } from '../../cloud/server';
|
2020-03-20 19:02:15 +01:00
|
|
|
|
|
|
|
export interface MonitoringLicenseService {
|
|
|
|
refresh: () => Promise<any>;
|
|
|
|
license$: Observable<ILicense>;
|
|
|
|
getMessage: () => string | undefined;
|
|
|
|
getWatcherFeature: () => LicenseFeature;
|
|
|
|
getMonitoringFeature: () => LicenseFeature;
|
|
|
|
getSecurityFeature: () => LicenseFeature;
|
|
|
|
stop: () => void;
|
|
|
|
}
|
2020-07-14 23:50:22 +02:00
|
|
|
|
|
|
|
export interface MonitoringElasticsearchConfig {
|
|
|
|
hosts: string[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface LegacyAPI {
|
|
|
|
getServerStatus: () => string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface PluginsSetup {
|
2020-07-17 17:13:40 +02:00
|
|
|
encryptedSavedObjects: EncryptedSavedObjectsPluginSetup;
|
2020-07-14 23:50:22 +02:00
|
|
|
telemetryCollectionManager?: TelemetryCollectionManagerPluginSetup;
|
|
|
|
usageCollection?: UsageCollectionSetup;
|
|
|
|
licensing: LicensingPluginSetup;
|
|
|
|
features: FeaturesPluginSetupContract;
|
|
|
|
alerts: AlertingPluginSetupContract;
|
|
|
|
infra: InfraPluginSetup;
|
2020-08-03 21:05:12 +02:00
|
|
|
cloud: CloudSetup;
|
2020-07-14 23:50:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface PluginsStart {
|
|
|
|
alerts: AlertingPluginStartContract;
|
|
|
|
actions: ActionsPluginsStartContact;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MonitoringCoreConfig {
|
|
|
|
get: (key: string) => string | undefined;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface RouteDependencies {
|
|
|
|
router: IRouter;
|
|
|
|
licenseService: MonitoringLicenseService;
|
2020-07-17 17:13:40 +02:00
|
|
|
encryptedSavedObjects: EncryptedSavedObjectsPluginSetup;
|
2020-07-14 23:50:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface MonitoringCore {
|
|
|
|
config: () => MonitoringCoreConfig;
|
|
|
|
log: Logger;
|
|
|
|
route: (options: any) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface LegacyShimDependencies {
|
|
|
|
router: IRouter;
|
|
|
|
instanceUuid: string;
|
|
|
|
esDataClient: ILegacyClusterClient;
|
|
|
|
kibanaStatsCollector: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IBulkUploader {
|
|
|
|
setKibanaStatusGetter: (getter: () => string | undefined) => void;
|
|
|
|
getKibanaStats: () => any;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface LegacyRequest {
|
|
|
|
logger: Logger;
|
|
|
|
getLogger: (...scopes: string[]) => Logger;
|
|
|
|
payload: unknown;
|
|
|
|
getKibanaStatsCollector: () => any;
|
|
|
|
getUiSettingsService: () => any;
|
|
|
|
getActionTypeRegistry: () => any;
|
|
|
|
getAlertsClient: () => any;
|
|
|
|
getActionsClient: () => any;
|
|
|
|
server: {
|
|
|
|
config: () => {
|
|
|
|
get: (key: string) => string | undefined;
|
|
|
|
};
|
|
|
|
newPlatform: {
|
|
|
|
setup: {
|
|
|
|
plugins: PluginsStart;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
plugins: {
|
|
|
|
monitoring: {
|
|
|
|
info: MonitoringLicenseService;
|
|
|
|
};
|
|
|
|
elasticsearch: {
|
|
|
|
getCluster: (
|
|
|
|
name: string
|
|
|
|
) => {
|
|
|
|
callWithRequest: (req: any, endpoint: string, params: any) => Promise<any>;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|