-
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
[8.13] [Infra] Add endpoints to manage Custom Dashboards (#176612) #177569
[8.13] [Infra] Add endpoints to manage Custom Dashboards (#176612) #177569
Conversation
Closes elastic#176069 ## Summary This adds the logic to register a new Saved Object type to store custom dashboards for Asset Details and adds endpoints to fetch and save custom dashboards. Changes highlights: * Renamed the `enableInfrastructureHostsCustomDashboards` to `enableInfrastructureAssetCustomDashboards` to make it more generic and support additional asset types in the future * Added a new Saved Object type * Moved initialization of all Infra endpoints to plugin's `start`. This one one of the points on [the BE tech debt ticket](elastic#175975). Having endpoint initialization in `start` makes it more convenient to access start dependencies which almost all endpoints require. * Added `savedObjectClient` and `uiSettingsClient` to the custom request context (also one of the ideas for endpoints improvement). Right now infra endpoints use custom `libs` object with all dependencies required for routes, the idea is to rely on the request context instead because it automatically available for every route handler and by default includes some useful things like scoped service clients. * Added a wrapper `handleRouteErrors` to avoid error handling duplication which we now have in a few routes. In the future we could do something similar right within `registerRoutes` framework function, but this would require a bit of refactoring. ## Hot to Test 1. Toggle the UI setting off in Advanced Settings ![CleanShot 2024-02-13 at 16 01 36@2x](https://github.com/elastic/kibana/assets/793851/fc3772a1-a075-42bd-bdc3-2c7e83278844) 2. Go to the Dev Tools and try the endpoints, both should respond with 403 ``` GET kbn:api/infra/custom-dashboards/host POST kbn:api/infra/custom-dashboards { "assetType": "host", "dashboardIdList": ["0", "1"] } ``` 3. Toggle the UI setting on 4. Try the endpoints again, now they should work as expected --------- Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit b50f538)
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
A documentation preview will be available soon. Request a new doc build by commenting
If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here. |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Public APIs missing exports
Saved Objects .kibana field count
To update your PR or re-run it, just comment with: |
Backport
This will backport the following commits from
main
to8.13
:Questions ?
Please refer to the Backport tool documentation