kibana/docs/development/plugins/expressions/server/kibana-plugin-plugins-expressions-server.executioncontext.md
Kibana Machine 50d6106e56
Instrument vis_type_vislib, lens and vis_type_timeseries with execution context service (#105206) (#106117)
Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com>

Co-authored-by: Mikhail Shustov <restrry@gmail.com>
Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com>
2021-07-19 19:19:19 +00:00

2.6 KiB

Home > kibana-plugin-plugins-expressions-server > ExecutionContext

ExecutionContext interface

ExecutionContext is an object available to all functions during a single execution; it provides various methods to perform side-effects.

Signature:

export interface ExecutionContext<InspectorAdapters extends Adapters = Adapters, ExecutionContextSearch extends SerializableState = SerializableState> 

Properties

Property Type Description
abortSignal AbortSignal Adds ability to abort current execution.
getExecutionContext () => IExecutionContextContainer | undefined Contains the meta-data about the source of the expression.
getKibanaRequest () => KibanaRequest Getter to retrieve the KibanaRequest object inside an expression function. Useful for functions which are running on the server and need to perform operations that are scoped to a specific user.
getSearchContext () => ExecutionContextSearch Get search context of the expression.
getSearchSessionId () => string | undefined Search context in which expression should operate.
inspectorAdapters InspectorAdapters Adapters for inspector plugin.
isSyncColorsEnabled () => boolean Returns the state (true|false) of the sync colors across panels switch.
types Record<string, ExpressionType> A map of available expression types.
variables Record<string, unknown> Context variables that can be consumed using var and var_set functions.