Skip to content

Commit

Permalink
[ML] add apidoc annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Feb 11, 2020
1 parent fb7b555 commit 9ca99ad
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
7 changes: 6 additions & 1 deletion x-pack/legacy/plugins/ml/server/routes/apidoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
"GetCategoryDefinition",
"GetMaxAnomalyScore",
"GetCategoryExamples",
"GetPartitionFieldsValues"
"GetPartitionFieldsValues",
"DataRecognizer",
"RecognizeIndex",
"GetModule",
"SetupModule",
"CheckExistingModuleJobs"
]
}
36 changes: 36 additions & 0 deletions x-pack/legacy/plugins/ml/server/routes/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
Expand All @@ -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?}',
Expand All @@ -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}',
Expand Down Expand Up @@ -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}',
Expand Down

0 comments on commit 9ca99ad

Please sign in to comment.