You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[ScopedClusterClient](./kibana-plugin-server.scopedclusterclient.md)| Serves the same purpose as "normal" <code>ClusterClient</code> but exposes additional <code>callAsCurrentUser</code> method that doesn't use credentials of the Kibana internal user (as <code>callAsInternalUser</code> does) to request Elasticsearch API, but rather passes HTTP headers extracted from the current user request to the API.<!---->See [ScopedClusterClient](./kibana-plugin-server.scopedclusterclient.md)<!---->. |
26
27
27
28
## Enumerations
@@ -98,6 +99,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
98
99
|[SavedObjectsClientProviderOptions](./kibana-plugin-server.savedobjectsclientprovideroptions.md)| Options to control the creation of the Saved Objects Client. |
99
100
|[SavedObjectsClientWrapperOptions](./kibana-plugin-server.savedobjectsclientwrapperoptions.md)| Options passed to each SavedObjectsClientWrapperFactory to aid in creating the wrapper instance. |
|[SavedObjectsExportOptions](./kibana-plugin-server.savedobjectsexportoptions.md)| Options controlling the export operation. |
103
105
|[SavedObjectsExportResultDetails](./kibana-plugin-server.savedobjectsexportresultdetails.md)| Structure of the export result details entry |
@@ -111,10 +113,13 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
111
113
|[SavedObjectsImportRetry](./kibana-plugin-server.savedobjectsimportretry.md)| Describes a retry operation for importing a saved object. |
112
114
|[SavedObjectsImportUnknownError](./kibana-plugin-server.savedobjectsimportunknownerror.md)| Represents a failure to import due to an unknown reason. |
113
115
|[SavedObjectsImportUnsupportedTypeError](./kibana-plugin-server.savedobjectsimportunsupportedtypeerror.md)| Represents a failure to import due to having an unsupported saved object type. |
|[SavedObjectsMigrationVersion](./kibana-plugin-server.savedobjectsmigrationversion.md)| Information about the migrations that have been applied to this SavedObject. When Kibana starts up, KibanaMigrator detects outdated documents and migrates them based on this value. For each migration that has been applied, the plugin's name is used as a key and the latest migration version as the value. |
116
119
|[SavedObjectsRawDoc](./kibana-plugin-server.savedobjectsrawdoc.md)| A raw document as represented directly in the saved object index. |
117
120
|[SavedObjectsResolveImportErrorsOptions](./kibana-plugin-server.savedobjectsresolveimporterrorsoptions.md)| Options to control the "resolve import" operation. |
121
+
|[SavedObjectsServiceSetup](./kibana-plugin-server.savedobjectsservicesetup.md)| Saved Objects is Kibana's data persisentence mechanism allowing plugins to use Elasticsearch for storing and querying state. The SavedObjectsServiceSetup API exposes methods for creating and registering Saved Object client wrappers. |
122
+
|[SavedObjectsServiceStart](./kibana-plugin-server.savedobjectsservicestart.md)| Saved Objects is Kibana's data persisentence mechanism allowing plugins to use Elasticsearch for storing and querying state. The SavedObjectsServiceStart API provides a scoped Saved Objects client for interacting with Saved Objects. |
|[SessionCookieValidationResult](./kibana-plugin-server.sessioncookievalidationresult.md)| Return type from a function to validate cookie contents. |
@@ -152,6 +157,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
152
157
|[IClusterClient](./kibana-plugin-server.iclusterclient.md)| Represents an Elasticsearch cluster API client and allows to call API on behalf of the internal Kibana user and the actual user that is derived from the request headers (via <code>asScoped(...)</code>).<!---->See [ClusterClient](./kibana-plugin-server.clusterclient.md)<!---->. |
153
158
|[IContextProvider](./kibana-plugin-server.icontextprovider.md)| A function that returns a context value for a specific key of given context type. |
154
159
|[IsAuthenticated](./kibana-plugin-server.isauthenticated.md)| Return authentication status for a request. |
160
+
|[ISavedObjectsRepository](./kibana-plugin-server.isavedobjectsrepository.md)| See [SavedObjectsRepository](./kibana-plugin-server.savedobjectsrepository.md)|
155
161
|[IScopedClusterClient](./kibana-plugin-server.iscopedclusterclient.md)| Serves the same purpose as "normal" <code>ClusterClient</code> but exposes additional <code>callAsCurrentUser</code> method that doesn't use credentials of the Kibana internal user (as <code>callAsInternalUser</code> does) to request Elasticsearch API, but rather passes HTTP headers extracted from the current user request to the API.<!---->See [ScopedClusterClient](./kibana-plugin-server.scopedclusterclient.md)<!---->. |
156
162
|[KibanaRequestRouteOptions](./kibana-plugin-server.kibanarequestrouteoptions.md)| Route options: If 'GET' or 'OPTIONS' method, body options won't be returned. |
157
163
|[KibanaResponseFactory](./kibana-plugin-server.kibanaresponsefactory.md)| Creates an object containing request response payload, HTTP headers, error details, and other data transmitted to the client. |
@@ -180,6 +186,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
180
186
|[SavedObjectAttribute](./kibana-plugin-server.savedobjectattribute.md)| Type definition for a Saved Object attribute value |
181
187
|[SavedObjectAttributeSingle](./kibana-plugin-server.savedobjectattributesingle.md)| Don't use this type, it's simply a helper type for [SavedObjectAttribute](./kibana-plugin-server.savedobjectattribute.md)|
182
188
| [SavedObjectsClientContract](./kibana-plugin-server.savedobjectsclientcontract.md) | Saved Objects is Kibana's data persisentence mechanism allowing plugins to use Elasticsearch for storing plugin state.<!-- -->\#\# SavedObjectsClient errors<!-- -->Since the SavedObjectsClient has its hands in everything we are a little paranoid about the way we present errors back to to application code. Ideally, all errors will be either:<!-- -->1. Caused by bad implementation (ie. undefined is not a function) and as such unpredictable 2. An error that has been classified and decorated appropriately by the decorators in [SavedObjectsErrorHelpers](./kibana-plugin-server.savedobjectserrorhelpers.md)<!-- -->Type 1 errors are inevitable, but since all expected/handle-able errors should be Type 2 the <code>isXYZError()</code> helpers exposed at <code>SavedObjectsErrorHelpers</code> should be used to understand and manage error responses from the <code>SavedObjectsClient</code>.<!-- -->Type 2 errors are decorated versions of the source error, so if the elasticsearch client threw an error it will be decorated based on its type. That means that rather than looking for <code>error.body.error.type</code> or doing substring checks on <code>error.body.error.reason</code>, just use the helpers to understand the meaning of the error:<!-- -->\`\`\`<!-- -->js if (SavedObjectsErrorHelpers.isNotFoundError(error)) { // handle 404 }<!-- -->if (SavedObjectsErrorHelpers.isNotAuthorizedError(error)) { // 401 handling should be automatic, but in case you wanted to know }<!-- -->// always rethrow the error unless you handle it throw error; \`\`\`<!-- -->\#\#\# 404s from missing index<!-- -->From the perspective of application code and APIs the SavedObjectsClient is a black box that persists objects. One of the internal details that users have no control over is that we use an elasticsearch index for persistance and that index might be missing.<!-- -->At the time of writing we are in the process of transitioning away from the operating assumption that the SavedObjects index is always available. Part of this transition is handling errors resulting from an index missing. These used to trigger a 500 error in most cases, and in others cause 404s with different error messages.<!-- -->From my (Spencer) perspective, a 404 from the SavedObjectsApi is a 404; The object the request/call was targeting could not be found. This is why \#14141 takes special care to ensure that 404 errors are generic and don't distinguish between index missing or document missing.<!-- -->\#\#\# 503s from missing index<!-- -->Unlike all other methods, create requests are supposed to succeed even when the Kibana index does not exist because it will be automatically created by elasticsearch. When that is not the case it is because Elasticsearch's <code>action.auto_create_index</code> setting prevents it from being created automatically so we throw a special 503 with the intention of informing the user that their Elasticsearch settings need to be updated.<!-- -->See [SavedObjectsClient](./kibana-plugin-server.savedobjectsclient.md) See [SavedObjectsErrorHelpers](./kibana-plugin-server.savedobjectserrorhelpers.md) |
189
+
|[SavedObjectsClientFactory](./kibana-plugin-server.savedobjectsclientfactory.md)| Describes the factory used to create instances of the Saved Objects Client. |
183
190
|[SavedObjectsClientWrapperFactory](./kibana-plugin-server.savedobjectsclientwrapperfactory.md)| Describes the factory used to create instances of Saved Objects Client Wrappers. |
184
191
|[UiSettingsType](./kibana-plugin-server.uisettingstype.md)| UI element type to represent the settings. |
| [refresh](./kibana-plugin-server.savedobjectsdeletebynamespaceoptions.refresh.md) | <code>MutatingOperationRefreshSetting</code> | The Elasticsearch Refresh setting for this operation |
0 commit comments