Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] New Platform server shim: update anomaly detectors routes to use new platform router #56717

Merged

Conversation

alvarezmelissa87
Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 commented Feb 4, 2020

Summary

Related meta issue: #49743
Validation audit: https://github.com/elastic/kibana-team/issues/167

Updates all anomaly_detectors routes to use new platform router.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

- [ ] This was checked for cross-browser compatibility, including a check against IE11
- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support

For maintainers

- [ ] This was checked for breaking API changes and was labeled appropriately
- [ ] This includes a feature addition or change that requires a release note and was labeled appropriately

@alvarezmelissa87 alvarezmelissa87 requested a review from a team as a code owner February 4, 2020 02:07
@alvarezmelissa87 alvarezmelissa87 self-assigned this Feb 4, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

{
path: '/api/ml/anomaly_detectors/_validate/detector',
validate: {
body: schema.any(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like body schema validation is missing 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this one being used anywhere 🤔 so I held off adding a schema as it would make it pretty restrictive.

*
* @api {put} /api/ml/anomaly_detectors/:jobId/_update Update an anomaly detection job
* @apiName UpdateAnomalyDetectors
* @apiDescription This API updates an anomaly detection job
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copying from the ML docs, Updates certain properties of an anomaly detection job.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in b70059756cf4d0eb6a125b0ba7e891c69daa622d

*/
router.get(
{
path: '/api/ml/anomaly_detectors/{jobId}/results/categories/{categoryId}',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think anywhere in the UI is actually calling this route, but no harm in leaving it in, as a way of accessing the categories info via the ML endpoint.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking a look and for the confirmation 😄 I agree, sounds good to leave it in. 👌

@alvarezmelissa87 alvarezmelissa87 force-pushed the ml-new-platform-job-routes branch from 57ffe5e to b700597 Compare February 4, 2020 20:12
@peteharverson peteharverson mentioned this pull request Feb 4, 2020
78 tasks
Copy link
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest changes LGTM 👍

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add entries to the ml/server/routes/apidoc.json for the apiGroup and apiNames of each route, to ensure they get included in the docs generated by the tool. Use the same order as the routes are defined in the file:

    "AnomalyDetectors",
    "GetAnomalyDetectors",
    "GetAnomalyDetectorsById",
    "GetAnomalyDetectorsStatsById"
...

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested latest edits and LGTM. Just need to update the apidoc.json file.

@alvarezmelissa87 alvarezmelissa87 force-pushed the ml-new-platform-job-routes branch from 1e8e4a6 to 5601920 Compare February 5, 2020 15:43
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

  • 💚 Build #24611 succeeded 1e8e4a6f06c032a7757ff0e3e6d4584447c6c6b9
  • 💚 Build #24407 succeeded b70059756cf4d0eb6a125b0ba7e891c69daa622d
  • 💔 Build #24212 failed f713ea6fb6d5b6886a20f32bf2a8c9b2d155af0e

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@alvarezmelissa87 alvarezmelissa87 deleted the ml-new-platform-job-routes branch February 5, 2020 20:24
alvarezmelissa87 added a commit to alvarezmelissa87/kibana that referenced this pull request Feb 6, 2020
… new platform router (elastic#56717)

* update job routes to NP

* call notify.error properly on mlMessageBarService

* add route documentation annotation to job routes

* update schema and route doc

* update apidoc file with routes
alvarezmelissa87 added a commit that referenced this pull request Feb 6, 2020
… new platform router (#56717) (#56915)

* update job routes to NP

* call notify.error properly on mlMessageBarService

* add route documentation annotation to job routes

* update schema and route doc

* update apidoc file with routes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:NP Migration :ml release_note:skip Skip the PR/issue when compiling release notes v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants