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

Create new alerting HTTP APIs that use the new terminology #93977

Merged
merged 15 commits into from
Mar 30, 2021

Conversation

mikecote
Copy link
Contributor

@mikecote mikecote commented Mar 8, 2021

Resolves #90377
Resolves #85639

This PR creates new alerting HTTP APIs that use the terminology and deprecates the existing alert APIs.

The new HTTP APIs are as follows:

  • Create rule: POST /api/alerting/rule/<id>
  • Get rule: GET /api/alerting/rule/<id>
  • Update rule: PUT /api/alerting/rule/<id>
  • Delete rule: DELETE: /api/alerting/rule/<id>
  • Disable rule: POST /api/alerting/rule/<id>/_disable
  • Enable rule: POST /api/alerting/rule/<id>/_enable
  • Find rules: GET /api/alerting/rules/_find
  • Get Alerting framework health: GET /api/alerting/_health
  • List rule types: GET /api/alerting/rule_types
  • Mute alert: POST /api/alerting/rule/<rule_id>/alert/<alert_id>/_mute
  • Unmute alert: POST /api/alerting/rule/<rule_id>/alert/<alert_id>/_unmute
  • Mute all alerts: POST /api/alerting/rule/<id>/_mute_all
  • Unmute all alerts: POST /api/alerting/rule/<id>/_unmute_all

Sub-PRs merged into this feature branch:

Docs preview: https://kibana_93977.docs-preview.app.elstc.co/guide/en/kibana/master/index.html

Release Notes

