From 9ca99ad1a9c5f25952d459b9230a856427a20cef Mon Sep 17 00:00:00 2001 From: Dima Arnautov Date: Mon, 10 Feb 2020 17:45:13 +0100 Subject: [PATCH] [ML] add apidoc annotations --- .../plugins/ml/server/routes/apidoc.json | 7 +++- .../plugins/ml/server/routes/modules.ts | 36 +++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/ml/server/routes/apidoc.json b/x-pack/legacy/plugins/ml/server/routes/apidoc.json index 167c782965731..3c041bed99214 100644 --- a/x-pack/legacy/plugins/ml/server/routes/apidoc.json +++ b/x-pack/legacy/plugins/ml/server/routes/apidoc.json @@ -41,6 +41,11 @@ "GetCategoryDefinition", "GetMaxAnomalyScore", "GetCategoryExamples", - "GetPartitionFieldsValues" + "GetPartitionFieldsValues", + "DataRecognizer", + "RecognizeIndex", + "GetModule", + "SetupModule", + "CheckExistingModuleJobs" ] } diff --git a/x-pack/legacy/plugins/ml/server/routes/modules.ts b/x-pack/legacy/plugins/ml/server/routes/modules.ts index 9561d51154b33..3317bbc083d11 100644 --- a/x-pack/legacy/plugins/ml/server/routes/modules.ts +++ b/x-pack/legacy/plugins/ml/server/routes/modules.ts @@ -73,6 +73,15 @@ export function dataRecognizer({ elasticsearchPlugin, savedObjects, }: RouteInitialization) { + /** + * @apiGroup DataRecognizer + * + * @api {get} /api/ml/modules/recognize/:indexPatternTitle Recognize index pattern + * @apiName RecognizeIndex + * @apiDescription Returns the list of modules that matching the index pattern. + * + * @apiParam {String} indexPatternTitle Index pattern title. + */ router.get( { path: '/api/ml/modules/recognize/{indexPatternTitle}', @@ -94,6 +103,15 @@ export function dataRecognizer({ }) ); + /** + * @apiGroup DataRecognizer + * + * @api {get} /api/ml/modules/get_module/:moduleId Get module + * @apiName GetModule + * @apiDescription Returns module by id. + * + * @apiParam {String} [moduleId] Module id + */ router.get( { path: '/api/ml/modules/get_module/{moduleId?}', @@ -120,6 +138,15 @@ export function dataRecognizer({ }) ); + /** + * @apiGroup DataRecognizer + * + * @api {post} /api/ml/modules/setup/:moduleId Setup module + * @apiName SetupModule + * @apiDescription Created module items. + * + * @apiParam {String} moduleId Module id + */ router.post( { path: '/api/ml/modules/setup/{moduleId}', @@ -181,6 +208,15 @@ export function dataRecognizer({ }) ); + /** + * @apiGroup DataRecognizer + * + * @api {post} /api/ml/modules/jobs_exist/:moduleId Check if module jobs exist + * @apiName CheckExistingModuleJobs + * @apiDescription Checks if the jobs in the module have been created. + * + * @apiParam {String} moduleId Module id + */ router.get( { path: '/api/ml/modules/jobs_exist/{moduleId}',