Skip to content

Commit

Permalink
[ML] Update apidoc config with the Trained models endpoints (#83274) (#…
Browse files Browse the repository at this point in the history
…83534)

* [ML] fix apidoc annotations

* [ML] add trained models

* [ML] use full path to the apidoc-markdown package
  • Loading branch information
darnautov authored Nov 17, 2020
1 parent 2ed3cb4 commit 7357680
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/ml/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"license": "Elastic-License",
"scripts": {
"build:apiDocScripts": "cd server/routes/apidoc_scripts && ../../../../../../node_modules/.bin/tsc",
"apiDocs": "yarn build:apiDocScripts && cd ./server/routes/ && ../../../../../node_modules/.bin/apidoc --parse-workers apischema=./apidoc_scripts/target/schema_worker.js --parse-parsers apischema=./apidoc_scripts/target/schema_parser.js --parse-filters apiversion=./apidoc_scripts/target/version_filter.js -i . -o ../routes_doc && apidoc-markdown -p ../routes_doc -o ../routes_doc/ML_API.md -t ./apidoc_scripts/template.md"
"apiDocs": "yarn build:apiDocScripts && cd ./server/routes/ && ../../../../../node_modules/.bin/apidoc --parse-workers apischema=./apidoc_scripts/target/schema_worker.js --parse-parsers apischema=./apidoc_scripts/target/schema_parser.js --parse-filters apiversion=./apidoc_scripts/target/version_filter.js -i . -o ../routes_doc && ../../../../../node_modules/.bin/apidoc-markdown -p ../routes_doc -o ../routes_doc/ML_API.md -t ./apidoc_scripts/template.md"
}
}
8 changes: 7 additions & 1 deletion x-pack/plugins/ml/server/routes/apidoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@
"InitializeJobSavedObjects",
"AssignJobsToSpaces",
"RemoveJobsFromSpaces",
"JobsSpaces"
"JobsSpaces",

"TrainedModels",
"GetTrainedModel",
"GetTrainedModelStats",
"GetTrainedModelPipelines",
"DeleteTrainedModel"
]
}
30 changes: 15 additions & 15 deletions x-pack/plugins/ml/server/routes/trained_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import { InferenceConfigResponse } from '../../common/types/trained_models';

export function trainedModelsRoutes({ router, routeGuard }: RouteInitialization) {
/**
* @apiGroup Inference
* @apiGroup TrainedModels
*
* @api {get} /api/ml/trained_models/:modelId Get info of a trained inference model
* @apiName GetInferenceModel
* @apiDescription Retrieves configuration information for a trained inference model.
* @apiName GetTrainedModel
* @apiDescription Retrieves configuration information for a trained model.
*/
router.get(
{
Expand Down Expand Up @@ -68,11 +68,11 @@ export function trainedModelsRoutes({ router, routeGuard }: RouteInitialization)
);

/**
* @apiGroup Inference
* @apiGroup TrainedModels
*
* @api {get} /api/ml/trained_models/:modelId/_stats Get stats of a trained inference model
* @apiName GetInferenceModelStats
* @apiDescription Retrieves usage information for trained inference models.
* @api {get} /api/ml/trained_models/:modelId/_stats Get stats of a trained model
* @apiName GetTrainedModelStats
* @apiDescription Retrieves usage information for trained models.
*/
router.get(
{
Expand Down Expand Up @@ -100,11 +100,11 @@ export function trainedModelsRoutes({ router, routeGuard }: RouteInitialization)
);

/**
* @apiGroup Inference
* @apiGroup TrainedModels
*
* @api {get} /api/ml/trained_models/:modelId/pipelines Get model pipelines
* @apiName GetModelPipelines
* @apiDescription Retrieves pipelines associated with a model
* @api {get} /api/ml/trained_models/:modelId/pipelines Get trained model pipelines
* @apiName GetTrainedModelPipelines
* @apiDescription Retrieves pipelines associated with a trained model
*/
router.get(
{
Expand All @@ -130,11 +130,11 @@ export function trainedModelsRoutes({ router, routeGuard }: RouteInitialization)
);

/**
* @apiGroup Inference
* @apiGroup TrainedModels
*
* @api {delete} /api/ml/trained_models/:modelId Get stats of a trained inference model
* @apiName DeleteInferenceModel
* @apiDescription Deletes an existing trained inference model that is currently not referenced by an ingest pipeline.
* @api {delete} /api/ml/trained_models/:modelId Delete a trained model
* @apiName DeleteTrainedModel
* @apiDescription Deletes an existing trained model that is currently not referenced by an ingest pipeline.
*/
router.delete(
{
Expand Down

0 comments on commit 7357680

Please sign in to comment.