The /api/alerts/* APIs are deprecated and will be removed in 8.0. Use one of the new /api/alerting/* APIs.

* Move current HTTP APIs to legacy folder

* Rename BASE_ALERT_API_PATH to LEGACY_BASE_ALERT_API_PATH

* Fix failing tests and extra files
mikecote and others added 2 commits March 17, 2021 12:10
* Move current HTTP APIs to legacy folder

* Rename BASE_ALERT_API_PATH to LEGACY_BASE_ALERT_API_PATH

* Fix failing tests and extra files

* Move current alert HTTP APIs to legacy folder (#93943)

* Move current HTTP APIs to legacy folder

* Rename BASE_ALERT_API_PATH to LEGACY_BASE_ALERT_API_PATH

* Fix failing tests and extra files

* Add necessary files

* Create rule route

* Get rule API

* Update rule API

* Delete rule route

* Aggregate rules API

* Disable rule API

* Enable rule API

* Find rules API

* Fix Update API

* Get rule alert summary API

* Get rule state API

* Health API

* Rule types API

* Mute all API

* Mute alert API

* Unmute all API

* Unmute alert route

* Update API key API

* corrected tpye by making it much more complicated

* removed unneeded cocde

* Fixes

* Add back health route

* mutedInstanceIds -> mutedAlertIds

* lastRun -> last_run

* alert_type_state -> rule_type_state & alert_instances -> alerts

Co-authored-by: Gidi Meir Morris <[email protected]>
@mikecote
Copy link
Contributor Author

@elasticmachine merge upstream

kibanamachine and others added 2 commits March 18, 2021 10:57
* Create docs for new APIs, deprecate old docs

* Remove connector_type_id

* Update docs

* Add link to legacy APIs from rules API docs

* Remove connector_type_id references

* [DOCS] Add legacy APIs to index.asciidoc

* Fix camel case

Co-authored-by: lcawl <[email protected]>
* Make API integration tests use new HTTP APIs

* Fix end to end tests

* Fix test failures

* Fix more test failures

* Rename some files
@mikecote
Copy link
Contributor Author

@gchaps the doc changes are ready for review (preview link in description). The summary of the changes are captured in the following PR descriptions:

@mikecote mikecote requested a review from gchaps March 26, 2021 12:13
@mikecote mikecote changed the title Create new rule HTTP APIs that use the new terminology Create new alerting HTTP APIs that use the new terminology Mar 26, 2021
Copy link
Contributor

@gchaps gchaps left a comment

Choose a reason for hiding this comment

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

In the Deprecated APIs section, I'd use this as the warning.

Deprecated in 7.13.0. Use Create rule instead.

Note: remove "the" before the API name.

* Initial commit

* Update README.md

* Use internal API
@mikecote
Copy link
Contributor Author

@gchaps fixed in 0e295af. The docs preview should update soon, I think.

@mikecote
Copy link
Contributor Author

@elasticmachine merge upstream

@mikecote mikecote marked this pull request as ready for review March 26, 2021 18:15
@mikecote mikecote requested review from a team as code owners March 26, 2021 18:15
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@mikecote mikecote added the auto-backport Deprecated - use backport:version if exact versions are needed label Mar 26, 2021
Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

LGTM, since the PR contains the changes from a reviewed PRs!

Copy link
Contributor

@gchaps gchaps left a comment

Choose a reason for hiding this comment

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

Docs look good to me. In the title "Deprecated 7.x APIs", will readers know what 7.x refers to?

Copy link
Contributor

@ymao1 ymao1 left a comment

Choose a reason for hiding this comment

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

LGTM!

@mikecote
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
monitoring 748.1KB 748.1KB +28.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
alerting 60.8KB 61.4KB +567.0B
triggersActionsUi 100.3KB 100.3KB +7.0B
total +574.0B

History

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

cc @mikecote

@mikecote mikecote merged commit 3abb79a into master Mar 30, 2021
@kibanamachine
Copy link
Contributor

💔 Backport failed

❌ 7.x: Commit could not be cherrypicked due to conflicts

To backport manually run:
node scripts/backport --pr 93977

mikecote added a commit to mikecote/kibana that referenced this pull request Mar 30, 2021
…3977)

* Move current alert HTTP APIs to legacy folder (elastic#93943)

* Move current HTTP APIs to legacy folder

* Rename BASE_ALERT_API_PATH to LEGACY_BASE_ALERT_API_PATH

* Fix failing tests and extra files

* Create new rule HTTP APIs (elastic#93980)

* Move current HTTP APIs to legacy folder

* Rename BASE_ALERT_API_PATH to LEGACY_BASE_ALERT_API_PATH

* Fix failing tests and extra files

* Move current alert HTTP APIs to legacy folder (elastic#93943)

* Move current HTTP APIs to legacy folder

* Rename BASE_ALERT_API_PATH to LEGACY_BASE_ALERT_API_PATH

* Fix failing tests and extra files

* Add necessary files

* Create rule route

* Get rule API

* Update rule API

* Delete rule route

* Aggregate rules API

* Disable rule API

* Enable rule API

* Find rules API

* Fix Update API

* Get rule alert summary API

* Get rule state API

* Health API

* Rule types API

* Mute all API

* Mute alert API

* Unmute all API

* Unmute alert route

* Update API key API

* corrected tpye by making it much more complicated

* removed unneeded cocde

* Fixes

* Add back health route

* mutedInstanceIds -> mutedAlertIds

* lastRun -> last_run

* alert_type_state -> rule_type_state & alert_instances -> alerts

Co-authored-by: Gidi Meir Morris <[email protected]>

* Create docs for new rule HTTP APIs, deprecate old docs (elastic#94745)

* Create docs for new APIs, deprecate old docs

* Remove connector_type_id

* Update docs

* Add link to legacy APIs from rules API docs

* Remove connector_type_id references

* [DOCS] Add legacy APIs to index.asciidoc

* Fix camel case

Co-authored-by: lcawl <[email protected]>

* Make alerting tests use new rules APIs (elastic#95159)

* Make API integration tests use new HTTP APIs

* Fix end to end tests

* Fix test failures

* Fix more test failures

* Rename some files

* Add tests for legacy APIs (elastic#95333)

* Initial commit (elastic#95457)

* Move some new alerting APIs to /internal (elastic#95461)

* Initial commit

* Update README.md

* Use internal API

* Merge deprecated warning w/ alternative solution

* Update API docs

Co-authored-by: Gidi Meir Morris <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: lcawl <[email protected]>
# Conflicts:
#	api_docs/core.json
mikecote added a commit that referenced this pull request Mar 30, 2021
…95781)

* Move current alert HTTP APIs to legacy folder (#93943)

* Move current HTTP APIs to legacy folder

* Rename BASE_ALERT_API_PATH to LEGACY_BASE_ALERT_API_PATH

* Fix failing tests and extra files

* Create new rule HTTP APIs (#93980)

* Move current HTTP APIs to legacy folder

* Rename BASE_ALERT_API_PATH to LEGACY_BASE_ALERT_API_PATH

* Fix failing tests and extra files

* Move current alert HTTP APIs to legacy folder (#93943)

* Move current HTTP APIs to legacy folder

* Rename BASE_ALERT_API_PATH to LEGACY_BASE_ALERT_API_PATH

* Fix failing tests and extra files

* Add necessary files

* Create rule route

* Get rule API

* Update rule API

* Delete rule route

* Aggregate rules API

* Disable rule API

* Enable rule API

* Find rules API

* Fix Update API

* Get rule alert summary API

* Get rule state API

* Health API

* Rule types API

* Mute all API

* Mute alert API

* Unmute all API

* Unmute alert route

* Update API key API

* corrected tpye by making it much more complicated

* removed unneeded cocde

* Fixes

* Add back health route

* mutedInstanceIds -> mutedAlertIds

* lastRun -> last_run

* alert_type_state -> rule_type_state & alert_instances -> alerts

Co-authored-by: Gidi Meir Morris <[email protected]>

* Create docs for new rule HTTP APIs, deprecate old docs (#94745)

* Create docs for new APIs, deprecate old docs

* Remove connector_type_id

* Update docs

* Add link to legacy APIs from rules API docs

* Remove connector_type_id references

* [DOCS] Add legacy APIs to index.asciidoc

* Fix camel case

Co-authored-by: lcawl <[email protected]>

* Make alerting tests use new rules APIs (#95159)

* Make API integration tests use new HTTP APIs

* Fix end to end tests

* Fix test failures

* Fix more test failures

* Rename some files

* Add tests for legacy APIs (#95333)

* Initial commit (#95457)

* Move some new alerting APIs to /internal (#95461)

* Initial commit

* Update README.md

* Use internal API

* Merge deprecated warning w/ alternative solution

* Update API docs

Co-authored-by: Gidi Meir Morris <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: lcawl <[email protected]>
# Conflicts:
#	api_docs/core.json
@mikecote mikecote deleted the alerting/http-api-terminology branch May 10, 2021 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Alerting release_note:deprecation Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.13.0 v8.0.0
Projects
None yet
6 participants