diff --git a/x-pack/plugins/ml/public/application/services/ml_api_service/index.ts b/x-pack/plugins/ml/public/application/services/ml_api_service/index.ts index f21e67fe450f4..3552b8f006091 100644 --- a/x-pack/plugins/ml/public/application/services/ml_api_service/index.ts +++ b/x-pack/plugins/ml/public/application/services/ml_api_service/index.ts @@ -27,7 +27,6 @@ import type { JobStats, Datafeed, CombinedJob, - Detector, AnalysisConfig, ModelSnapshot, IndicesOptions, @@ -350,15 +349,6 @@ export function mlApiProvider(httpService: HttpService) { }); }, - validateDetector({ detector }: { detector: Detector }) { - const body = JSON.stringify(detector); - return httpService.http({ - path: `${ML_INTERNAL_BASE_PATH}/anomaly_detectors/_validate/detector`, - method: 'POST', - body, - }); - }, - forecast({ jobId, duration, diff --git a/x-pack/plugins/ml/server/lib/ml_client/types.ts b/x-pack/plugins/ml/server/lib/ml_client/types.ts index 93977257cdc22..ca7b36df8f208 100644 --- a/x-pack/plugins/ml/server/lib/ml_client/types.ts +++ b/x-pack/plugins/ml/server/lib/ml_client/types.ts @@ -121,8 +121,7 @@ export type MlClientParams = | Parameters | Parameters | Parameters - | Parameters - | Parameters; + | Parameters; export type MlGetADParams = Parameters | Parameters; diff --git a/x-pack/plugins/ml/server/routes/anomaly_detectors.ts b/x-pack/plugins/ml/server/routes/anomaly_detectors.ts index 8cd9f45a4217e..4c75b7a85556a 100644 --- a/x-pack/plugins/ml/server/routes/anomaly_detectors.ts +++ b/x-pack/plugins/ml/server/routes/anomaly_detectors.ts @@ -349,37 +349,6 @@ export function jobRoutes({ router, routeGuard }: RouteInitialization) { }) ); - router.versioned - .post({ - path: `${ML_INTERNAL_BASE_PATH}/anomaly_detectors/_validate/detector`, - access: 'internal', - options: { - tags: ['access:ml:canCreateJob'], - }, - summary: 'Validates detector', - description: 'Validates specified detector.', - }) - .addVersion( - { - version: '1', - validate: { - request: { - body: schema.any(), - }, - }, - }, - routeGuard.fullLicenseAPIGuard(async ({ mlClient, request, response }) => { - try { - const body = await mlClient.validateDetector({ body: request.body }); - return response.ok({ - body, - }); - } catch (e) { - return response.customError(wrapError(e)); - } - }) - ); - router.versioned .delete({ path: `${ML_INTERNAL_BASE_PATH}/anomaly_detectors/{jobId}/_forecast/{forecastId}`,