Skip to content

QueryV2Builder🔗

Constructor🔗

func NewQueryV2Builder() *QueryV2Builder

Methods🔗

Build🔗

Builds the object.

func (builder *QueryV2Builder) Build() (dashboardv2.DataQueryKind, error)

Datasource🔗

New type for datasource reference

Not creating a new type until we figure out how to handle DS refs for group by, adhoc, and every place that uses DataSourceRef in TS.

func (builder *QueryV2Builder) Datasource(datasource cog.Builder[dashboardv2.Dashboardv2DataQueryKindDatasource]) *QueryV2Builder

Hide🔗

If hide is set to true, Grafana will filter out the response(s) associated with this query before returning it to the panel.

func (builder *QueryV2Builder) Hide(hide bool) *QueryV2Builder

Labels🔗

func (builder *QueryV2Builder) Labels(labels map[string]string) *QueryV2Builder

PanelId🔗

Panel ID from wich the queries will be reused.

func (builder *QueryV2Builder) PanelId(panelId uint32) *QueryV2Builder

QueryType🔗

Specify the query flavor

TODO make this required and give it a default

func (builder *QueryV2Builder) QueryType(queryType string) *QueryV2Builder

RefId🔗

A unique identifier for the query within the list of targets.

In server side expressions, the refId is used as a variable name to identify results.

By default, the UI will assign A->Z; however setting meaningful names may be useful.

func (builder *QueryV2Builder) RefId(refId string) *QueryV2Builder

Version🔗

func (builder *QueryV2Builder) Version(version string) *QueryV2Builder

WithTransforms🔗

func (builder *QueryV2Builder) WithTransforms(withTransforms bool) *QueryV2Builder

See also🔗