kibana/docs/management
Mykola Harmash b50f5387fc
[Infra] Add endpoints to manage Custom Dashboards (#176612)
Closes https://github.com/elastic/kibana/issues/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](https://github.com/elastic/kibana/issues/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](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 <42973632+kibanamachine@users.noreply.github.com>
2024-02-22 11:56:33 +01:00
..
cases [DOCS] Refresh cases table screenshot (#174871) 2024-01-16 07:18:33 -08:00
connectors [Obs AI Assistant] Bedrock/Claude support (#176191) 2024-02-09 01:17:20 -07:00
field-formatters Fix typos in docs & dev_docs (#113746) 2021-10-07 14:30:32 -04:00
images [Data views] Add composite runtime field docs with screenshots (#141013) 2022-09-23 13:19:50 +09:30
index-patterns/images [DOCS] Adds drag & drop to Discover (#157340) 2023-05-16 15:35:47 -07:00
ingest-pipelines/images [DOCS] Migrate ingest pipeline docs to ES reference (#94625) 2021-03-17 17:09:34 -04:00
maintenance-windows [RAM][[Maintenance Window][DOCS] Maintenance window scoped query automated screenshots (#174315) 2024-01-15 13:22:33 -08:00
rollups [DOCS] Deprecate rollups (#169670) 2023-10-25 16:51:49 -04:00
saved-objects API docs: Add deprecation warning to all deprecated Saved Object APIs (#150267) 2023-02-07 09:28:13 -07:00
watcher-ui ES cluster privileges for watcher removed in documentation (#159278) 2023-06-20 14:39:04 -04:00
action-types.asciidoc Add docs for SentinelOne connector (#174696) 2024-02-01 10:15:26 -07:00
advanced-options.asciidoc [Infra] Add endpoints to manage Custom Dashboards (#176612) 2024-02-22 11:56:33 +01:00
manage-data-views.asciidoc [DOCS] Adds note that default formatters use the meta.unit field (#176857) 2024-02-19 14:51:30 +00:00
managing-licenses.asciidoc [DOCS] Remove obsolete license expiration info (#131474) 2022-05-20 13:34:04 -07:00
managing-saved-objects.asciidoc [DOCS] Updates saved objects & other docs (#139328) 2022-09-21 16:11:41 -07:00
managing-tags.asciidoc [DOCS] Updates saved objects & other docs (#139328) 2022-09-21 16:11:41 -07:00
numeral.asciidoc [DOCS] Renames index pattern in management and monitoring (#117939) 2021-11-10 10:20:23 -08:00
upgrade-assistant.asciidoc [DOCS] Fix typo in Upgrade Assistant docs (#167031) 2023-09-25 10:19:27 -04:00