API Reference¶
This section contains the complete API documentation for the Dashboard Compiler.
Overview¶
The Dashboard Compiler provides a Python API for creating Kibana dashboards programmatically. For a high-level guide on programmatic usage, see the Programmatic Usage Guide.
Core Modules¶
- Dashboard – Dashboard configuration and compilation
- Panels – Panel types and compilation logic (includes Python examples)
- Controls – Control group configuration
- Filters – Filter compilation
- Queries – Query compilation
Core Functions¶
The Dashboard Compiler provides these core functions for working with dashboards:
dashboard_compiler
¶
Provides functions to load, render, and dump YAML-to-Lens Dashboards.
load
¶
Load dashboard configurations from a YAML file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
The path to the YAML file containing the dashboard configuration. |
required |
allow_deprecated
|
bool
|
Deprecated flag retained for API compatibility (no-op in 0.4.0+). |
False
|
Returns:
| Type | Description |
|---|---|
list[Dashboard]
|
list[Dashboard]: The loaded Dashboard objects. |
Source code in kb_dashboard_core/dashboard_compiler.py
render
¶
Render a Dashboard object into its Kibana JSON representation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dashboard
|
Dashboard
|
The Dashboard object to render. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
KbnDashboard |
KbnDashboard
|
The rendered Kibana dashboard view model. |
Source code in kb_dashboard_core/dashboard_compiler.py
dump
¶
Dump Dashboard objects to a YAML file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dashboards
|
list[Dashboard]
|
The Dashboard objects to dump. |
required |
path
|
str
|
The path where the YAML file will be saved. |
required |