-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[DOCS] Create open API specification for find rules #147061
Conversation
Documentation preview: |
Pinging @elastic/response-ops (Team:ResponseOps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The Wondering if we should add one more API - maybe We'll also have to figure out what we want to do eventually with Or maybe we want some other structure for these. |
Hi, @lcawl ! And see Query Parameter under each parameter. Is it expected? |
You're right, that's unnecessary, so I'll add it to our list of known issues with this generator tool. Hopefully we won't be using it for too long, however, and this wouldn't be one that I'd consider a blocker. |
For other endpoints, if there are objects / arrays etc that are used in multiple places, we've ended up putting them in reusable "schemas" like the ones for cases here: https://github.com/elastic/kibana/tree/main/x-pack/plugins/cases/docs/openapi/components/schemas I fully expect that as I get more rule API specs generated, we'll have re-used schemas here too. An advantage of having them fully described in the spec rather than just pointing elsewhere is that they're then tested against the examples that we provide in the spec (e.g. it tells me if I've got a null in a field that's not nullable).
My preference would be to get one in (so all the other structure and folders are in place), then break out schema objects as needed. I was getting very big PRs which were harder to review otherwise.
I'm open to any level of discussions for the preferred shape and all the pertinent properties! It'll be interesting to see how much overlap there is between the connector API specs and the rule API specs (and how we can avoid any redundancies). For the cases APIs, I relied on the oneOf/anyOf/allOf functionality to group the different types of supported connector properties. I'm hoping the same will be feasible here too! |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Unknown metric groupsESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
(cherry picked from commit d862f46)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…147391) # Backport This will backport the following commits from `main` to `8.6`: - [[DOCS] Create open API specification for find rules (#147061)](#147061) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Lisa Cawley","email":"[email protected]"},"sourceCommit":{"committedDate":"2022-12-12T19:36:44Z","message":"[DOCS] Create open API specification for find rules (#147061)","sha":"d862f46c2a6930a9f219ec5287dcce7bb286b305","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Alerting","release_note:skip","Team:ResponseOps","docs","v8.7.0","v8.6.1"],"number":147061,"url":"https://github.com/elastic/kibana/pull/147061","mergeCommit":{"message":"[DOCS] Create open API specification for find rules (#147061)","sha":"d862f46c2a6930a9f219ec5287dcce7bb286b305"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/147061","number":147061,"mergeCommit":{"message":"[DOCS] Create open API specification for find rules (#147061)","sha":"d862f46c2a6930a9f219ec5287dcce7bb286b305"}},{"branch":"8.6","label":"v8.6.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Lisa Cawley <[email protected]>
Summary
Relates to #137240, #144566
This PR adds the new
last_run
andnext_run
properties to the find rule API docs.It also creates the open API specification for that endpoint and generates a preview in the Kibana appendix. Some of the descriptions for response properties are obtained from https://github.com/elastic/kibana/blob/main/x-pack/plugins/alerting/README.md