mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 10:40:07 -04:00
[Saved Objects] Provide ability to remove SO type from global SO HTTP API without hiding from the client (#149166)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> resolves https://github.com/elastic/kibana/issues/147150
This commit is contained in:
parent
2dd13289e3
commit
f7b25f5e46
47 changed files with 5035 additions and 28 deletions
|
@ -257,3 +257,39 @@ the error should be verbose and informative so that the corrupt document can be
|
|||
### Testing Migrations
|
||||
|
||||
Bugs in a migration function cause downtime for our users and therefore have a very high impact. Follow the <DocLink id="kibDevTutorialTestingPlugins" section="saved-objects-migrations" text="Saved Object migrations section in the plugin testing guide"/>.
|
||||
|
||||
### How to opt-out of the global savedObjects APIs?
|
||||
|
||||
There are 2 options, depending on the amount of flexibility you need:
|
||||
For complete control over your HTTP APIs and custom handling, declare your type as `hidden`, as shown in the example.
|
||||
The other option that allows you to build your own HTTP APIs and still use the client as-is is to declare your type as hidden from the global saved objects HTTP APIs as `hiddenFromHttpApis: true`
|
||||
|
||||
```ts
|
||||
import { SavedObjectsType } from 'src/core/server';
|
||||
|
||||
export const foo: SavedObjectsType = {
|
||||
name: 'foo',
|
||||
hidden: false, [1]
|
||||
hiddenFromHttpApis: true, [2]
|
||||
namespaceType: 'multiple-isolated',
|
||||
mappings: {
|
||||
dynamic: false,
|
||||
properties: {
|
||||
description: {
|
||||
type: 'text',
|
||||
},
|
||||
hits: {
|
||||
type: 'integer',
|
||||
},
|
||||
},
|
||||
},
|
||||
migrations: {
|
||||
'1.0.0': migratedashboardVisualizationToV1,
|
||||
'2.0.0': migratedashboardVisualizationToV2,
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
[1] Needs to be `false` to use the `hiddenFromHttpApis` option
|
||||
|
||||
[2] Set this to `true` to build your own HTTP API and have complete control over the route handler.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue