diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/inspect_monitor.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/inspect_monitor.ts index 99cffdc2c37bd..0cbdda79c18eb 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/inspect_monitor.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/inspect_monitor.ts @@ -6,19 +6,14 @@ */ import { v4 as uuidV4 } from 'uuid'; import { schema } from '@kbn/config-schema'; -import { getPrivateLocations } from '../../synthetics_service/get_private_locations'; +import { PrivateLocationAttributes } from '../../runtime_types/private_locations'; import { SyntheticsRestApiRouteFactory } from '../types'; import { unzipFile } from '../../common/unzipt_project_code'; -import { - ConfigKey, - MonitorFields, - SyntheticsMonitor, - PrivateLocation, -} from '../../../common/runtime_types'; +import { ConfigKey, MonitorFields, SyntheticsMonitor } from '../../../common/runtime_types'; import { SYNTHETICS_API_URLS } from '../../../common/constants'; import { DEFAULT_FIELDS } from '../../../common/constants/monitor_defaults'; import { validateMonitor } from './monitor_validation'; -import { hydrateMonitorFields } from './add_monitor'; +import { getPrivateLocationsForMonitor, hydrateMonitorFields } from './add_monitor'; export const inspectSyntheticsMonitorRoute: SyntheticsRestApiRouteFactory = () => ({ method: 'POST', @@ -53,7 +48,7 @@ export const inspectSyntheticsMonitorRoute: SyntheticsRestApiRouteFactory = () = const normalizedMonitor = validationResult.decodedMonitor; - const privateLocations: PrivateLocation[] = await getPrivateLocations( + const privateLocations: PrivateLocationAttributes[] = await getPrivateLocationsForMonitor( savedObjectsClient, normalizedMonitor ); diff --git a/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts b/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts index e9787cb37ae80..b5b32e788e2a7 100644 --- a/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts +++ b/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts @@ -12,6 +12,7 @@ import { } from '@kbn/core/server'; import { i18n } from '@kbn/i18n'; import { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-plugin/server'; +import { PrivateLocationAttributes } from '../../runtime_types/private_locations'; import { SyntheticsServerSetup } from '../../types'; import { RouteContext } from '../../routes/types'; import { syntheticsMonitorType } from '../../../common/types/saved_objects'; @@ -58,7 +59,7 @@ export class ProjectMonitorFormatter { private projectId: string; private spaceId: string; private publicLocations: Locations; - private privateLocations: PrivateLocation[]; + private privateLocations: PrivateLocationAttributes[]; private savedObjectsClient: SavedObjectsClientContract; private encryptedSavedObjectsClient: EncryptedSavedObjectsClient; private monitors: ProjectMonitor[] = [];