Skip to content

[ResponseOps][MW] Add custom schedule to GET, POST and DELETE Maintenance Window public APIs#214747

Merged
adcoelho merged 6 commits intoelastic:mw-public-apifrom
adcoelho:custom-schedule-1
Mar 19, 2025
Merged

[ResponseOps][MW] Add custom schedule to GET, POST and DELETE Maintenance Window public APIs#214747
adcoelho merged 6 commits intoelastic:mw-public-apifrom
adcoelho:custom-schedule-1

Conversation

@adcoelho
Copy link
Contributor

@adcoelho adcoelho commented Mar 17, 2025

Merging into a feature branch.

Summary

  • Add the newly created custom schedule schema to createMaintenanceWindowRequestBodySchema and maintenanceWindowResponseSchema.
  • Update transformInternalMaintenanceWindowToExternal.
  • Update transformCreateBody.
  • Update tests.

Testing

The API URL is:

  • https://localhost:5601/api/alerting/maintenance_window

Here is an example request for creating a maintenance window in Postman:

{
    "title": "test-maintenance-window",
    "schedule": {
        "custom": {
            "duration": "1d",
            "start": "1992-01-01T05:00:00.200Z",
            "recurring": {
                "every": "10d",
                "onWeekDay": ["MO", "FR"]
            }
        }
    },
    "scope": {
        "alerting": {
            "query": {
                "kql": "_id: '1234'"
            }
        }
    }
}
@adcoelho adcoelho self-assigned this Mar 17, 2025
@adcoelho adcoelho requested a review from a team as a code owner March 17, 2025 13:15
@adcoelho adcoelho requested a review from js-jankisalvi March 17, 2025 13:16
@adcoelho adcoelho added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// Feature:Alerting/RulesFramework Issues related to the Alerting Rules Framework labels Mar 17, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

Updates archive/unarchive tests to have the new request body.
@adcoelho adcoelho force-pushed the custom-schedule-1 branch from 75e6eff to 5744657 Compare March 18, 2025 08:36
Copy link
Member

@cnasikas cnasikas left a comment

Choose a reason for hiding this comment

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

LGTM! I will test when the final PR is open.

`);
});

it('throws an error where query has kql but no solutionIds', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

I think the solutionIds tests are not relevant any more.

alerting: {
query: {
kql: 'invalid_kql:',
solutionId: 'securitySolution',
Copy link
Member

Choose a reason for hiding this comment

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

This is not supported any more.

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 thought i had removed all of them, thanks!

@adcoelho adcoelho force-pushed the custom-schedule-1 branch from e4dc8cb to f2aa07c Compare March 19, 2025 11:44
@elasticmachine
Copy link
Contributor

💔 Build Failed

Failed CI Steps

Metrics [docs]

‼️ ERROR: no builds found for mergeBase sha [e25740e]

History

cc @adcoelho

@adcoelho adcoelho merged commit ebce26a into elastic:mw-public-api Mar 19, 2025
8 of 9 checks passed
adcoelho added a commit that referenced this pull request Apr 16, 2025
Closes #198685

## Summary

This PR creates a public Maintenance Window API.

The work was done on a feature branch over multiple separate PRs. Here
we will merge the feature branch into `main`.
- #209734
- #213694
- #214747
- #213771

The [documentation PR](#212377)
still needs to be merged.

## Release Notes

Publish new public APIs for the Maintenance Window.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: lcawl <lcawley@elastic.co>
adcoelho added a commit to adcoelho/kibana that referenced this pull request Apr 17, 2025
…ic#216756)

Closes elastic#198685

## Summary

This PR creates a public Maintenance Window API.

The work was done on a feature branch over multiple separate PRs. Here
we will merge the feature branch into `main`.
- elastic#209734
- elastic#213694
- elastic#214747
- elastic#213771

The [documentation PR](elastic#212377)
still needs to be merged.

## Release Notes

Publish new public APIs for the Maintenance Window.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: lcawl <lcawley@elastic.co>
(cherry picked from commit 08d0717)

# Conflicts:
#	.buildkite/scripts/steps/checks/capture_oas_snapshot.sh
#	oas_docs/overlays/kibana.overlays.shared.yaml
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
…ic#216756)

Closes elastic#198685

## Summary

This PR creates a public Maintenance Window API.

The work was done on a feature branch over multiple separate PRs. Here
we will merge the feature branch into `main`.
- elastic#209734
- elastic#213694
- elastic#214747
- elastic#213771

The [documentation PR](elastic#212377)
still needs to be merged.

## Release Notes

Publish new public APIs for the Maintenance Window.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: lcawl <lcawley@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Alerting/RulesFramework Issues related to the Alerting Rules Framework release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t//

3 participants