getEngine #
Available since 2.61.0
Tells which storage engine Kuzzle runs on: the storage driver package, the engine family and the engine server's version.
The API of the storageClient and StorageClient clients follows the driver: choose it from driver, not from services.storageEngine.majorVersion, which is ignored when services.storageEngine.driver is set and still holds "7" by default.
This method can only be used once the application is started. It asks the storage engine: call it once, not on every request.
getEngine(): Promise<StorageEngineInfo>Returns #
Returns a Promise resolving to a StorageEngineInfo object (exported by kuzzle):
| Property | Type | Description |
|---|---|---|
driver | string | The driver's npm package name: kuzzle-storage-es-7 or kuzzle-storage-es-8 for the built-in drivers, the package services.storageEngine.driver names otherwise (e.g. kuzzle-storage-es-9) |
engine | string | The engine family, as the driver reports it (e.g. elasticsearch) |
version | string | The engine server's version (e.g. 9.0.8) |
Errors #
- plugin.runtime.unavailable_before_start: the application is not started yet
Usage #
const { driver, engine, version } = await app.storage.getEngine();
app.log.info(`Storage: ${engine} ${version}, through ${driver}`);