Skip to content

QueryVariable🔗

Constructor🔗

QueryVariable(name: str)

Methods🔗

build🔗

Builds the object.

def build() -> dashboard.VariableModel

all_value🔗

Custom all value

def all_value(all_value: str) -> typing.Self

current🔗

Shows current selected variable text/value on the dashboard

def current(current: dashboard.VariableOption) -> typing.Self

datasource🔗

Data source used to fetch values for a variable. It can be defined but null.

def datasource(datasource: dashboard.DataSourceRef) -> typing.Self

description🔗

Description of variable. It can be defined but null.

def description(description: str) -> typing.Self

hide🔗

Visibility configuration for the variable

def hide(hide: dashboard.VariableHide) -> typing.Self

include_all🔗

Whether all value option is available or not

def include_all(include_all: bool) -> typing.Self

label🔗

Optional display name

def label(label: str) -> typing.Self

multi🔗

Whether multiple values can be selected or not from variable value list

def multi(multi: bool) -> typing.Self

name🔗

Name of variable

def name(name: str) -> typing.Self

options🔗

Options that can be selected for a variable.

def options(options: list[dashboard.VariableOption]) -> typing.Self

query🔗

Query used to fetch values for a variable

def query(query: typing.Union[str, dict[str, object]]) -> typing.Self

refresh🔗

Options to config when to refresh a variable

def refresh(refresh: dashboard.VariableRefresh) -> typing.Self

regex🔗

Optional field, if you want to extract part of a series name or metric node segment.

Named capture groups can be used to separate the display text and value.

def regex(regex: str) -> typing.Self

sort🔗

Options sort order

def sort(sort: dashboard.VariableSort) -> typing.Self

See also🔗