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

[Alerting] adds Connectors APIs and deprecates old Actions APIs as per the new Alerting terminology #92451

Merged
merged 27 commits into from
Mar 5, 2021

Conversation

gmmorris
Copy link
Contributor

@gmmorris gmmorris commented Feb 23, 2021

Summary

closes #90376

This PR covers the connectors portion, of new terminology in Kibana alerting, where we use action as the current terminology.

This new terminology change includes URLs, parameters, body, and response in the new APIs.
As part of this we also correct the API Request and Response bodies to follow the Style Guide by mapping camelCase fields to snake_case where needed.

Docs preview: https://kibana_92451.docs-preview.app.elstc.co/guide/en/kibana/master/actions-and-connectors-legacy-apis.html

Enhancement vs. Deprecation

This PR deprecates the following apis, and adds the following apis in their place:

Deprecated Added (enhancement)
/api/actions/action /api/actions/connector
/api/actions/action/{id} /api/actions/connector/{id}
/api/actions /api/actions/connectors
/api/actions/action/{id} /api/actions/connector/{id}
/api/actions/list_action_types /api/actions/connector_types
/api/actions/action/{id} /api/actions/connector/{id}
/api/actions/action/{id}/_execute /api/actions/connector/{id}/_execute

Checklist

Delete any items that are not applicable to this PR.

For maintainers

