[8.x] [ResponseOps][Rules] Allow users to create a snooze schedule for rule via API (#210584)#214566
Merged
js-jankisalvi merged 3 commits intoelastic:8.xfrom Mar 14, 2025
Merged
Conversation
… via API (elastic#210584) ## Summary Resolves first part of elastic#198783 (snooze API) Creates a public API for adding snooze schedule to rules. For this purpose we created new schedule schema which will be used as standard schedule schema across rules and alerting framework. **Note** The code to be reviewed for public API is under `common/routes/schedule` and inside `external` folders. Rest of the code is just moving existing internal API route and its code to `/internal` folders. ### Checklist - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### How to test - Create a rule in kibana - Snooze that rule via new public API ```typescript Path: https://localhost:5601/api/alerting/rule/<rule_id>/snooze_schedule Method: POST Body: { "schedule": { "custom": { "start": "2025-02-25T18:00:00.000Z", "duration": "15m", "recurring": { "every": "1w", "onWeekDay": ["TU", "FR"], "occurrences": 10 } } } } ``` - Verify various snooze schedule scenarios are generated correctly #### Flaky test runner: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8009 ### Release note Allow users to create a snooze schedule for rule via API --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: lcawl <lcawley@elastic.co> (cherry picked from commit 14871c3) # Conflicts: # x-pack/platform/plugins/shared/alerting/tsconfig.json # x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/snooze.ts
This was referenced Mar 14, 2025
cnasikas
approved these changes
Mar 14, 2025
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto8.x:Questions ?
Please refer to the Backport tool documentation