kibana/x-pack/plugins/ml/server/routes
Kibana Machine 7e0ea54b45
[8.16] [ML] Trained Models: Fixes spaces sync to retrieve 10000 models (#202712) (#202742)
# Backport

This will backport the following commits from `main` to `8.16`:
- [[ML] Trained Models: Fixes spaces sync to retrieve 10000 models
(#202712)](https://github.com/elastic/kibana/pull/202712)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dima
Arnautov","email":"dmitrii.arnautov@elastic.co"},"sourceCommit":{"committedDate":"2024-12-03T14:29:28Z","message":"[ML]
Trained Models: Fixes spaces sync to retrieve 10000 models
(#202712)\n\n## Summary\r\n\r\nThe default page size for the
/trained_models API is 100. As a result,\r\nthe spaces sync task only
fetched the first 100 models, leaving the rest\r\nunassigned to spaces
and therefore invisible in the ML UI.\r\n\r\nThis PR increases the page
size to 10,000 to ensure all models are\r\nproperly assigned to Kibana
spaces.\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"ded18eeaac82787ea57d4991bad28b983d43ad0c","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","v9.0.0","Feature:3rd
Party
Models","Team:ML","backport:version","v8.17.0","v8.18.0","v8.16.2"],"title":"[ML]
Trained Models: Fixes spaces sync to retrieve 10000
models","number":202712,"url":"https://github.com/elastic/kibana/pull/202712","mergeCommit":{"message":"[ML]
Trained Models: Fixes spaces sync to retrieve 10000 models
(#202712)\n\n## Summary\r\n\r\nThe default page size for the
/trained_models API is 100. As a result,\r\nthe spaces sync task only
fetched the first 100 models, leaving the rest\r\nunassigned to spaces
and therefore invisible in the ML UI.\r\n\r\nThis PR increases the page
size to 10,000 to ensure all models are\r\nproperly assigned to Kibana
spaces.\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"ded18eeaac82787ea57d4991bad28b983d43ad0c"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/202712","number":202712,"mergeCommit":{"message":"[ML]
Trained Models: Fixes spaces sync to retrieve 10000 models
(#202712)\n\n## Summary\r\n\r\nThe default page size for the
/trained_models API is 100. As a result,\r\nthe spaces sync task only
fetched the first 100 models, leaving the rest\r\nunassigned to spaces
and therefore invisible in the ML UI.\r\n\r\nThis PR increases the page
size to 10,000 to ensure all models are\r\nproperly assigned to Kibana
spaces.\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"ded18eeaac82787ea57d4991bad28b983d43ad0c"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
2024-12-03 10:26:06 -06:00
..
schemas [8.x] [ML] Anomaly Detection: adds ability to delete forecasts from job (#194896) (#195547) 2024-10-09 12:27:15 +02:00
alerting.ts [ML] Replace apiDoc annotations with routes definitions for OpenAPI spec generation (#190840) 2024-08-23 08:28:57 -05:00
annotations.ts [ML] Replace apiDoc annotations with routes definitions for OpenAPI spec generation (#190840) 2024-08-23 08:28:57 -05:00
anomaly_detectors.ts [8.x] [ML] Anomaly Detection: adds ability to delete forecasts from job (#194896) (#195547) 2024-10-09 12:27:15 +02:00
calendars.ts [ML] Replace apiDoc annotations with routes definitions for OpenAPI spec generation (#190840) 2024-08-23 08:28:57 -05:00
data_frame_analytics.ts [ML] Improving empty object creation (#191518) 2024-08-28 16:41:34 +01:00
data_visualizer.ts [ML] Replace apiDoc annotations with routes definitions for OpenAPI spec generation (#190840) 2024-08-23 08:28:57 -05:00
datafeeds.ts [ML] Replace apiDoc annotations with routes definitions for OpenAPI spec generation (#190840) 2024-08-23 08:28:57 -05:00
fields_service.ts [ML] Replace apiDoc annotations with routes definitions for OpenAPI spec generation (#190840) 2024-08-23 08:28:57 -05:00
filters.ts [ML] Replace apiDoc annotations with routes definitions for OpenAPI spec generation (#190840) 2024-08-23 08:28:57 -05:00
inference_models.ts Update dependency @elastic/elasticsearch to ^8.15.0 (main) (#190378) 2024-08-23 12:48:10 -05:00
job_audit_messages.ts [ML] Replace apiDoc annotations with routes definitions for OpenAPI spec generation (#190840) 2024-08-23 08:28:57 -05:00
job_service.ts [ML] Replace apiDoc annotations with routes definitions for OpenAPI spec generation (#190840) 2024-08-23 08:28:57 -05:00
job_validation.ts [ML] Replace apiDoc annotations with routes definitions for OpenAPI spec generation (#190840) 2024-08-23 08:28:57 -05:00
management.ts [ML] Replace apiDoc annotations with routes definitions for OpenAPI spec generation (#190840) 2024-08-23 08:28:57 -05:00
model_management.ts [ML] Replace apiDoc annotations with routes definitions for OpenAPI spec generation (#190840) 2024-08-23 08:28:57 -05:00
modules.ts [ML] Anomaly Detection supplied configurations: adds page in ML UI for Supplied configurations (ML Modules) (#191564) 2024-09-12 10:30:09 -06:00
notifications.ts [ML] Replace apiDoc annotations with routes definitions for OpenAPI spec generation (#190840) 2024-08-23 08:28:57 -05:00
README.md [ML] Replace apiDoc annotations with routes definitions for OpenAPI spec generation (#190840) 2024-08-23 08:28:57 -05:00
results_service.ts [ML] Replace apiDoc annotations with routes definitions for OpenAPI spec generation (#190840) 2024-08-23 08:28:57 -05:00
saved_objects.ts [ML] Replace apiDoc annotations with routes definitions for OpenAPI spec generation (#190840) 2024-08-23 08:28:57 -05:00
system.ts [8.16] [ML] Trained Model: Fix start deployment with ML autoscaling and 0 active nodes (#201256) (#201746) 2024-11-26 06:21:05 -06:00
trained_models.test.ts Revert "Revert "Replace 'model_id' with 'inference_id' for inference endpoints"" (#190729) 2024-08-20 09:47:30 -06:00
trained_models.ts [8.16] [ML] Trained Models: Fixes spaces sync to retrieve 10000 models (#202712) (#202742) 2024-12-03 10:26:06 -06:00

ML Kibana API routes

This folder contains ML API routes in Kibana.

For better API documentation, each route handler needs a summary and description. Kibana schema definitions, which are used to validate requests and responses, also appear in the documentation. To improve the documentation's clarity, it's important to include a detailed description for each property in these schema definitions as well.

To generate an OpenAPI spec file, make sure the OAS Kibana endpoint is enabled in kibana.dev.yml

server.oas.enabled: true

And after starting Kibana yarn start --no-base-path, call the oas endpoint and output to a file, e.g.

curl -s -u <USERNAME>:<PASSWORD> http://localhost:5601/api/oas\?pathStartsWith\=/internal/ml\&access\=internal -o ml_kibana_openapi.json