* master: (199 commits)
  Convert Canvas docs to MDX for use in Elastic Docs (elastic#91969)
  [Bazel] More resilient Workspace Status (elastic#93244)
  [Discover] Change icon of saved search in open search panel and embeddable selection (elastic#93001)
  [Workplace Search] Role Mappings to Kibana (elastic#93123)
  [Fleet] Use type-only imports where possible (elastic#92979)
  [Lens] Set pie chart slices sorted clockwise (elastic#92617)
  Remove ms label from CPU load on status page (elastic#92836)
  [App Search] Migrate Create Meta Engine View (elastic#92127)
  [Time to Visualize] Disable Visualize URL Tracker When Linked to OriginatingApp (elastic#92917)
  [ILM] Allow multiple searchable snapshot actions (elastic#92789)
  Improve consistency for display of management items (elastic#92694)
  skip flaky suite (elastic#93152)
  skip flaky suite (elastic#93152)
  [ILM] Refactor edit_policy client integration tests into separate feature files (elastic#92826)
  Add developer documentation about the building blocks we offer plugin developers (elastic#92743)
  [Security Solution] Case ui enhancement (elastic#91863)
  [Security Solution] [Detections] Updates warning message when no indices match provided index patterns (elastic#93094)
  Collect agent telemetry even when fleet server is disabled. (elastic#93198)
  [Lens] Fix runtime validation error message (elastic#93195)
  [Lens] Remove warning about ordinal x-domain (elastic#93049)
  ...
@gmmorris gmmorris marked this pull request as ready for review March 3, 2021 17:48
@gmmorris gmmorris requested a review from a team as a code owner March 3, 2021 17:48
@elasticmachine
Copy link
Contributor

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

@gmmorris gmmorris changed the title [Alerting] align Actions and Connectors terminology [Alerting] adds Connectors APIs and deprecates old Actions APIs as per the new Alerting terminology Mar 3, 2021
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.

Initial code review looks great! Just a question about using verifyAccessAndContext everywhere. Will test out the API in the morning

docs/api/actions-and-connectors.asciidoc Outdated Show resolved Hide resolved
docs/api/actions-and-connectors.asciidoc Outdated Show resolved Hide resolved
docs/api/actions-and-connectors.asciidoc Outdated Show resolved Hide resolved
docs/api/actions-and-connectors/execute.asciidoc Outdated Show resolved Hide resolved
docs/api/actions-and-connectors/get.asciidoc Outdated Show resolved Hide resolved
gmmorris and others added 3 commits March 4, 2021 11:22
…into actions/terminology-api

* 'actions/terminology-api' of github.com:gmmorris/kibana:
  Apply suggestions from code review
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.

Tested out all the old and new APIs locally...everything looks great!

@mikecote mikecote self-requested a review March 4, 2021 15:41
Copy link
Contributor

@mikecote mikecote left a comment

Choose a reason for hiding this comment

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

Changes LGTM!

docs/api/actions-and-connectors/legacy/index.asciidoc Outdated Show resolved Hide resolved
@@ -3,21 +3,23 @@

Manage Actions and Connectors.
Copy link
Contributor

Choose a reason for hiding this comment

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

Meta comment: I wonder if this is time to remove "Actions and Connectors" confusion. Since they are the same, we could call them "Connectors"? ex: "Manage Connectors" (+folder / file names).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are they the same though?
We'll still use action to refer to the execution of something by using a connector, right?
Especially one we support multiple actions per connector...

Copy link
Contributor

Choose a reason for hiding this comment

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

We'll still use action to refer to the execution of something by using a connector, right?

Correct but we only have the concept of actions on the side of the alert now, no?

I asked myself: "Is there any docs in the actions and connectors page the user can read to learn more about actions?"

x-pack/plugins/actions/server/routes/index.ts Outdated Show resolved Hide resolved
gmmorris and others added 4 commits March 4, 2021 20:05
* master: (107 commits)
  [Logs UI] Fix log stream data fetching (elastic#93201)
  [App Search] Added relevance tuning search preview (elastic#93054)
  [Canvas] Fix reports embeddables (elastic#93482)
  [ILM] Added new functional test in ILM for creating a new policy (elastic#92936)
  Remove direct dependency on statehood package (elastic#93592)
  [Maps] Track tile loading status (elastic#91585)
  [Discover][Doc] Improve main documentation (elastic#91854)
  [Upgrade Assistant] Disable UA and add prompt (elastic#92834)
  [Snapshot Restore] Remove cloud validation for slm policy (elastic#93609)
  [Maps] Support GeometryCollections in GeoJson upload (elastic#93507)
  [XY Charts] fix partial histogram endzones annotations (elastic#93091)
  [Core] Simplify context typings (elastic#93579)
  [Alerting] Improving health status check (elastic#93282)
  [Discover] Restore context documentation (elastic#90784)
  [core-docs] Edits core-intro section for the new docs system (elastic#93540)
  add missed codeowners (elastic#89714)
  fetch node labels via script execution (elastic#93225)
  [Security Solution] Adds getMockTheme function (elastic#92840)
  Sort dependencies in package.json correctly (elastic#93590)
  [Bug] missing timepicker:quickRanges migration (elastic#93409)
  ...
…into actions/terminology-api

* 'actions/terminology-api' of github.com:gmmorris/kibana:
  Update docs/api/actions-and-connectors/legacy/index.asciidoc
@gmmorris
Copy link
Contributor Author

gmmorris commented Mar 4, 2021

@elasticmachine merge upstream

kibanamachine and others added 4 commits March 4, 2021 17:27
…into actions/terminology-api

* 'actions/terminology-api' of github.com:gmmorris/kibana:
  Make Dashboard Unsaved Changes Space Specific (elastic#92680)
  Hide Value and Funtional boost for geolocation (elastic#93683)
  [Fleet] Set all keyword and text fields for `index.query.default_field` index template setting (elastic#91791)
  can not query the world (elastic#93556)
  [Security Solutions] Sets our default date time to be "today" instead of "Last 24 hours" to enable cachability and fixes one date math bug in the URL  (elastic#93548)
  [Security Solution][Endpoint][Admin][Policy] Register as AV os restrictions tooltip note  (elastic#93306)
  fix agg config sub agg dsl generation (elastic#93276)
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

@mikecote mikecote added the auto-backport Deprecated - use backport:version if exact versions are needed label Mar 5, 2021
@mikecote mikecote merged commit 7cfd15c into elastic:master Mar 5, 2021
@kibanamachine
Copy link
Contributor

💔 Backport failed

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

To backport manually, check out the target branch and run:
node scripts/backport --pr 92451

mikecote pushed a commit to mikecote/kibana that referenced this pull request Mar 5, 2021
…r the new Alerting terminology (elastic#92451)

* moved legacy actions api to legacy folder

* introduced connector create api

* added new delete route

* added new execute and get_all

* introduced all connector APIs

* renamed action to connector in Apis

* comment on camel case type

* fixed va

* updated docs

* legacy title

* corrected APIs

* legacy links

* added linik to deprecatred APIs

* added linik to deprecatred APIs from index

* moved legacy apis down one level

* Apply suggestions from code review

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

* renamed route file for connectorTypesRoute

* define legacy route

* Update docs/api/actions-and-connectors/legacy/index.asciidoc

Co-authored-by: Mike Côté <[email protected]>

* api docs

Co-authored-by: ymao1 <[email protected]>
Co-authored-by: Mike Côté <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
# Conflicts:
#	api_docs/actions.json
mikecote added a commit that referenced this pull request Mar 5, 2021
…r the new Alerting terminology (#92451) (#93762)

* moved legacy actions api to legacy folder

* introduced connector create api

* added new delete route

* added new execute and get_all

* introduced all connector APIs

* renamed action to connector in Apis

* comment on camel case type

* fixed va

* updated docs

* legacy title

* corrected APIs

* legacy links

* added linik to deprecatred APIs

* added linik to deprecatred APIs from index

* moved legacy apis down one level

* Apply suggestions from code review

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

* renamed route file for connectorTypesRoute

* define legacy route

* Update docs/api/actions-and-connectors/legacy/index.asciidoc

Co-authored-by: Mike Côté <[email protected]>

* api docs

Co-authored-by: ymao1 <[email protected]>
Co-authored-by: Mike Côté <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
# Conflicts:
#	api_docs/actions.json

Co-authored-by: Gidi Meir Morris <[email protected]>
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:Actions release_note:deprecation release_note:enhancement Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create new connector HTTP APIs that use the new terminology
5 participants