dashboard

package
v0.0.0-...-6420b47 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 9 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdHocVariableConverter

func AdHocVariableConverter(input VariableModel) string

AdHocVariableConverter accepts a `AdHocVariable` object and generates the Go code to build this object using builders.

func AnnotationActionsConverter

func AnnotationActionsConverter(input AnnotationActions) string

AnnotationActionsConverter accepts a `AnnotationActions` object and generates the Go code to build this object using builders.

func AnnotationPanelFilterConverter

func AnnotationPanelFilterConverter(input AnnotationPanelFilter) string

AnnotationPanelFilterConverter accepts a `AnnotationPanelFilter` object and generates the Go code to build this object using builders.

func AnnotationPermissionConverter

func AnnotationPermissionConverter(input AnnotationPermission) string

AnnotationPermissionConverter accepts a `AnnotationPermission` object and generates the Go code to build this object using builders.

func AnnotationQueryConverter

func AnnotationQueryConverter(input AnnotationQuery) string

AnnotationQueryConverter accepts a `AnnotationQuery` object and generates the Go code to build this object using builders.

func AnnotationTargetConverter

func AnnotationTargetConverter(input AnnotationTarget) string

AnnotationTargetConverter accepts a `AnnotationTarget` object and generates the Go code to build this object using builders.

func ConstantVariableConverter

func ConstantVariableConverter(input VariableModel) string

ConstantVariableConverter accepts a `ConstantVariable` object and generates the Go code to build this object using builders.

func CustomVariableConverter

func CustomVariableConverter(input VariableModel) string

CustomVariableConverter accepts a `CustomVariable` object and generates the Go code to build this object using builders.

func DashboardConverter

func DashboardConverter(input Dashboard) string

DashboardConverter accepts a `Dashboard` object and generates the Go code to build this object using builders.

func DashboardDashboardTemplatingConverter

func DashboardDashboardTemplatingConverter(input DashboardDashboardTemplating) string

DashboardDashboardTemplatingConverter accepts a `DashboardDashboardTemplating` object and generates the Go code to build this object using builders.

func DashboardDashboardTimeConverter

func DashboardDashboardTimeConverter(input DashboardDashboardTime) string

DashboardDashboardTimeConverter accepts a `DashboardDashboardTime` object and generates the Go code to build this object using builders.

func DashboardFieldConfigSourceOverridesConverter

func DashboardFieldConfigSourceOverridesConverter(input DashboardFieldConfigSourceOverrides) string

DashboardFieldConfigSourceOverridesConverter accepts a `DashboardFieldConfigSourceOverrides` object and generates the Go code to build this object using builders.

func DashboardLinkConverter

func DashboardLinkConverter(input DashboardLink) string

DashboardLinkConverter accepts a `DashboardLink` object and generates the Go code to build this object using builders.

func DashboardMetaConverter

func DashboardMetaConverter(input DashboardMeta) string

DashboardMetaConverter accepts a `DashboardMeta` object and generates the Go code to build this object using builders.

func DashboardRangeMapOptionsConverter

func DashboardRangeMapOptionsConverter(input DashboardRangeMapOptions) string

DashboardRangeMapOptionsConverter accepts a `DashboardRangeMapOptions` object and generates the Go code to build this object using builders.

func DashboardRegexMapOptionsConverter

func DashboardRegexMapOptionsConverter(input DashboardRegexMapOptions) string

DashboardRegexMapOptionsConverter accepts a `DashboardRegexMapOptions` object and generates the Go code to build this object using builders.

func DashboardSpecialValueMapOptionsConverter

func DashboardSpecialValueMapOptionsConverter(input DashboardSpecialValueMapOptions) string

DashboardSpecialValueMapOptionsConverter accepts a `DashboardSpecialValueMapOptions` object and generates the Go code to build this object using builders.

func DatasourceVariableConverter

func DatasourceVariableConverter(input VariableModel) string

DatasourceVariableConverter accepts a `DatasourceVariable` object and generates the Go code to build this object using builders.

func FieldColorConverter

func FieldColorConverter(input FieldColor) string

FieldColorConverter accepts a `FieldColor` object and generates the Go code to build this object using builders.

func IntervalVariableConverter

func IntervalVariableConverter(input VariableModel) string

IntervalVariableConverter accepts a `IntervalVariable` object and generates the Go code to build this object using builders.

func PanelConverter

func PanelConverter(input Panel) string

PanelConverter accepts a `Panel` object and generates the Go code to build this object using builders.

func QueryVariableConverter

func QueryVariableConverter(input VariableModel) string

QueryVariableConverter accepts a `QueryVariable` object and generates the Go code to build this object using builders.

func RangeMapConverter

func RangeMapConverter(input RangeMap) string

RangeMapConverter accepts a `RangeMap` object and generates the Go code to build this object using builders.

func RegexMapConverter

func RegexMapConverter(input RegexMap) string

RegexMapConverter accepts a `RegexMap` object and generates the Go code to build this object using builders.

func RowConverter

func RowConverter(input RowPanel) string

RowConverter accepts a `Row` object and generates the Go code to build this object using builders.

func SnapshotConverter

func SnapshotConverter(input Snapshot) string

SnapshotConverter accepts a `Snapshot` object and generates the Go code to build this object using builders.

func SpecialValueMapConverter

func SpecialValueMapConverter(input SpecialValueMap) string

SpecialValueMapConverter accepts a `SpecialValueMap` object and generates the Go code to build this object using builders.

func TextBoxVariableConverter

func TextBoxVariableConverter(input VariableModel) string

TextBoxVariableConverter accepts a `TextBoxVariable` object and generates the Go code to build this object using builders.

func ThresholdsConfigConverter

func ThresholdsConfigConverter(input ThresholdsConfig) string

ThresholdsConfigConverter accepts a `ThresholdsConfig` object and generates the Go code to build this object using builders.

func TimePickerConverter

func TimePickerConverter(input TimePickerConfig) string

TimePickerConverter accepts a `TimePicker` object and generates the Go code to build this object using builders.

func ValueMapConverter

func ValueMapConverter(input ValueMap) string

ValueMapConverter accepts a `ValueMap` object and generates the Go code to build this object using builders.

func ValueMappingResultConverter

func ValueMappingResultConverter(input ValueMappingResult) string

ValueMappingResultConverter accepts a `ValueMappingResult` object and generates the Go code to build this object using builders.

Types

type AdHocVariableBuilder

type AdHocVariableBuilder struct {
	// contains filtered or unexported fields
}

A variable is a placeholder for a value. You can use variables in metric queries and in panel titles.

func NewAdHocVariableBuilder

func NewAdHocVariableBuilder(name string) *AdHocVariableBuilder

func (*AdHocVariableBuilder) Build

func (builder *AdHocVariableBuilder) Build() (VariableModel, error)

func (*AdHocVariableBuilder) Datasource

func (builder *AdHocVariableBuilder) Datasource(datasource DataSourceRef) *AdHocVariableBuilder

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

func (*AdHocVariableBuilder) Description

func (builder *AdHocVariableBuilder) Description(description string) *AdHocVariableBuilder

Description of variable. It can be defined but `null`.

func (*AdHocVariableBuilder) Hide

Visibility configuration for the variable

func (*AdHocVariableBuilder) Label

func (builder *AdHocVariableBuilder) Label(label string) *AdHocVariableBuilder

Optional display name

func (*AdHocVariableBuilder) Name

func (builder *AdHocVariableBuilder) Name(name string) *AdHocVariableBuilder

Name of variable

type AnnotationActions

type AnnotationActions struct {
	CanAdd    *bool `json:"canAdd,omitempty"`
	CanDelete *bool `json:"canDelete,omitempty"`
	CanEdit   *bool `json:"canEdit,omitempty"`
}

func (AnnotationActions) Equals

func (resource AnnotationActions) Equals(other AnnotationActions) bool

Equals tests the equality of two `AnnotationActions` objects.

func (*AnnotationActions) UnmarshalJSONStrict

func (resource *AnnotationActions) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `AnnotationActions` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (AnnotationActions) Validate

func (resource AnnotationActions) Validate() error

Validate checks all the validation constraints that may be defined on `AnnotationActions` fields for violations and returns them.

type AnnotationActionsBuilder

type AnnotationActionsBuilder struct {
	// contains filtered or unexported fields
}

func NewAnnotationActionsBuilder

func NewAnnotationActionsBuilder() *AnnotationActionsBuilder

func (*AnnotationActionsBuilder) Build

func (builder *AnnotationActionsBuilder) Build() (AnnotationActions, error)

func (*AnnotationActionsBuilder) CanAdd

func (builder *AnnotationActionsBuilder) CanAdd(canAdd bool) *AnnotationActionsBuilder

func (*AnnotationActionsBuilder) CanDelete

func (builder *AnnotationActionsBuilder) CanDelete(canDelete bool) *AnnotationActionsBuilder

func (*AnnotationActionsBuilder) CanEdit

func (builder *AnnotationActionsBuilder) CanEdit(canEdit bool) *AnnotationActionsBuilder

type AnnotationContainer

type AnnotationContainer struct {
	// List of annotations
	List []AnnotationQuery `json:"list,omitempty"`
}

Contains the list of annotations that are associated with the dashboard. Annotations are used to overlay event markers and overlay event tags on graphs. Grafana comes with a native annotation store and the ability to add annotation events directly from the graph panel or via the HTTP API. See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/annotate-visualizations/

func (AnnotationContainer) Equals

func (resource AnnotationContainer) Equals(other AnnotationContainer) bool

Equals tests the equality of two `AnnotationContainer` objects.

func (*AnnotationContainer) UnmarshalJSONStrict

func (resource *AnnotationContainer) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `AnnotationContainer` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (AnnotationContainer) Validate

func (resource AnnotationContainer) Validate() error

Validate checks all the validation constraints that may be defined on `AnnotationContainer` fields for violations and returns them.

type AnnotationPanelFilter

type AnnotationPanelFilter struct {
	// Should the specified panels be included or excluded
	Exclude *bool `json:"exclude,omitempty"`
	// Panel IDs that should be included or excluded
	Ids []uint8 `json:"ids"`
}

func (AnnotationPanelFilter) Equals

func (resource AnnotationPanelFilter) Equals(other AnnotationPanelFilter) bool

Equals tests the equality of two `AnnotationPanelFilter` objects.

func (*AnnotationPanelFilter) UnmarshalJSONStrict

func (resource *AnnotationPanelFilter) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `AnnotationPanelFilter` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (AnnotationPanelFilter) Validate

func (resource AnnotationPanelFilter) Validate() error

Validate checks all the validation constraints that may be defined on `AnnotationPanelFilter` fields for violations and returns them.

type AnnotationPanelFilterBuilder

type AnnotationPanelFilterBuilder struct {
	// contains filtered or unexported fields
}

func NewAnnotationPanelFilterBuilder

func NewAnnotationPanelFilterBuilder() *AnnotationPanelFilterBuilder

func (*AnnotationPanelFilterBuilder) Build

func (*AnnotationPanelFilterBuilder) Exclude

Should the specified panels be included or excluded

func (*AnnotationPanelFilterBuilder) Ids

Panel IDs that should be included or excluded

type AnnotationPermission

type AnnotationPermission struct {
	Dashboard    *AnnotationActions `json:"dashboard,omitempty"`
	Organization *AnnotationActions `json:"organization,omitempty"`
}

func (AnnotationPermission) Equals

func (resource AnnotationPermission) Equals(other AnnotationPermission) bool

Equals tests the equality of two `AnnotationPermission` objects.

func (*AnnotationPermission) UnmarshalJSONStrict

func (resource *AnnotationPermission) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `AnnotationPermission` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (AnnotationPermission) Validate

func (resource AnnotationPermission) Validate() error

Validate checks all the validation constraints that may be defined on `AnnotationPermission` fields for violations and returns them.

type AnnotationPermissionBuilder

type AnnotationPermissionBuilder struct {
	// contains filtered or unexported fields
}

func NewAnnotationPermissionBuilder

func NewAnnotationPermissionBuilder() *AnnotationPermissionBuilder

func (*AnnotationPermissionBuilder) Build

func (*AnnotationPermissionBuilder) Dashboard

func (*AnnotationPermissionBuilder) Organization

type AnnotationQuery

type AnnotationQuery struct {
	// Name of annotation.
	Name string `json:"name"`
	// Datasource where the annotations data is
	Datasource DataSourceRef `json:"datasource"`
	// When enabled the annotation query is issued with every dashboard refresh
	Enable bool `json:"enable"`
	// Annotation queries can be toggled on or off at the top of the dashboard.
	// When hide is true, the toggle is not shown in the dashboard.
	Hide *bool `json:"hide,omitempty"`
	// Color to use for the annotation event markers
	IconColor string `json:"iconColor"`
	// Filters to apply when fetching annotations
	Filter *AnnotationPanelFilter `json:"filter,omitempty"`
	// TODO.. this should just be a normal query target
	Target *AnnotationTarget `json:"target,omitempty"`
	// TODO -- this should not exist here, it is based on the --grafana-- datasource
	Type *string `json:"type,omitempty"`
	// Set to 1 for the standard annotation query all dashboards have by default.
	BuiltIn *float64 `json:"builtIn,omitempty"`
	Expr    *string  `json:"expr,omitempty"`
}

TODO docs FROM: AnnotationQuery in grafana-data/src/types/annotations.ts

func (AnnotationQuery) Equals

func (resource AnnotationQuery) Equals(other AnnotationQuery) bool

Equals tests the equality of two `AnnotationQuery` objects.

func (*AnnotationQuery) UnmarshalJSONStrict

func (resource *AnnotationQuery) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `AnnotationQuery` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (AnnotationQuery) Validate

func (resource AnnotationQuery) Validate() error

Validate checks all the validation constraints that may be defined on `AnnotationQuery` fields for violations and returns them.

type AnnotationQueryBuilder

type AnnotationQueryBuilder struct {
	// contains filtered or unexported fields
}

TODO docs FROM: AnnotationQuery in grafana-data/src/types/annotations.ts

func NewAnnotationQueryBuilder

func NewAnnotationQueryBuilder() *AnnotationQueryBuilder

func (*AnnotationQueryBuilder) Build

func (builder *AnnotationQueryBuilder) Build() (AnnotationQuery, error)

func (*AnnotationQueryBuilder) BuiltIn

func (builder *AnnotationQueryBuilder) BuiltIn(builtIn float64) *AnnotationQueryBuilder

Set to 1 for the standard annotation query all dashboards have by default.

func (*AnnotationQueryBuilder) Datasource

func (builder *AnnotationQueryBuilder) Datasource(datasource DataSourceRef) *AnnotationQueryBuilder

Datasource where the annotations data is

func (*AnnotationQueryBuilder) Enable

func (builder *AnnotationQueryBuilder) Enable(enable bool) *AnnotationQueryBuilder

When enabled the annotation query is issued with every dashboard refresh

func (*AnnotationQueryBuilder) Expr

func (*AnnotationQueryBuilder) Filter

Filters to apply when fetching annotations

func (*AnnotationQueryBuilder) Hide

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

Annotation queries can be toggled on or off at the top of the dashboard. When hide is true, the toggle is not shown in the dashboard.

func (*AnnotationQueryBuilder) IconColor

func (builder *AnnotationQueryBuilder) IconColor(iconColor string) *AnnotationQueryBuilder

Color to use for the annotation event markers

func (*AnnotationQueryBuilder) Name

Name of annotation.

func (*AnnotationQueryBuilder) Target

TODO.. this should just be a normal query target

func (*AnnotationQueryBuilder) Type

func (builder *AnnotationQueryBuilder) Type(typeArg string) *AnnotationQueryBuilder

TODO -- this should not exist here, it is based on the --grafana-- datasource

type AnnotationTarget

type AnnotationTarget struct {
	// Only required/valid for the grafana datasource...
	// but code+tests is already depending on it so hard to change
	Limit int64 `json:"limit"`
	// Only required/valid for the grafana datasource...
	// but code+tests is already depending on it so hard to change
	MatchAny bool `json:"matchAny"`
	// Only required/valid for the grafana datasource...
	// but code+tests is already depending on it so hard to change
	Tags []string `json:"tags"`
	// Only required/valid for the grafana datasource...
	// but code+tests is already depending on it so hard to change
	Type string `json:"type"`
}

TODO: this should be a regular DataQuery that depends on the selected dashboard these match the properties of the "grafana" datasouce that is default in most dashboards

func (AnnotationTarget) Equals

func (resource AnnotationTarget) Equals(other AnnotationTarget) bool

Equals tests the equality of two `AnnotationTarget` objects.

func (*AnnotationTarget) UnmarshalJSONStrict

func (resource *AnnotationTarget) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `AnnotationTarget` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (AnnotationTarget) Validate

func (resource AnnotationTarget) Validate() error

Validate checks all the validation constraints that may be defined on `AnnotationTarget` fields for violations and returns them.

type AnnotationTargetBuilder

type AnnotationTargetBuilder struct {
	// contains filtered or unexported fields
}

TODO: this should be a regular DataQuery that depends on the selected dashboard these match the properties of the "grafana" datasouce that is default in most dashboards

func NewAnnotationTargetBuilder

func NewAnnotationTargetBuilder() *AnnotationTargetBuilder

func (*AnnotationTargetBuilder) Build

func (builder *AnnotationTargetBuilder) Build() (AnnotationTarget, error)

func (*AnnotationTargetBuilder) Limit

func (builder *AnnotationTargetBuilder) Limit(limit int64) *AnnotationTargetBuilder

Only required/valid for the grafana datasource... but code+tests is already depending on it so hard to change

func (*AnnotationTargetBuilder) MatchAny

func (builder *AnnotationTargetBuilder) MatchAny(matchAny bool) *AnnotationTargetBuilder

Only required/valid for the grafana datasource... but code+tests is already depending on it so hard to change

func (*AnnotationTargetBuilder) Tags

Only required/valid for the grafana datasource... but code+tests is already depending on it so hard to change

func (*AnnotationTargetBuilder) Type

func (builder *AnnotationTargetBuilder) Type(typeArg string) *AnnotationTargetBuilder

Only required/valid for the grafana datasource... but code+tests is already depending on it so hard to change

type ConstantVariableBuilder

type ConstantVariableBuilder struct {
	// contains filtered or unexported fields
}

A variable is a placeholder for a value. You can use variables in metric queries and in panel titles.

func NewConstantVariableBuilder

func NewConstantVariableBuilder(name string) *ConstantVariableBuilder

func (*ConstantVariableBuilder) Build

func (builder *ConstantVariableBuilder) Build() (VariableModel, error)

func (*ConstantVariableBuilder) Description

func (builder *ConstantVariableBuilder) Description(description string) *ConstantVariableBuilder

Description of variable. It can be defined but `null`.

func (*ConstantVariableBuilder) Label

Optional display name

func (*ConstantVariableBuilder) Name

Name of variable

func (*ConstantVariableBuilder) Value

Query used to fetch values for a variable

type CustomVariableBuilder

type CustomVariableBuilder struct {
	// contains filtered or unexported fields
}

A variable is a placeholder for a value. You can use variables in metric queries and in panel titles.

func NewCustomVariableBuilder

func NewCustomVariableBuilder(name string) *CustomVariableBuilder

func (*CustomVariableBuilder) AllValue

func (builder *CustomVariableBuilder) AllValue(allValue string) *CustomVariableBuilder

Custom all value

func (*CustomVariableBuilder) Build

func (builder *CustomVariableBuilder) Build() (VariableModel, error)

func (*CustomVariableBuilder) Current

func (builder *CustomVariableBuilder) Current(current VariableOption) *CustomVariableBuilder

Shows current selected variable text/value on the dashboard

func (*CustomVariableBuilder) Description

func (builder *CustomVariableBuilder) Description(description string) *CustomVariableBuilder

Description of variable. It can be defined but `null`.

func (*CustomVariableBuilder) Hide

Visibility configuration for the variable

func (*CustomVariableBuilder) IncludeAll

func (builder *CustomVariableBuilder) IncludeAll(includeAll bool) *CustomVariableBuilder

Whether all value option is available or not

func (*CustomVariableBuilder) Label

func (builder *CustomVariableBuilder) Label(label string) *CustomVariableBuilder

Optional display name

func (*CustomVariableBuilder) Multi

func (builder *CustomVariableBuilder) Multi(multi bool) *CustomVariableBuilder

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

func (*CustomVariableBuilder) Name

func (builder *CustomVariableBuilder) Name(name string) *CustomVariableBuilder

Name of variable

func (*CustomVariableBuilder) Options

func (builder *CustomVariableBuilder) Options(options []VariableOption) *CustomVariableBuilder

Options that can be selected for a variable.

func (*CustomVariableBuilder) Values

Query used to fetch values for a variable

type Dashboard

type Dashboard struct {
	// Unique numeric identifier for the dashboard.
	// `id` is internal to a specific Grafana instance. `uid` should be used to identify a dashboard across Grafana instances.
	Id *int64 `json:"id,omitempty"`
	// Unique dashboard identifier that can be generated by anyone. string (8-40)
	Uid *string `json:"uid,omitempty"`
	// Title of dashboard.
	Title *string `json:"title,omitempty"`
	// Description of dashboard.
	Description *string `json:"description,omitempty"`
	// This property should only be used in dashboards defined by plugins.  It is a quick check
	// to see if the version has changed since the last time.
	Revision *int64 `json:"revision,omitempty"`
	// ID of a dashboard imported from the https://grafana.com/grafana/dashboards/ portal
	GnetId *string `json:"gnetId,omitempty"`
	// Tags associated with dashboard.
	Tags []string `json:"tags,omitempty"`
	// Timezone of dashboard. Accepted values are IANA TZDB zone ID or "browser" or "utc".
	Timezone *string `json:"timezone,omitempty"`
	// Whether a dashboard is editable or not.
	Editable *bool `json:"editable,omitempty"`
	// Configuration of dashboard cursor sync behavior.
	// Accepted values are 0 (sync turned off), 1 (shared crosshair), 2 (shared crosshair and tooltip).
	GraphTooltip *DashboardCursorSync `json:"graphTooltip,omitempty"`
	// Time range for dashboard.
	// Accepted values are relative time strings like {from: 'now-6h', to: 'now'} or absolute time strings like {from: '2020-07-10T08:00:00.000Z', to: '2020-07-10T14:00:00.000Z'}.
	Time *DashboardDashboardTime `json:"time,omitempty"`
	// Configuration of the time picker shown at the top of a dashboard.
	Timepicker *TimePickerConfig `json:"timepicker,omitempty"`
	// The month that the fiscal year starts on.  0 = January, 11 = December
	FiscalYearStartMonth *uint8 `json:"fiscalYearStartMonth,omitempty"`
	// When set to true, the dashboard will redraw panels at an interval matching the pixel width.
	// This will keep data "moving left" regardless of the query refresh rate. This setting helps
	// avoid dashboards presenting stale live data
	LiveNow *bool `json:"liveNow,omitempty"`
	// Day when the week starts. Expressed by the name of the day in lowercase, e.g. "monday".
	WeekStart *string `json:"weekStart,omitempty"`
	// Refresh rate of dashboard. Represented via interval string, e.g. "5s", "1m", "1h", "1d".
	Refresh *string `json:"refresh,omitempty"`
	// Version of the JSON schema, incremented each time a Grafana update brings
	// changes to said schema.
	SchemaVersion uint16 `json:"schemaVersion"`
	// Version of the dashboard, incremented each time the dashboard is updated.
	Version *uint32 `json:"version,omitempty"`
	// List of dashboard panels
	Panels []PanelOrRowPanel `json:"panels,omitempty"`
	// Configured template variables
	Templating DashboardDashboardTemplating `json:"templating"`
	// Contains the list of annotations that are associated with the dashboard.
	// Annotations are used to overlay event markers and overlay event tags on graphs.
	// Grafana comes with a native annotation store and the ability to add annotation events directly from the graph panel or via the HTTP API.
	// See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/annotate-visualizations/
	Annotations AnnotationContainer `json:"annotations"`
	// Links with references to other dashboards or external websites.
	Links []DashboardLink `json:"links,omitempty"`
	// Snapshot options. They are present only if the dashboard is a snapshot.
	Snapshot *Snapshot `json:"snapshot,omitempty"`
	// When set to true, the dashboard will load all panels in the dashboard when it's loaded.
	Preload *bool `json:"preload,omitempty"`
}

func (Dashboard) Equals

func (resource Dashboard) Equals(other Dashboard) bool

Equals tests the equality of two `Dashboard` objects.

func (*Dashboard) UnmarshalJSONStrict

func (resource *Dashboard) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `Dashboard` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (Dashboard) Validate

func (resource Dashboard) Validate() error

Validate checks all the validation constraints that may be defined on `Dashboard` fields for violations and returns them.

type DashboardBuilder

type DashboardBuilder struct {
	// contains filtered or unexported fields
}

func NewDashboardBuilder

func NewDashboardBuilder(title string) *DashboardBuilder

func (*DashboardBuilder) Annotation

func (builder *DashboardBuilder) Annotation(annotation cog.Builder[AnnotationQuery]) *DashboardBuilder

Contains the list of annotations that are associated with the dashboard. Annotations are used to overlay event markers and overlay event tags on graphs. Grafana comes with a native annotation store and the ability to add annotation events directly from the graph panel or via the HTTP API. See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/annotate-visualizations/

func (*DashboardBuilder) Annotations

func (builder *DashboardBuilder) Annotations(annotations []cog.Builder[AnnotationQuery]) *DashboardBuilder

Contains the list of annotations that are associated with the dashboard. Annotations are used to overlay event markers and overlay event tags on graphs. Grafana comes with a native annotation store and the ability to add annotation events directly from the graph panel or via the HTTP API. See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/annotate-visualizations/

func (*DashboardBuilder) Build

func (builder *DashboardBuilder) Build() (Dashboard, error)

func (*DashboardBuilder) Description

func (builder *DashboardBuilder) Description(description string) *DashboardBuilder

Description of dashboard.

func (*DashboardBuilder) Editable

func (builder *DashboardBuilder) Editable() *DashboardBuilder

Whether a dashboard is editable or not.

func (*DashboardBuilder) FiscalYearStartMonth

func (builder *DashboardBuilder) FiscalYearStartMonth(fiscalYearStartMonth uint8) *DashboardBuilder

The month that the fiscal year starts on. 0 = January, 11 = December

func (*DashboardBuilder) GnetId

func (builder *DashboardBuilder) GnetId(gnetId string) *DashboardBuilder

ID of a dashboard imported from the https://grafana.com/grafana/dashboards/ portal

func (*DashboardBuilder) Id

func (builder *DashboardBuilder) Id(id int64) *DashboardBuilder

Unique numeric identifier for the dashboard. `id` is internal to a specific Grafana instance. `uid` should be used to identify a dashboard across Grafana instances.

Links with references to other dashboards or external websites.

func (builder *DashboardBuilder) Links(links []cog.Builder[DashboardLink]) *DashboardBuilder

Links with references to other dashboards or external websites.

func (*DashboardBuilder) LiveNow

func (builder *DashboardBuilder) LiveNow(liveNow bool) *DashboardBuilder

When set to true, the dashboard will redraw panels at an interval matching the pixel width. This will keep data "moving left" regardless of the query refresh rate. This setting helps avoid dashboards presenting stale live data

func (*DashboardBuilder) Preload

func (builder *DashboardBuilder) Preload(preload bool) *DashboardBuilder

When set to true, the dashboard will load all panels in the dashboard when it's loaded.

func (*DashboardBuilder) Readonly

func (builder *DashboardBuilder) Readonly() *DashboardBuilder

Whether a dashboard is editable or not.

func (*DashboardBuilder) Refresh

func (builder *DashboardBuilder) Refresh(refresh string) *DashboardBuilder

Refresh rate of dashboard. Represented via interval string, e.g. "5s", "1m", "1h", "1d".

func (*DashboardBuilder) Revision

func (builder *DashboardBuilder) Revision(revision int64) *DashboardBuilder

This property should only be used in dashboards defined by plugins. It is a quick check to see if the version has changed since the last time.

func (*DashboardBuilder) Snapshot

func (builder *DashboardBuilder) Snapshot(snapshot cog.Builder[Snapshot]) *DashboardBuilder

Snapshot options. They are present only if the dashboard is a snapshot.

func (*DashboardBuilder) Tags

func (builder *DashboardBuilder) Tags(tags []string) *DashboardBuilder

Tags associated with dashboard.

func (*DashboardBuilder) Time

func (builder *DashboardBuilder) Time(from string, to string) *DashboardBuilder

Time range for dashboard. Accepted values are relative time strings like {from: 'now-6h', to: 'now'} or absolute time strings like {from: '2020-07-10T08:00:00.000Z', to: '2020-07-10T14:00:00.000Z'}.

func (*DashboardBuilder) Timepicker

func (builder *DashboardBuilder) Timepicker(timepicker cog.Builder[TimePickerConfig]) *DashboardBuilder

Configuration of the time picker shown at the top of a dashboard.

func (*DashboardBuilder) Timezone

func (builder *DashboardBuilder) Timezone(timezone string) *DashboardBuilder

Timezone of dashboard. Accepted values are IANA TZDB zone ID or "browser" or "utc".

func (*DashboardBuilder) Title

func (builder *DashboardBuilder) Title(title string) *DashboardBuilder

Title of dashboard.

func (*DashboardBuilder) Tooltip

func (builder *DashboardBuilder) Tooltip(graphTooltip DashboardCursorSync) *DashboardBuilder

Configuration of dashboard cursor sync behavior. Accepted values are 0 (sync turned off), 1 (shared crosshair), 2 (shared crosshair and tooltip).

func (*DashboardBuilder) Uid

func (builder *DashboardBuilder) Uid(uid string) *DashboardBuilder

Unique dashboard identifier that can be generated by anyone. string (8-40)

func (*DashboardBuilder) Variables

func (builder *DashboardBuilder) Variables(variables []cog.Builder[VariableModel]) *DashboardBuilder

Configured template variables

func (*DashboardBuilder) Version

func (builder *DashboardBuilder) Version(version uint32) *DashboardBuilder

Version of the dashboard, incremented each time the dashboard is updated.

func (*DashboardBuilder) WeekStart

func (builder *DashboardBuilder) WeekStart(weekStart string) *DashboardBuilder

Day when the week starts. Expressed by the name of the day in lowercase, e.g. "monday".

func (*DashboardBuilder) WithPanel

func (builder *DashboardBuilder) WithPanel(panel cog.Builder[Panel]) *DashboardBuilder

func (*DashboardBuilder) WithRow

func (builder *DashboardBuilder) WithRow(rowPanel cog.Builder[RowPanel]) *DashboardBuilder

func (*DashboardBuilder) WithVariable

func (builder *DashboardBuilder) WithVariable(variable cog.Builder[VariableModel]) *DashboardBuilder

Configured template variables

type DashboardCursorSync

type DashboardCursorSync int64

0 for no shared crosshair or tooltip (default). 1 for shared crosshair. 2 for shared crosshair AND shared tooltip.

const (
	DashboardCursorSyncOff       DashboardCursorSync = 0
	DashboardCursorSyncCrosshair DashboardCursorSync = 1
	DashboardCursorSyncTooltip   DashboardCursorSync = 2
)

type DashboardDashboardTemplating

type DashboardDashboardTemplating struct {
	// List of configured template variables with their saved values along with some other metadata
	List []VariableModel `json:"list,omitempty"`
}

func (DashboardDashboardTemplating) Equals

Equals tests the equality of two `DashboardDashboardTemplating` objects.

func (*DashboardDashboardTemplating) UnmarshalJSONStrict

func (resource *DashboardDashboardTemplating) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `DashboardDashboardTemplating` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (DashboardDashboardTemplating) Validate

func (resource DashboardDashboardTemplating) Validate() error

Validate checks all the validation constraints that may be defined on `DashboardDashboardTemplating` fields for violations and returns them.

type DashboardDashboardTemplatingBuilder

type DashboardDashboardTemplatingBuilder struct {
	// contains filtered or unexported fields
}

func NewDashboardDashboardTemplatingBuilder

func NewDashboardDashboardTemplatingBuilder() *DashboardDashboardTemplatingBuilder

func (*DashboardDashboardTemplatingBuilder) Build

func (*DashboardDashboardTemplatingBuilder) List

List of configured template variables with their saved values along with some other metadata

type DashboardDashboardTime

type DashboardDashboardTime struct {
	From string `json:"from"`
	To   string `json:"to"`
}

func (DashboardDashboardTime) Equals

func (resource DashboardDashboardTime) Equals(other DashboardDashboardTime) bool

Equals tests the equality of two `DashboardDashboardTime` objects.

func (*DashboardDashboardTime) UnmarshalJSONStrict

func (resource *DashboardDashboardTime) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `DashboardDashboardTime` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (DashboardDashboardTime) Validate

func (resource DashboardDashboardTime) Validate() error

Validate checks all the validation constraints that may be defined on `DashboardDashboardTime` fields for violations and returns them.

type DashboardDashboardTimeBuilder

type DashboardDashboardTimeBuilder struct {
	// contains filtered or unexported fields
}

func NewDashboardDashboardTimeBuilder

func NewDashboardDashboardTimeBuilder() *DashboardDashboardTimeBuilder

func (*DashboardDashboardTimeBuilder) Build

func (*DashboardDashboardTimeBuilder) From

func (*DashboardDashboardTimeBuilder) To

type DashboardFieldConfigSourceOverrides

type DashboardFieldConfigSourceOverrides struct {
	Matcher    MatcherConfig        `json:"matcher"`
	Properties []DynamicConfigValue `json:"properties"`
}

func (DashboardFieldConfigSourceOverrides) Equals

Equals tests the equality of two `DashboardFieldConfigSourceOverrides` objects.

func (*DashboardFieldConfigSourceOverrides) UnmarshalJSONStrict

func (resource *DashboardFieldConfigSourceOverrides) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `DashboardFieldConfigSourceOverrides` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (DashboardFieldConfigSourceOverrides) Validate

func (resource DashboardFieldConfigSourceOverrides) Validate() error

Validate checks all the validation constraints that may be defined on `DashboardFieldConfigSourceOverrides` fields for violations and returns them.

type DashboardFieldConfigSourceOverridesBuilder

type DashboardFieldConfigSourceOverridesBuilder struct {
	// contains filtered or unexported fields
}

func NewDashboardFieldConfigSourceOverridesBuilder

func NewDashboardFieldConfigSourceOverridesBuilder() *DashboardFieldConfigSourceOverridesBuilder

func (*DashboardFieldConfigSourceOverridesBuilder) Build

func (*DashboardFieldConfigSourceOverridesBuilder) Matcher

func (*DashboardFieldConfigSourceOverridesBuilder) Properties

type DashboardLink struct {
	// Title to display with the link
	Title string `json:"title"`
	// Link type. Accepted values are dashboards (to refer to another dashboard) and link (to refer to an external resource)
	Type DashboardLinkType `json:"type"`
	// Icon name to be displayed with the link
	Icon string `json:"icon"`
	// Tooltip to display when the user hovers their mouse over it
	Tooltip string `json:"tooltip"`
	// Link URL. Only required/valid if the type is link
	Url *string `json:"url,omitempty"`
	// List of tags to limit the linked dashboards. If empty, all dashboards will be displayed. Only valid if the type is dashboards
	Tags []string `json:"tags"`
	// If true, all dashboards links will be displayed in a dropdown. If false, all dashboards links will be displayed side by side. Only valid if the type is dashboards
	AsDropdown bool `json:"asDropdown"`
	// If true, the link will be opened in a new tab
	TargetBlank bool `json:"targetBlank"`
	// If true, includes current template variables values in the link as query params
	IncludeVars bool `json:"includeVars"`
	// If true, includes current time range in the link as query params
	KeepTime bool `json:"keepTime"`
}

Links with references to other dashboards or external resources

func (DashboardLink) Equals

func (resource DashboardLink) Equals(other DashboardLink) bool

Equals tests the equality of two `DashboardLink` objects.

func (*DashboardLink) UnmarshalJSONStrict

func (resource *DashboardLink) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `DashboardLink` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (DashboardLink) Validate

func (resource DashboardLink) Validate() error

Validate checks all the validation constraints that may be defined on `DashboardLink` fields for violations and returns them.

type DashboardLinkBuilder

type DashboardLinkBuilder struct {
	// contains filtered or unexported fields
}

Links with references to other dashboards or external resources

func NewDashboardLinkBuilder

func NewDashboardLinkBuilder(title string) *DashboardLinkBuilder

func (*DashboardLinkBuilder) AsDropdown

func (builder *DashboardLinkBuilder) AsDropdown(asDropdown bool) *DashboardLinkBuilder

If true, all dashboards links will be displayed in a dropdown. If false, all dashboards links will be displayed side by side. Only valid if the type is dashboards

func (*DashboardLinkBuilder) Build

func (builder *DashboardLinkBuilder) Build() (DashboardLink, error)

func (*DashboardLinkBuilder) Icon

func (builder *DashboardLinkBuilder) Icon(icon string) *DashboardLinkBuilder

Icon name to be displayed with the link

func (*DashboardLinkBuilder) IncludeVars

func (builder *DashboardLinkBuilder) IncludeVars(includeVars bool) *DashboardLinkBuilder

If true, includes current template variables values in the link as query params

func (*DashboardLinkBuilder) KeepTime

func (builder *DashboardLinkBuilder) KeepTime(keepTime bool) *DashboardLinkBuilder

If true, includes current time range in the link as query params

func (*DashboardLinkBuilder) Tags

func (builder *DashboardLinkBuilder) Tags(tags []string) *DashboardLinkBuilder

List of tags to limit the linked dashboards. If empty, all dashboards will be displayed. Only valid if the type is dashboards

func (*DashboardLinkBuilder) TargetBlank

func (builder *DashboardLinkBuilder) TargetBlank(targetBlank bool) *DashboardLinkBuilder

If true, the link will be opened in a new tab

func (*DashboardLinkBuilder) Title

func (builder *DashboardLinkBuilder) Title(title string) *DashboardLinkBuilder

Title to display with the link

func (*DashboardLinkBuilder) Tooltip

func (builder *DashboardLinkBuilder) Tooltip(tooltip string) *DashboardLinkBuilder

Tooltip to display when the user hovers their mouse over it

func (*DashboardLinkBuilder) Type

Link type. Accepted values are dashboards (to refer to another dashboard) and link (to refer to an external resource)

func (*DashboardLinkBuilder) Url

Link URL. Only required/valid if the type is link

type DashboardLinkType

type DashboardLinkType string

Dashboard Link type. Accepted values are dashboards (to refer to another dashboard) and link (to refer to an external resource)

const (
	DashboardLinkTypeLink       DashboardLinkType = "link"
	DashboardLinkTypeDashboards DashboardLinkType = "dashboards"
)

type DashboardMeta

type DashboardMeta struct {
	AnnotationsPermissions *AnnotationPermission `json:"annotationsPermissions,omitempty"`
	CanAdmin               *bool                 `json:"canAdmin,omitempty"`
	CanDelete              *bool                 `json:"canDelete,omitempty"`
	CanEdit                *bool                 `json:"canEdit,omitempty"`
	CanSave                *bool                 `json:"canSave,omitempty"`
	CanStar                *bool                 `json:"canStar,omitempty"`
	Created                *time.Time            `json:"created,omitempty"`
	CreatedBy              *string               `json:"createdBy,omitempty"`
	Expires                *time.Time            `json:"expires,omitempty"`
	// Deprecated: use FolderUID instead
	FolderId               *int64     `json:"folderId,omitempty"`
	FolderTitle            *string    `json:"folderTitle,omitempty"`
	FolderUid              *string    `json:"folderUid,omitempty"`
	FolderUrl              *string    `json:"folderUrl,omitempty"`
	HasAcl                 *bool      `json:"hasAcl,omitempty"`
	IsFolder               *bool      `json:"isFolder,omitempty"`
	IsSnapshot             *bool      `json:"isSnapshot,omitempty"`
	IsStarred              *bool      `json:"isStarred,omitempty"`
	Provisioned            *bool      `json:"provisioned,omitempty"`
	ProvisionedExternalId  *string    `json:"provisionedExternalId,omitempty"`
	PublicDashboardEnabled *bool      `json:"publicDashboardEnabled,omitempty"`
	Slug                   *string    `json:"slug,omitempty"`
	Type                   *string    `json:"type,omitempty"`
	Updated                *time.Time `json:"updated,omitempty"`
	UpdatedBy              *string    `json:"updatedBy,omitempty"`
	Url                    *string    `json:"url,omitempty"`
	Version                *int64     `json:"version,omitempty"`
}

func (DashboardMeta) Equals

func (resource DashboardMeta) Equals(other DashboardMeta) bool

Equals tests the equality of two `DashboardMeta` objects.

func (*DashboardMeta) UnmarshalJSONStrict

func (resource *DashboardMeta) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `DashboardMeta` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (DashboardMeta) Validate

func (resource DashboardMeta) Validate() error

Validate checks all the validation constraints that may be defined on `DashboardMeta` fields for violations and returns them.

type DashboardMetaBuilder

type DashboardMetaBuilder struct {
	// contains filtered or unexported fields
}

func NewDashboardMetaBuilder

func NewDashboardMetaBuilder() *DashboardMetaBuilder

func (*DashboardMetaBuilder) AnnotationsPermissions

func (builder *DashboardMetaBuilder) AnnotationsPermissions(annotationsPermissions cog.Builder[AnnotationPermission]) *DashboardMetaBuilder

func (*DashboardMetaBuilder) Build

func (builder *DashboardMetaBuilder) Build() (DashboardMeta, error)

func (*DashboardMetaBuilder) CanAdmin

func (builder *DashboardMetaBuilder) CanAdmin(canAdmin bool) *DashboardMetaBuilder

func (*DashboardMetaBuilder) CanDelete

func (builder *DashboardMetaBuilder) CanDelete(canDelete bool) *DashboardMetaBuilder

func (*DashboardMetaBuilder) CanEdit

func (builder *DashboardMetaBuilder) CanEdit(canEdit bool) *DashboardMetaBuilder

func (*DashboardMetaBuilder) CanSave

func (builder *DashboardMetaBuilder) CanSave(canSave bool) *DashboardMetaBuilder

func (*DashboardMetaBuilder) CanStar

func (builder *DashboardMetaBuilder) CanStar(canStar bool) *DashboardMetaBuilder

func (*DashboardMetaBuilder) Created

func (builder *DashboardMetaBuilder) Created(created time.Time) *DashboardMetaBuilder

func (*DashboardMetaBuilder) CreatedBy

func (builder *DashboardMetaBuilder) CreatedBy(createdBy string) *DashboardMetaBuilder

func (*DashboardMetaBuilder) Expires

func (builder *DashboardMetaBuilder) Expires(expires time.Time) *DashboardMetaBuilder

func (*DashboardMetaBuilder) FolderId deprecated

func (builder *DashboardMetaBuilder) FolderId(folderId int64) *DashboardMetaBuilder

Deprecated: use FolderUID instead

func (*DashboardMetaBuilder) FolderTitle

func (builder *DashboardMetaBuilder) FolderTitle(folderTitle string) *DashboardMetaBuilder

func (*DashboardMetaBuilder) FolderUid

func (builder *DashboardMetaBuilder) FolderUid(folderUid string) *DashboardMetaBuilder

func (*DashboardMetaBuilder) FolderUrl

func (builder *DashboardMetaBuilder) FolderUrl(folderUrl string) *DashboardMetaBuilder

func (*DashboardMetaBuilder) HasAcl

func (builder *DashboardMetaBuilder) HasAcl(hasAcl bool) *DashboardMetaBuilder

func (*DashboardMetaBuilder) IsFolder

func (builder *DashboardMetaBuilder) IsFolder(isFolder bool) *DashboardMetaBuilder

func (*DashboardMetaBuilder) IsSnapshot

func (builder *DashboardMetaBuilder) IsSnapshot(isSnapshot bool) *DashboardMetaBuilder

func (*DashboardMetaBuilder) IsStarred

func (builder *DashboardMetaBuilder) IsStarred(isStarred bool) *DashboardMetaBuilder

func (*DashboardMetaBuilder) Provisioned

func (builder *DashboardMetaBuilder) Provisioned(provisioned bool) *DashboardMetaBuilder

func (*DashboardMetaBuilder) ProvisionedExternalId

func (builder *DashboardMetaBuilder) ProvisionedExternalId(provisionedExternalId string) *DashboardMetaBuilder

func (*DashboardMetaBuilder) PublicDashboardEnabled

func (builder *DashboardMetaBuilder) PublicDashboardEnabled(publicDashboardEnabled bool) *DashboardMetaBuilder

func (*DashboardMetaBuilder) Slug

func (builder *DashboardMetaBuilder) Slug(slug string) *DashboardMetaBuilder

func (*DashboardMetaBuilder) Type

func (builder *DashboardMetaBuilder) Type(typeArg string) *DashboardMetaBuilder

func (*DashboardMetaBuilder) Updated

func (builder *DashboardMetaBuilder) Updated(updated time.Time) *DashboardMetaBuilder

func (*DashboardMetaBuilder) UpdatedBy

func (builder *DashboardMetaBuilder) UpdatedBy(updatedBy string) *DashboardMetaBuilder

func (*DashboardMetaBuilder) Url

func (*DashboardMetaBuilder) Version

func (builder *DashboardMetaBuilder) Version(version int64) *DashboardMetaBuilder

type DashboardRangeMapOptions

type DashboardRangeMapOptions struct {
	// Min value of the range. It can be null which means -Infinity
	From *float64 `json:"from"`
	// Max value of the range. It can be null which means +Infinity
	To *float64 `json:"to"`
	// Config to apply when the value is within the range
	Result ValueMappingResult `json:"result"`
}

func (DashboardRangeMapOptions) Equals

Equals tests the equality of two `DashboardRangeMapOptions` objects.

func (*DashboardRangeMapOptions) UnmarshalJSONStrict

func (resource *DashboardRangeMapOptions) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `DashboardRangeMapOptions` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (DashboardRangeMapOptions) Validate

func (resource DashboardRangeMapOptions) Validate() error

Validate checks all the validation constraints that may be defined on `DashboardRangeMapOptions` fields for violations and returns them.

type DashboardRangeMapOptionsBuilder

type DashboardRangeMapOptionsBuilder struct {
	// contains filtered or unexported fields
}

func NewDashboardRangeMapOptionsBuilder

func NewDashboardRangeMapOptionsBuilder() *DashboardRangeMapOptionsBuilder

func (*DashboardRangeMapOptionsBuilder) Build

func (*DashboardRangeMapOptionsBuilder) From

Min value of the range. It can be null which means -Infinity

func (*DashboardRangeMapOptionsBuilder) Result

Config to apply when the value is within the range

func (*DashboardRangeMapOptionsBuilder) To

Max value of the range. It can be null which means +Infinity

type DashboardRegexMapOptions

type DashboardRegexMapOptions struct {
	// Regular expression to match against
	Pattern string `json:"pattern"`
	// Config to apply when the value matches the regex
	Result ValueMappingResult `json:"result"`
}

func (DashboardRegexMapOptions) Equals

Equals tests the equality of two `DashboardRegexMapOptions` objects.

func (*DashboardRegexMapOptions) UnmarshalJSONStrict

func (resource *DashboardRegexMapOptions) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `DashboardRegexMapOptions` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (DashboardRegexMapOptions) Validate

func (resource DashboardRegexMapOptions) Validate() error

Validate checks all the validation constraints that may be defined on `DashboardRegexMapOptions` fields for violations and returns them.

type DashboardRegexMapOptionsBuilder

type DashboardRegexMapOptionsBuilder struct {
	// contains filtered or unexported fields
}

func NewDashboardRegexMapOptionsBuilder

func NewDashboardRegexMapOptionsBuilder() *DashboardRegexMapOptionsBuilder

func (*DashboardRegexMapOptionsBuilder) Build

func (*DashboardRegexMapOptionsBuilder) Pattern

Regular expression to match against

func (*DashboardRegexMapOptionsBuilder) Result

Config to apply when the value matches the regex

type DashboardSpecialValueMapOptions

type DashboardSpecialValueMapOptions struct {
	// Special value to match against
	Match SpecialValueMatch `json:"match"`
	// Config to apply when the value matches the special value
	Result ValueMappingResult `json:"result"`
}

func (DashboardSpecialValueMapOptions) Equals

Equals tests the equality of two `DashboardSpecialValueMapOptions` objects.

func (*DashboardSpecialValueMapOptions) UnmarshalJSONStrict

func (resource *DashboardSpecialValueMapOptions) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `DashboardSpecialValueMapOptions` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (DashboardSpecialValueMapOptions) Validate

func (resource DashboardSpecialValueMapOptions) Validate() error

Validate checks all the validation constraints that may be defined on `DashboardSpecialValueMapOptions` fields for violations and returns them.

type DashboardSpecialValueMapOptionsBuilder

type DashboardSpecialValueMapOptionsBuilder struct {
	// contains filtered or unexported fields
}

func NewDashboardSpecialValueMapOptionsBuilder

func NewDashboardSpecialValueMapOptionsBuilder() *DashboardSpecialValueMapOptionsBuilder

func (*DashboardSpecialValueMapOptionsBuilder) Build

func (*DashboardSpecialValueMapOptionsBuilder) Match

Special value to match against

func (*DashboardSpecialValueMapOptionsBuilder) Result

Config to apply when the value matches the special value

type DataSourceRef

type DataSourceRef struct {
	// The plugin type-id
	Type *string `json:"type,omitempty"`
	// Specific datasource instance
	Uid *string `json:"uid,omitempty"`
}

Ref to a DataSource instance

func (DataSourceRef) Equals

func (resource DataSourceRef) Equals(other DataSourceRef) bool

Equals tests the equality of two `DataSourceRef` objects.

func (*DataSourceRef) UnmarshalJSON

func (resource *DataSourceRef) UnmarshalJSON(raw []byte) error

func (*DataSourceRef) UnmarshalJSONStrict

func (resource *DataSourceRef) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `DataSourceRef` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (DataSourceRef) Validate

func (resource DataSourceRef) Validate() error

Validate checks all the validation constraints that may be defined on `DataSourceRef` fields for violations and returns them.

type DataTransformerConfig

type DataTransformerConfig struct {
	// Unique identifier of transformer
	Id string `json:"id"`
	// Disabled transformations are skipped
	Disabled *bool `json:"disabled,omitempty"`
	// Optional frame matcher. When missing it will be applied to all results
	Filter *MatcherConfig `json:"filter,omitempty"`
	// Where to pull DataFrames from as input to transformation
	Topic *DataTransformerConfigTopic `json:"topic,omitempty"`
	// Options to be passed to the transformer
	// Valid options depend on the transformer id
	Options any `json:"options"`
}

Transformations allow to manipulate data returned by a query before the system applies a visualization. Using transformations you can: rename fields, join time series data, perform mathematical operations across queries, use the output of one transformation as the input to another transformation, etc.

func (DataTransformerConfig) Equals

func (resource DataTransformerConfig) Equals(other DataTransformerConfig) bool

Equals tests the equality of two `DataTransformerConfig` objects.

func (*DataTransformerConfig) UnmarshalJSONStrict

func (resource *DataTransformerConfig) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `DataTransformerConfig` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (DataTransformerConfig) Validate

func (resource DataTransformerConfig) Validate() error

Validate checks all the validation constraints that may be defined on `DataTransformerConfig` fields for violations and returns them.

type DataTransformerConfigTopic

type DataTransformerConfigTopic string
const (
	DataTransformerConfigTopicSeries      DataTransformerConfigTopic = "series"
	DataTransformerConfigTopicAnnotations DataTransformerConfigTopic = "annotations"
	DataTransformerConfigTopicAlertStates DataTransformerConfigTopic = "alertStates"
)

type DatasourceVariableBuilder

type DatasourceVariableBuilder struct {
	// contains filtered or unexported fields
}

A variable is a placeholder for a value. You can use variables in metric queries and in panel titles.

func NewDatasourceVariableBuilder

func NewDatasourceVariableBuilder(name string) *DatasourceVariableBuilder

func (*DatasourceVariableBuilder) AllValue

func (builder *DatasourceVariableBuilder) AllValue(allValue string) *DatasourceVariableBuilder

Custom all value

func (*DatasourceVariableBuilder) Build

func (builder *DatasourceVariableBuilder) Build() (VariableModel, error)

func (*DatasourceVariableBuilder) Current

Shows current selected variable text/value on the dashboard

func (*DatasourceVariableBuilder) Description

func (builder *DatasourceVariableBuilder) Description(description string) *DatasourceVariableBuilder

Description of variable. It can be defined but `null`.

func (*DatasourceVariableBuilder) Hide

Visibility configuration for the variable

func (*DatasourceVariableBuilder) IncludeAll

func (builder *DatasourceVariableBuilder) IncludeAll(includeAll bool) *DatasourceVariableBuilder

Whether all value option is available or not

func (*DatasourceVariableBuilder) Label

Optional display name

func (*DatasourceVariableBuilder) Multi

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

func (*DatasourceVariableBuilder) Name

Name of variable

func (*DatasourceVariableBuilder) 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.

func (*DatasourceVariableBuilder) Type

Query used to fetch values for a variable

type DynamicConfigValue

type DynamicConfigValue struct {
	Id    string `json:"id"`
	Value any    `json:"value,omitempty"`
}

func (DynamicConfigValue) Equals

func (resource DynamicConfigValue) Equals(other DynamicConfigValue) bool

Equals tests the equality of two `DynamicConfigValue` objects.

func (*DynamicConfigValue) UnmarshalJSONStrict

func (resource *DynamicConfigValue) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `DynamicConfigValue` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (DynamicConfigValue) Validate

func (resource DynamicConfigValue) Validate() error

Validate checks all the validation constraints that may be defined on `DynamicConfigValue` fields for violations and returns them.

type FieldColor

type FieldColor struct {
	// The main color scheme mode.
	Mode FieldColorModeId `json:"mode"`
	// The fixed color value for fixed or shades color modes.
	FixedColor *string `json:"fixedColor,omitempty"`
	// Some visualizations need to know how to assign a series color from by value color schemes.
	SeriesBy *FieldColorSeriesByMode `json:"seriesBy,omitempty"`
}

Map a field to a color.

func (FieldColor) Equals

func (resource FieldColor) Equals(other FieldColor) bool

Equals tests the equality of two `FieldColor` objects.

func (*FieldColor) UnmarshalJSONStrict

func (resource *FieldColor) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `FieldColor` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (FieldColor) Validate

func (resource FieldColor) Validate() error

Validate checks all the validation constraints that may be defined on `FieldColor` fields for violations and returns them.

type FieldColorBuilder

type FieldColorBuilder struct {
	// contains filtered or unexported fields
}

Map a field to a color.

func NewFieldColorBuilder

func NewFieldColorBuilder() *FieldColorBuilder

func (*FieldColorBuilder) Build

func (builder *FieldColorBuilder) Build() (FieldColor, error)

func (*FieldColorBuilder) FixedColor

func (builder *FieldColorBuilder) FixedColor(fixedColor string) *FieldColorBuilder

The fixed color value for fixed or shades color modes.

func (*FieldColorBuilder) Mode

The main color scheme mode.

func (*FieldColorBuilder) SeriesBy

func (builder *FieldColorBuilder) SeriesBy(seriesBy FieldColorSeriesByMode) *FieldColorBuilder

Some visualizations need to know how to assign a series color from by value color schemes.

type FieldColorModeId

type FieldColorModeId string

Color mode for a field. You can specify a single color, or select a continuous (gradient) color schemes, based on a value. Continuous color interpolates a color using the percentage of a value relative to min and max. Accepted values are: `thresholds`: From thresholds. Informs Grafana to take the color from the matching threshold `palette-classic`: Classic palette. Grafana will assign color by looking up a color in a palette by series index. Useful for Graphs and pie charts and other categorical data visualizations `palette-classic-by-name`: Classic palette (by name). Grafana will assign color by looking up a color in a palette by series name. Useful for Graphs and pie charts and other categorical data visualizations `continuous-GrYlRd`: ontinuous Green-Yellow-Red palette mode `continuous-RdYlGr`: Continuous Red-Yellow-Green palette mode `continuous-BlYlRd`: Continuous Blue-Yellow-Red palette mode `continuous-YlRd`: Continuous Yellow-Red palette mode `continuous-BlPu`: Continuous Blue-Purple palette mode `continuous-YlBl`: Continuous Yellow-Blue palette mode `continuous-blues`: Continuous Blue palette mode `continuous-reds`: Continuous Red palette mode `continuous-greens`: Continuous Green palette mode `continuous-purples`: Continuous Purple palette mode `shades`: Shades of a single color. Specify a single color, useful in an override rule. `fixed`: Fixed color mode. Specify a single color, useful in an override rule.

const (
	FieldColorModeIdThresholds           FieldColorModeId = "thresholds"
	FieldColorModeIdPaletteClassic       FieldColorModeId = "palette-classic"
	FieldColorModeIdPaletteClassicByName FieldColorModeId = "palette-classic-by-name"
	FieldColorModeIdContinuousGrYlRd     FieldColorModeId = "continuous-GrYlRd"
	FieldColorModeIdContinuousRdYlGr     FieldColorModeId = "continuous-RdYlGr"
	FieldColorModeIdContinuousBlYlRd     FieldColorModeId = "continuous-BlYlRd"
	FieldColorModeIdContinuousYlRd       FieldColorModeId = "continuous-YlRd"
	FieldColorModeIdContinuousBlPu       FieldColorModeId = "continuous-BlPu"
	FieldColorModeIdContinuousYlBl       FieldColorModeId = "continuous-YlBl"
	FieldColorModeIdContinuousBlues      FieldColorModeId = "continuous-blues"
	FieldColorModeIdContinuousReds       FieldColorModeId = "continuous-reds"
	FieldColorModeIdContinuousGreens     FieldColorModeId = "continuous-greens"
	FieldColorModeIdContinuousPurples    FieldColorModeId = "continuous-purples"
	FieldColorModeIdFixed                FieldColorModeId = "fixed"
	FieldColorModeIdShades               FieldColorModeId = "shades"
)

type FieldColorSeriesByMode

type FieldColorSeriesByMode string

Defines how to assign a series color from "by value" color schemes. For example for an aggregated data points like a timeseries, the color can be assigned by the min, max or last value.

const (
	FieldColorSeriesByModeMin  FieldColorSeriesByMode = "min"
	FieldColorSeriesByModeMax  FieldColorSeriesByMode = "max"
	FieldColorSeriesByModeLast FieldColorSeriesByMode = "last"
)

type FieldConfig

type FieldConfig struct {
	// The display value for this field.  This supports template variables blank is auto
	DisplayName *string `json:"displayName,omitempty"`
	// This can be used by data sources that return and explicit naming structure for values and labels
	// When this property is configured, this value is used rather than the default naming strategy.
	DisplayNameFromDS *string `json:"displayNameFromDS,omitempty"`
	// Human readable field metadata
	Description *string `json:"description,omitempty"`
	// An explicit path to the field in the datasource.  When the frame meta includes a path,
	// This will default to `${frame.meta.path}/${field.name}
	//
	// When defined, this value can be used as an identifier within the datasource scope, and
	// may be used to update the results
	Path *string `json:"path,omitempty"`
	// True if data source can write a value to the path. Auth/authz are supported separately
	Writeable *bool `json:"writeable,omitempty"`
	// True if data source field supports ad-hoc filters
	Filterable *bool `json:"filterable,omitempty"`
	// Unit a field should use. The unit you select is applied to all fields except time.
	// You can use the units ID availables in Grafana or a custom unit.
	// Available units in Grafana: https://github.com/grafana/grafana/blob/main/packages/grafana-data/src/valueFormats/categories.ts
	// As custom unit, you can use the following formats:
	// `suffix:<suffix>` for custom unit that should go after value.
	// `prefix:<prefix>` for custom unit that should go before value.
	// `time:<format>` For custom date time formats type for example `time:YYYY-MM-DD`.
	// `si:<base scale><unit characters>` for custom SI units. For example: `si: mF`. This one is a bit more advanced as you can specify both a unit and the source data scale. So if your source data is represented as milli (thousands of) something prefix the unit with that SI scale character.
	// `count:<unit>` for a custom count unit.
	// `currency:<unit>` for custom a currency unit.
	Unit *string `json:"unit,omitempty"`
	// Specify the number of decimals Grafana includes in the rendered value.
	// If you leave this field blank, Grafana automatically truncates the number of decimals based on the value.
	// For example 1.1234 will display as 1.12 and 100.456 will display as 100.
	// To display all decimals, set the unit to `String`.
	Decimals *float64 `json:"decimals,omitempty"`
	// The minimum value used in percentage threshold calculations. Leave blank for auto calculation based on all series and fields.
	Min *float64 `json:"min,omitempty"`
	// The maximum value used in percentage threshold calculations. Leave blank for auto calculation based on all series and fields.
	Max *float64 `json:"max,omitempty"`
	// Convert input values into a display string
	Mappings []ValueMapping `json:"mappings,omitempty"`
	// Map numeric values to states
	Thresholds *ThresholdsConfig `json:"thresholds,omitempty"`
	// Panel color configuration
	Color *FieldColor `json:"color,omitempty"`
	// The behavior when clicking on a result
	Links []any `json:"links,omitempty"`
	// Alternative to empty string
	NoValue *string `json:"noValue,omitempty"`
	// custom is specified by the FieldConfig field
	// in panel plugin schemas.
	Custom any `json:"custom,omitempty"`
}

The data model used in Grafana, namely the data frame, is a columnar-oriented table structure that unifies both time series and table query results. Each column within this structure is called a field. A field can represent a single time series or table column. Field options allow you to change how the data is displayed in your visualizations.

func (FieldConfig) Equals

func (resource FieldConfig) Equals(other FieldConfig) bool

Equals tests the equality of two `FieldConfig` objects.

func (*FieldConfig) UnmarshalJSONStrict

func (resource *FieldConfig) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `FieldConfig` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (FieldConfig) Validate

func (resource FieldConfig) Validate() error

Validate checks all the validation constraints that may be defined on `FieldConfig` fields for violations and returns them.

type FieldConfigSource

type FieldConfigSource struct {
	// Defaults are the options applied to all fields.
	Defaults FieldConfig `json:"defaults"`
	// Overrides are the options applied to specific fields overriding the defaults.
	Overrides []DashboardFieldConfigSourceOverrides `json:"overrides"`
}

The data model used in Grafana, namely the data frame, is a columnar-oriented table structure that unifies both time series and table query results. Each column within this structure is called a field. A field can represent a single time series or table column. Field options allow you to change how the data is displayed in your visualizations.

func (FieldConfigSource) Equals

func (resource FieldConfigSource) Equals(other FieldConfigSource) bool

Equals tests the equality of two `FieldConfigSource` objects.

func (*FieldConfigSource) UnmarshalJSONStrict

func (resource *FieldConfigSource) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `FieldConfigSource` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (FieldConfigSource) Validate

func (resource FieldConfigSource) Validate() error

Validate checks all the validation constraints that may be defined on `FieldConfigSource` fields for violations and returns them.

type GridPos

type GridPos struct {
	// Panel height. The height is the number of rows from the top edge of the panel.
	H uint32 `json:"h"`
	// Panel width. The width is the number of columns from the left edge of the panel.
	W uint32 `json:"w"`
	// Panel x. The x coordinate is the number of columns from the left edge of the grid
	X uint32 `json:"x"`
	// Panel y. The y coordinate is the number of rows from the top edge of the grid
	Y uint32 `json:"y"`
	// Whether the panel is fixed within the grid. If true, the panel will not be affected by other panels' interactions
	Static *bool `json:"static,omitempty"`
}

Position and dimensions of a panel in the grid

func (GridPos) Equals

func (resource GridPos) Equals(other GridPos) bool

Equals tests the equality of two `GridPos` objects.

func (*GridPos) UnmarshalJSONStrict

func (resource *GridPos) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `GridPos` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (GridPos) Validate

func (resource GridPos) Validate() error

Validate checks all the validation constraints that may be defined on `GridPos` fields for violations and returns them.

type IntervalVariableBuilder

type IntervalVariableBuilder struct {
	// contains filtered or unexported fields
}

A variable is a placeholder for a value. You can use variables in metric queries and in panel titles.

func NewIntervalVariableBuilder

func NewIntervalVariableBuilder(name string) *IntervalVariableBuilder

func (*IntervalVariableBuilder) Build

func (builder *IntervalVariableBuilder) Build() (VariableModel, error)

func (*IntervalVariableBuilder) Current

Shows current selected variable text/value on the dashboard

func (*IntervalVariableBuilder) Description

func (builder *IntervalVariableBuilder) Description(description string) *IntervalVariableBuilder

Description of variable. It can be defined but `null`.

func (*IntervalVariableBuilder) Hide

Visibility configuration for the variable

func (*IntervalVariableBuilder) Label

Optional display name

func (*IntervalVariableBuilder) Name

Name of variable

func (*IntervalVariableBuilder) Options

func (builder *IntervalVariableBuilder) Options(options []VariableOption) *IntervalVariableBuilder

Options that can be selected for a variable.

func (*IntervalVariableBuilder) Values

Query used to fetch values for a variable

type LibraryPanelRef

type LibraryPanelRef struct {
	// Library panel name
	Name string `json:"name"`
	// Library panel uid
	Uid string `json:"uid"`
}

A library panel is a reusable panel that you can use in any dashboard. When you make a change to a library panel, that change propagates to all instances of where the panel is used. Library panels streamline reuse of panels across multiple dashboards.

func (LibraryPanelRef) Equals

func (resource LibraryPanelRef) Equals(other LibraryPanelRef) bool

Equals tests the equality of two `LibraryPanelRef` objects.

func (*LibraryPanelRef) UnmarshalJSONStrict

func (resource *LibraryPanelRef) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `LibraryPanelRef` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (LibraryPanelRef) Validate

func (resource LibraryPanelRef) Validate() error

Validate checks all the validation constraints that may be defined on `LibraryPanelRef` fields for violations and returns them.

type MappingType

type MappingType string

Supported value mapping types `value`: Maps text values to a color or different display text and color. For example, you can configure a value mapping so that all instances of the value 10 appear as Perfection! rather than the number. `range`: Maps numerical ranges to a display text and color. For example, if a value is within a certain range, you can configure a range value mapping to display Low or High rather than the number. `regex`: Maps regular expressions to replacement text and a color. For example, if a value is www.example.com, you can configure a regex value mapping so that Grafana displays www and truncates the domain. `special`: Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text and color. See SpecialValueMatch to see the list of special values. For example, you can configure a special value mapping so that null values appear as N/A.

const (
	MappingTypeValueToText  MappingType = "value"
	MappingTypeRangeToText  MappingType = "range"
	MappingTypeRegexToText  MappingType = "regex"
	MappingTypeSpecialValue MappingType = "special"
)

type MatcherConfig

type MatcherConfig struct {
	// The matcher id. This is used to find the matcher implementation from registry.
	Id string `json:"id"`
	// The matcher options. This is specific to the matcher implementation.
	Options any `json:"options,omitempty"`
}

Matcher is a predicate configuration. Based on the config a set of field(s) or values is filtered in order to apply override / transformation. It comes with in id ( to resolve implementation from registry) and a configuration that’s specific to a particular matcher type.

func (MatcherConfig) Equals

func (resource MatcherConfig) Equals(other MatcherConfig) bool

Equals tests the equality of two `MatcherConfig` objects.

func (*MatcherConfig) UnmarshalJSONStrict

func (resource *MatcherConfig) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `MatcherConfig` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (MatcherConfig) Validate

func (resource MatcherConfig) Validate() error

Validate checks all the validation constraints that may be defined on `MatcherConfig` fields for violations and returns them.

type Panel

type Panel struct {
	// The panel plugin type id. This is used to find the plugin to display the panel.
	Type string `json:"type"`
	// Unique identifier of the panel. Generated by Grafana when creating a new panel. It must be unique within a dashboard, but not globally.
	Id *uint32 `json:"id,omitempty"`
	// The version of the plugin that is used for this panel. This is used to find the plugin to display the panel and to migrate old panel configs.
	PluginVersion *string `json:"pluginVersion,omitempty"`
	// Depends on the panel plugin. See the plugin documentation for details.
	Targets []variants.Dataquery `json:"targets,omitempty"`
	// Panel title.
	Title *string `json:"title,omitempty"`
	// Panel description.
	Description *string `json:"description,omitempty"`
	// Whether to display the panel without a background.
	Transparent *bool `json:"transparent,omitempty"`
	// The datasource used in all targets.
	Datasource *DataSourceRef `json:"datasource,omitempty"`
	// Grid position.
	GridPos *GridPos `json:"gridPos,omitempty"`
	// Panel links.
	Links []DashboardLink `json:"links,omitempty"`
	// Name of template variable to repeat for.
	Repeat *string `json:"repeat,omitempty"`
	// Direction to repeat in if 'repeat' is set.
	// `h` for horizontal, `v` for vertical.
	RepeatDirection *PanelRepeatDirection `json:"repeatDirection,omitempty"`
	// Option for repeated panels that controls max items per row
	// Only relevant for horizontally repeated panels
	MaxPerRow *float64 `json:"maxPerRow,omitempty"`
	// The maximum number of data points that the panel queries are retrieving.
	MaxDataPoints *float64 `json:"maxDataPoints,omitempty"`
	// List of transformations that are applied to the panel data before rendering.
	// When there are multiple transformations, Grafana applies them in the order they are listed.
	// Each transformation creates a result set that then passes on to the next transformation in the processing pipeline.
	Transformations []DataTransformerConfig `json:"transformations,omitempty"`
	// The min time interval setting defines a lower limit for the $__interval and $__interval_ms variables.
	// This value must be formatted as a number followed by a valid time
	// identifier like: "40s", "3d", etc.
	// See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options
	Interval *string `json:"interval,omitempty"`
	// Overrides the relative time range for individual panels,
	// which causes them to be different than what is selected in
	// the dashboard time picker in the top-right corner of the dashboard. You can use this to show metrics from different
	// time periods or days on the same dashboard.
	// The value is formatted as time operation like: `now-5m` (Last 5 minutes), `now/d` (the day so far),
	// `now-5d/d`(Last 5 days), `now/w` (This week so far), `now-2y/y` (Last 2 years).
	// Note: Panel time overrides have no effect when the dashboard’s time range is absolute.
	// See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options
	TimeFrom *string `json:"timeFrom,omitempty"`
	// Overrides the time range for individual panels by shifting its start and end relative to the time picker.
	// For example, you can shift the time range for the panel to be two hours earlier than the dashboard time picker setting `2h`.
	// Note: Panel time overrides have no effect when the dashboard’s time range is absolute.
	// See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options
	TimeShift *string `json:"timeShift,omitempty"`
	// Controls if the timeFrom or timeShift overrides are shown in the panel header
	HideTimeOverride *bool `json:"hideTimeOverride,omitempty"`
	// Dynamically load the panel
	LibraryPanel *LibraryPanelRef `json:"libraryPanel,omitempty"`
	// Sets panel queries cache timeout.
	CacheTimeout *string `json:"cacheTimeout,omitempty"`
	// Overrides the data source configured time-to-live for a query cache item in milliseconds
	QueryCachingTTL *float64 `json:"queryCachingTTL,omitempty"`
	// It depends on the panel plugin. They are specified by the Options field in panel plugin schemas.
	Options any `json:"options,omitempty"`
	// Field options allow you to change how the data is displayed in your visualizations.
	FieldConfig *FieldConfigSource `json:"fieldConfig,omitempty"`
}

Dashboard panels are the basic visualization building blocks.

func (Panel) Equals

func (resource Panel) Equals(other Panel) bool

Equals tests the equality of two `Panel` objects.

func (*Panel) UnmarshalJSON

func (resource *Panel) UnmarshalJSON(raw []byte) error

func (*Panel) UnmarshalJSONStrict

func (resource *Panel) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `Panel` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (Panel) Validate

func (resource Panel) Validate() error

Validate checks all the validation constraints that may be defined on `Panel` fields for violations and returns them.

type PanelBuilder

type PanelBuilder struct {
	// contains filtered or unexported fields
}

Dashboard panels are the basic visualization building blocks.

func NewPanelBuilder

func NewPanelBuilder() *PanelBuilder

func (*PanelBuilder) Build

func (builder *PanelBuilder) Build() (Panel, error)

func (*PanelBuilder) CacheTimeout

func (builder *PanelBuilder) CacheTimeout(cacheTimeout string) *PanelBuilder

Sets panel queries cache timeout.

func (*PanelBuilder) ColorScheme

func (builder *PanelBuilder) ColorScheme(color cog.Builder[FieldColor]) *PanelBuilder

Panel color configuration

func (*PanelBuilder) Datasource

func (builder *PanelBuilder) Datasource(datasource DataSourceRef) *PanelBuilder

The datasource used in all targets.

func (*PanelBuilder) Decimals

func (builder *PanelBuilder) Decimals(decimals float64) *PanelBuilder

Specify the number of decimals Grafana includes in the rendered value. If you leave this field blank, Grafana automatically truncates the number of decimals based on the value. For example 1.1234 will display as 1.12 and 100.456 will display as 100. To display all decimals, set the unit to `String`.

func (*PanelBuilder) Description

func (builder *PanelBuilder) Description(description string) *PanelBuilder

Panel description.

func (*PanelBuilder) DisplayName

func (builder *PanelBuilder) DisplayName(displayName string) *PanelBuilder

The display value for this field. This supports template variables blank is auto

func (*PanelBuilder) GridPos

func (builder *PanelBuilder) GridPos(gridPos GridPos) *PanelBuilder

Grid position.

func (*PanelBuilder) Height

func (builder *PanelBuilder) Height(h uint32) *PanelBuilder

Panel height. The height is the number of rows from the top edge of the panel.

func (*PanelBuilder) HideTimeOverride

func (builder *PanelBuilder) HideTimeOverride(hideTimeOverride bool) *PanelBuilder

Controls if the timeFrom or timeShift overrides are shown in the panel header

func (*PanelBuilder) Id

func (builder *PanelBuilder) Id(id uint32) *PanelBuilder

Unique identifier of the panel. Generated by Grafana when creating a new panel. It must be unique within a dashboard, but not globally.

func (*PanelBuilder) Interval

func (builder *PanelBuilder) Interval(interval string) *PanelBuilder

The min time interval setting defines a lower limit for the $__interval and $__interval_ms variables. This value must be formatted as a number followed by a valid time identifier like: "40s", "3d", etc. See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options

func (*PanelBuilder) LibraryPanel

func (builder *PanelBuilder) LibraryPanel(libraryPanel LibraryPanelRef) *PanelBuilder

Dynamically load the panel

func (builder *PanelBuilder) Links(links []cog.Builder[DashboardLink]) *PanelBuilder

Panel links.

func (*PanelBuilder) Mappings

func (builder *PanelBuilder) Mappings(mappings []ValueMapping) *PanelBuilder

Convert input values into a display string

func (*PanelBuilder) Max

func (builder *PanelBuilder) Max(max float64) *PanelBuilder

The maximum value used in percentage threshold calculations. Leave blank for auto calculation based on all series and fields.

func (*PanelBuilder) MaxDataPoints

func (builder *PanelBuilder) MaxDataPoints(maxDataPoints float64) *PanelBuilder

The maximum number of data points that the panel queries are retrieving.

func (*PanelBuilder) MaxPerRow

func (builder *PanelBuilder) MaxPerRow(maxPerRow float64) *PanelBuilder

Option for repeated panels that controls max items per row Only relevant for horizontally repeated panels

func (*PanelBuilder) Min

func (builder *PanelBuilder) Min(min float64) *PanelBuilder

The minimum value used in percentage threshold calculations. Leave blank for auto calculation based on all series and fields.

func (*PanelBuilder) NoValue

func (builder *PanelBuilder) NoValue(noValue string) *PanelBuilder

Alternative to empty string

func (*PanelBuilder) Overrides

func (builder *PanelBuilder) Overrides(overrides []cog.Builder[DashboardFieldConfigSourceOverrides]) *PanelBuilder

Overrides are the options applied to specific fields overriding the defaults.

func (*PanelBuilder) QueryCachingTTL

func (builder *PanelBuilder) QueryCachingTTL(queryCachingTTL float64) *PanelBuilder

Overrides the data source configured time-to-live for a query cache item in milliseconds

func (*PanelBuilder) Repeat

func (builder *PanelBuilder) Repeat(repeat string) *PanelBuilder

Name of template variable to repeat for.

func (*PanelBuilder) RepeatDirection

func (builder *PanelBuilder) RepeatDirection(repeatDirection PanelRepeatDirection) *PanelBuilder

Direction to repeat in if 'repeat' is set. `h` for horizontal, `v` for vertical.

func (*PanelBuilder) Span

func (builder *PanelBuilder) Span(w uint32) *PanelBuilder

Panel width. The width is the number of columns from the left edge of the panel.

func (*PanelBuilder) Targets

func (builder *PanelBuilder) Targets(targets []cog.Builder[variants.Dataquery]) *PanelBuilder

Depends on the panel plugin. See the plugin documentation for details.

func (*PanelBuilder) Thresholds

func (builder *PanelBuilder) Thresholds(thresholds cog.Builder[ThresholdsConfig]) *PanelBuilder

Map numeric values to states

func (*PanelBuilder) TimeFrom

func (builder *PanelBuilder) TimeFrom(timeFrom string) *PanelBuilder

Overrides the relative time range for individual panels, which causes them to be different than what is selected in the dashboard time picker in the top-right corner of the dashboard. You can use this to show metrics from different time periods or days on the same dashboard. The value is formatted as time operation like: `now-5m` (Last 5 minutes), `now/d` (the day so far), `now-5d/d`(Last 5 days), `now/w` (This week so far), `now-2y/y` (Last 2 years). Note: Panel time overrides have no effect when the dashboard’s time range is absolute. See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options

func (*PanelBuilder) TimeShift

func (builder *PanelBuilder) TimeShift(timeShift string) *PanelBuilder

Overrides the time range for individual panels by shifting its start and end relative to the time picker. For example, you can shift the time range for the panel to be two hours earlier than the dashboard time picker setting `2h`. Note: Panel time overrides have no effect when the dashboard’s time range is absolute. See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options

func (*PanelBuilder) Title

func (builder *PanelBuilder) Title(title string) *PanelBuilder

Panel title.

func (*PanelBuilder) Transformations

func (builder *PanelBuilder) Transformations(transformations []DataTransformerConfig) *PanelBuilder

List of transformations that are applied to the panel data before rendering. When there are multiple transformations, Grafana applies them in the order they are listed. Each transformation creates a result set that then passes on to the next transformation in the processing pipeline.

func (*PanelBuilder) Transparent

func (builder *PanelBuilder) Transparent(transparent bool) *PanelBuilder

Whether to display the panel without a background.

func (*PanelBuilder) Type

func (builder *PanelBuilder) Type(typeArg string) *PanelBuilder

The panel plugin type id. This is used to find the plugin to display the panel.

func (*PanelBuilder) Unit

func (builder *PanelBuilder) Unit(unit string) *PanelBuilder

Unit a field should use. The unit you select is applied to all fields except time. You can use the units ID availables in Grafana or a custom unit. Available units in Grafana: https://github.com/grafana/grafana/blob/main/packages/grafana-data/src/valueFormats/categories.ts As custom unit, you can use the following formats: `suffix:<suffix>` for custom unit that should go after value. `prefix:<prefix>` for custom unit that should go before value. `time:<format>` For custom date time formats type for example `time:YYYY-MM-DD`. `si:<base scale><unit characters>` for custom SI units. For example: `si: mF`. This one is a bit more advanced as you can specify both a unit and the source data scale. So if your source data is represented as milli (thousands of) something prefix the unit with that SI scale character. `count:<unit>` for a custom count unit. `currency:<unit>` for custom a currency unit.

func (*PanelBuilder) WithOverride

func (builder *PanelBuilder) WithOverride(matcher MatcherConfig, properties []DynamicConfigValue) *PanelBuilder

Overrides are the options applied to specific fields overriding the defaults.

func (*PanelBuilder) WithTarget

func (builder *PanelBuilder) WithTarget(target cog.Builder[variants.Dataquery]) *PanelBuilder

Depends on the panel plugin. See the plugin documentation for details.

func (*PanelBuilder) WithTransformation

func (builder *PanelBuilder) WithTransformation(transformation DataTransformerConfig) *PanelBuilder

List of transformations that are applied to the panel data before rendering. When there are multiple transformations, Grafana applies them in the order they are listed. Each transformation creates a result set that then passes on to the next transformation in the processing pipeline.

type PanelOrRowPanel

type PanelOrRowPanel struct {
	Panel    *Panel    `json:"Panel,omitempty"`
	RowPanel *RowPanel `json:"RowPanel,omitempty"`
}

func (PanelOrRowPanel) Equals

func (resource PanelOrRowPanel) Equals(other PanelOrRowPanel) bool

Equals tests the equality of two `PanelOrRowPanel` objects.

func (PanelOrRowPanel) MarshalJSON

func (resource PanelOrRowPanel) MarshalJSON() ([]byte, error)

MarshalJSON implements a custom JSON marshalling logic to encode `PanelOrRowPanel` as JSON.

func (*PanelOrRowPanel) UnmarshalJSON

func (resource *PanelOrRowPanel) UnmarshalJSON(raw []byte) error

UnmarshalJSON implements a custom JSON unmarshalling logic to decode `PanelOrRowPanel` from JSON.

func (*PanelOrRowPanel) UnmarshalJSONStrict

func (resource *PanelOrRowPanel) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `PanelOrRowPanel` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (PanelOrRowPanel) Validate

func (resource PanelOrRowPanel) Validate() error

Validate checks all the validation constraints that may be defined on `PanelOrRowPanel` fields for violations and returns them.

type PanelRepeatDirection

type PanelRepeatDirection string
const (
	PanelRepeatDirectionH PanelRepeatDirection = "h"
	PanelRepeatDirectionV PanelRepeatDirection = "v"
)

type QueryVariableBuilder

type QueryVariableBuilder struct {
	// contains filtered or unexported fields
}

A variable is a placeholder for a value. You can use variables in metric queries and in panel titles.

func NewQueryVariableBuilder

func NewQueryVariableBuilder(name string) *QueryVariableBuilder

func (*QueryVariableBuilder) AllValue

func (builder *QueryVariableBuilder) AllValue(allValue string) *QueryVariableBuilder

Custom all value

func (*QueryVariableBuilder) Build

func (builder *QueryVariableBuilder) Build() (VariableModel, error)

func (*QueryVariableBuilder) Current

func (builder *QueryVariableBuilder) Current(current VariableOption) *QueryVariableBuilder

Shows current selected variable text/value on the dashboard

func (*QueryVariableBuilder) Datasource

func (builder *QueryVariableBuilder) Datasource(datasource DataSourceRef) *QueryVariableBuilder

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

func (*QueryVariableBuilder) Description

func (builder *QueryVariableBuilder) Description(description string) *QueryVariableBuilder

Description of variable. It can be defined but `null`.

func (*QueryVariableBuilder) Hide

Visibility configuration for the variable

func (*QueryVariableBuilder) IncludeAll

func (builder *QueryVariableBuilder) IncludeAll(includeAll bool) *QueryVariableBuilder

Whether all value option is available or not

func (*QueryVariableBuilder) Label

func (builder *QueryVariableBuilder) Label(label string) *QueryVariableBuilder

Optional display name

func (*QueryVariableBuilder) Multi

func (builder *QueryVariableBuilder) Multi(multi bool) *QueryVariableBuilder

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

func (*QueryVariableBuilder) Name

func (builder *QueryVariableBuilder) Name(name string) *QueryVariableBuilder

Name of variable

func (*QueryVariableBuilder) Options

func (builder *QueryVariableBuilder) Options(options []VariableOption) *QueryVariableBuilder

Options that can be selected for a variable.

func (*QueryVariableBuilder) Query

func (builder *QueryVariableBuilder) Query(query StringOrMap) *QueryVariableBuilder

Query used to fetch values for a variable

func (*QueryVariableBuilder) Refresh

func (builder *QueryVariableBuilder) Refresh(refresh VariableRefresh) *QueryVariableBuilder

Options to config when to refresh a variable

func (*QueryVariableBuilder) Regex

func (builder *QueryVariableBuilder) Regex(regex string) *QueryVariableBuilder

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.

func (*QueryVariableBuilder) Sort

Options sort order

type RangeMap

type RangeMap struct {
	Type string `json:"type"`
	// Range to match against and the result to apply when the value is within the range
	Options DashboardRangeMapOptions `json:"options"`
}

Maps numerical ranges to a display text and color. For example, if a value is within a certain range, you can configure a range value mapping to display Low or High rather than the number.

func (RangeMap) Equals

func (resource RangeMap) Equals(other RangeMap) bool

Equals tests the equality of two `RangeMap` objects.

func (*RangeMap) UnmarshalJSONStrict

func (resource *RangeMap) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `RangeMap` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (RangeMap) Validate

func (resource RangeMap) Validate() error

Validate checks all the validation constraints that may be defined on `RangeMap` fields for violations and returns them.

type RangeMapBuilder

type RangeMapBuilder struct {
	// contains filtered or unexported fields
}

Maps numerical ranges to a display text and color. For example, if a value is within a certain range, you can configure a range value mapping to display Low or High rather than the number.

func NewRangeMapBuilder

func NewRangeMapBuilder() *RangeMapBuilder

func (*RangeMapBuilder) Build

func (builder *RangeMapBuilder) Build() (RangeMap, error)

func (*RangeMapBuilder) Options

Range to match against and the result to apply when the value is within the range

type RegexMap

type RegexMap struct {
	Type string `json:"type"`
	// Regular expression to match against and the result to apply when the value matches the regex
	Options DashboardRegexMapOptions `json:"options"`
}

Maps regular expressions to replacement text and a color. For example, if a value is www.example.com, you can configure a regex value mapping so that Grafana displays www and truncates the domain.

func (RegexMap) Equals

func (resource RegexMap) Equals(other RegexMap) bool

Equals tests the equality of two `RegexMap` objects.

func (*RegexMap) UnmarshalJSONStrict

func (resource *RegexMap) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `RegexMap` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (RegexMap) Validate

func (resource RegexMap) Validate() error

Validate checks all the validation constraints that may be defined on `RegexMap` fields for violations and returns them.

type RegexMapBuilder

type RegexMapBuilder struct {
	// contains filtered or unexported fields
}

Maps regular expressions to replacement text and a color. For example, if a value is www.example.com, you can configure a regex value mapping so that Grafana displays www and truncates the domain.

func NewRegexMapBuilder

func NewRegexMapBuilder() *RegexMapBuilder

func (*RegexMapBuilder) Build

func (builder *RegexMapBuilder) Build() (RegexMap, error)

func (*RegexMapBuilder) Options

Regular expression to match against and the result to apply when the value matches the regex

type RowBuilder

type RowBuilder struct {
	// contains filtered or unexported fields
}

Row panel

func NewRowBuilder

func NewRowBuilder(title string) *RowBuilder

func (*RowBuilder) Build

func (builder *RowBuilder) Build() (RowPanel, error)

func (*RowBuilder) Collapsed

func (builder *RowBuilder) Collapsed(collapsed bool) *RowBuilder

Whether this row should be collapsed or not.

func (*RowBuilder) Datasource

func (builder *RowBuilder) Datasource(datasource DataSourceRef) *RowBuilder

Name of default datasource for the row

func (*RowBuilder) GridPos

func (builder *RowBuilder) GridPos(gridPos GridPos) *RowBuilder

Row grid position

func (*RowBuilder) Id

func (builder *RowBuilder) Id(id uint32) *RowBuilder

Unique identifier of the panel. Generated by Grafana when creating a new panel. It must be unique within a dashboard, but not globally.

func (*RowBuilder) Repeat

func (builder *RowBuilder) Repeat(repeat string) *RowBuilder

Name of template variable to repeat for.

func (*RowBuilder) Title

func (builder *RowBuilder) Title(title string) *RowBuilder

Row title

func (*RowBuilder) WithPanel

func (builder *RowBuilder) WithPanel(panel cog.Builder[Panel]) *RowBuilder

List of panels in the row

type RowPanel

type RowPanel struct {
	// The panel type
	Type string `json:"type"`
	// Whether this row should be collapsed or not.
	Collapsed bool `json:"collapsed"`
	// Row title
	Title *string `json:"title,omitempty"`
	// Name of default datasource for the row
	Datasource *DataSourceRef `json:"datasource,omitempty"`
	// Row grid position
	GridPos *GridPos `json:"gridPos,omitempty"`
	// Unique identifier of the panel. Generated by Grafana when creating a new panel. It must be unique within a dashboard, but not globally.
	Id uint32 `json:"id"`
	// List of panels in the row
	Panels []Panel `json:"panels"`
	// Name of template variable to repeat for.
	Repeat *string `json:"repeat,omitempty"`
}

Row panel

func (RowPanel) Equals

func (resource RowPanel) Equals(other RowPanel) bool

Equals tests the equality of two `RowPanel` objects.

func (*RowPanel) UnmarshalJSONStrict

func (resource *RowPanel) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `RowPanel` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (RowPanel) Validate

func (resource RowPanel) Validate() error

Validate checks all the validation constraints that may be defined on `RowPanel` fields for violations and returns them.

type Snapshot

type Snapshot struct {
	// Time when the snapshot was created
	Created time.Time `json:"created"`
	// Time when the snapshot expires, default is never to expire
	Expires string `json:"expires"`
	// Is the snapshot saved in an external grafana instance
	External bool `json:"external"`
	// external url, if snapshot was shared in external grafana instance
	ExternalUrl string `json:"externalUrl"`
	// original url, url of the dashboard that was snapshotted
	OriginalUrl string `json:"originalUrl"`
	// Unique identifier of the snapshot
	Id uint32 `json:"id"`
	// Optional, defined the unique key of the snapshot, required if external is true
	Key string `json:"key"`
	// Optional, name of the snapshot
	Name string `json:"name"`
	// org id of the snapshot
	OrgId uint32 `json:"orgId"`
	// last time when the snapshot was updated
	Updated time.Time `json:"updated"`
	// url of the snapshot, if snapshot was shared internally
	Url *string `json:"url,omitempty"`
	// user id of the snapshot creator
	UserId    uint32     `json:"userId"`
	Dashboard *Dashboard `json:"dashboard,omitempty"`
}

A dashboard snapshot shares an interactive dashboard publicly. It is a read-only version of a dashboard, and is not editable. It is possible to create a snapshot of a snapshot. Grafana strips away all sensitive information from the dashboard. Sensitive information stripped: queries (metric, template,annotation) and panel links.

func (Snapshot) Equals

func (resource Snapshot) Equals(other Snapshot) bool

Equals tests the equality of two `Snapshot` objects.

func (*Snapshot) UnmarshalJSONStrict

func (resource *Snapshot) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `Snapshot` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (Snapshot) Validate

func (resource Snapshot) Validate() error

Validate checks all the validation constraints that may be defined on `Snapshot` fields for violations and returns them.

type SnapshotBuilder

type SnapshotBuilder struct {
	// contains filtered or unexported fields
}

A dashboard snapshot shares an interactive dashboard publicly. It is a read-only version of a dashboard, and is not editable. It is possible to create a snapshot of a snapshot. Grafana strips away all sensitive information from the dashboard. Sensitive information stripped: queries (metric, template,annotation) and panel links.

func NewSnapshotBuilder

func NewSnapshotBuilder() *SnapshotBuilder

func (*SnapshotBuilder) Build

func (builder *SnapshotBuilder) Build() (Snapshot, error)

func (*SnapshotBuilder) Dashboard

func (builder *SnapshotBuilder) Dashboard(dashboard cog.Builder[Dashboard]) *SnapshotBuilder

func (*SnapshotBuilder) Expires

func (builder *SnapshotBuilder) Expires(expires string) *SnapshotBuilder

Time when the snapshot expires, default is never to expire

func (*SnapshotBuilder) External

func (builder *SnapshotBuilder) External(external bool) *SnapshotBuilder

Is the snapshot saved in an external grafana instance

func (*SnapshotBuilder) ExternalUrl

func (builder *SnapshotBuilder) ExternalUrl(externalUrl string) *SnapshotBuilder

external url, if snapshot was shared in external grafana instance

func (*SnapshotBuilder) Id

func (builder *SnapshotBuilder) Id(id uint32) *SnapshotBuilder

Unique identifier of the snapshot

func (*SnapshotBuilder) Key

func (builder *SnapshotBuilder) Key(key string) *SnapshotBuilder

Optional, defined the unique key of the snapshot, required if external is true

func (*SnapshotBuilder) Name

func (builder *SnapshotBuilder) Name(name string) *SnapshotBuilder

Optional, name of the snapshot

func (*SnapshotBuilder) OrgId

func (builder *SnapshotBuilder) OrgId(orgId uint32) *SnapshotBuilder

org id of the snapshot

func (*SnapshotBuilder) OriginalUrl

func (builder *SnapshotBuilder) OriginalUrl(originalUrl string) *SnapshotBuilder

original url, url of the dashboard that was snapshotted

func (*SnapshotBuilder) Url

func (builder *SnapshotBuilder) Url(url string) *SnapshotBuilder

url of the snapshot, if snapshot was shared internally

type SpecialValueMap

type SpecialValueMap struct {
	Type    string                          `json:"type"`
	Options DashboardSpecialValueMapOptions `json:"options"`
}

Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text and color. See SpecialValueMatch to see the list of special values. For example, you can configure a special value mapping so that null values appear as N/A.

func (SpecialValueMap) Equals

func (resource SpecialValueMap) Equals(other SpecialValueMap) bool

Equals tests the equality of two `SpecialValueMap` objects.

func (*SpecialValueMap) UnmarshalJSONStrict

func (resource *SpecialValueMap) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `SpecialValueMap` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (SpecialValueMap) Validate

func (resource SpecialValueMap) Validate() error

Validate checks all the validation constraints that may be defined on `SpecialValueMap` fields for violations and returns them.

type SpecialValueMapBuilder

type SpecialValueMapBuilder struct {
	// contains filtered or unexported fields
}

Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text and color. See SpecialValueMatch to see the list of special values. For example, you can configure a special value mapping so that null values appear as N/A.

func NewSpecialValueMapBuilder

func NewSpecialValueMapBuilder() *SpecialValueMapBuilder

func (*SpecialValueMapBuilder) Build

func (builder *SpecialValueMapBuilder) Build() (SpecialValueMap, error)

func (*SpecialValueMapBuilder) Options

type SpecialValueMatch

type SpecialValueMatch string

Special value types supported by the `SpecialValueMap`

const (
	SpecialValueMatchTrue       SpecialValueMatch = "true"
	SpecialValueMatchFalse      SpecialValueMatch = "false"
	SpecialValueMatchNull       SpecialValueMatch = "null"
	SpecialValueMatchNaN        SpecialValueMatch = "nan"
	SpecialValueMatchNullAndNan SpecialValueMatch = "null+nan"
	SpecialValueMatchEmpty      SpecialValueMatch = "empty"
)

type StringOrArrayOfString

type StringOrArrayOfString struct {
	String        *string  `json:"String,omitempty"`
	ArrayOfString []string `json:"ArrayOfString,omitempty"`
}

func (StringOrArrayOfString) Equals

func (resource StringOrArrayOfString) Equals(other StringOrArrayOfString) bool

Equals tests the equality of two `StringOrArrayOfString` objects.

func (StringOrArrayOfString) MarshalJSON

func (resource StringOrArrayOfString) MarshalJSON() ([]byte, error)

MarshalJSON implements a custom JSON marshalling logic to encode `StringOrArrayOfString` as JSON.

func (*StringOrArrayOfString) UnmarshalJSON

func (resource *StringOrArrayOfString) UnmarshalJSON(raw []byte) error

UnmarshalJSON implements a custom JSON unmarshalling logic to decode `StringOrArrayOfString` from JSON.

func (*StringOrArrayOfString) UnmarshalJSONStrict

func (resource *StringOrArrayOfString) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `StringOrArrayOfString` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (StringOrArrayOfString) Validate

func (resource StringOrArrayOfString) Validate() error

Validate checks all the validation constraints that may be defined on `StringOrArrayOfString` fields for violations and returns them.

type StringOrMap

type StringOrMap struct {
	String *string        `json:"String,omitempty"`
	Map    map[string]any `json:"Map,omitempty"`
}

func (StringOrMap) Equals

func (resource StringOrMap) Equals(other StringOrMap) bool

Equals tests the equality of two `StringOrMap` objects.

func (StringOrMap) MarshalJSON

func (resource StringOrMap) MarshalJSON() ([]byte, error)

MarshalJSON implements a custom JSON marshalling logic to encode `StringOrMap` as JSON.

func (*StringOrMap) UnmarshalJSON

func (resource *StringOrMap) UnmarshalJSON(raw []byte) error

UnmarshalJSON implements a custom JSON unmarshalling logic to decode `StringOrMap` from JSON.

func (*StringOrMap) UnmarshalJSONStrict

func (resource *StringOrMap) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `StringOrMap` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (StringOrMap) Validate

func (resource StringOrMap) Validate() error

Validate checks all the validation constraints that may be defined on `StringOrMap` fields for violations and returns them.

type TextBoxVariableBuilder

type TextBoxVariableBuilder struct {
	// contains filtered or unexported fields
}

A variable is a placeholder for a value. You can use variables in metric queries and in panel titles.

func NewTextBoxVariableBuilder

func NewTextBoxVariableBuilder(name string) *TextBoxVariableBuilder

func (*TextBoxVariableBuilder) Build

func (builder *TextBoxVariableBuilder) Build() (VariableModel, error)

func (*TextBoxVariableBuilder) Current

Shows current selected variable text/value on the dashboard

func (*TextBoxVariableBuilder) DefaultValue

func (builder *TextBoxVariableBuilder) DefaultValue(query StringOrMap) *TextBoxVariableBuilder

Query used to fetch values for a variable

func (*TextBoxVariableBuilder) Description

func (builder *TextBoxVariableBuilder) Description(description string) *TextBoxVariableBuilder

Description of variable. It can be defined but `null`.

func (*TextBoxVariableBuilder) Hide

Visibility configuration for the variable

func (*TextBoxVariableBuilder) Label

func (builder *TextBoxVariableBuilder) Label(label string) *TextBoxVariableBuilder

Optional display name

func (*TextBoxVariableBuilder) Name

Name of variable

func (*TextBoxVariableBuilder) Options

func (builder *TextBoxVariableBuilder) Options(options []VariableOption) *TextBoxVariableBuilder

Options that can be selected for a variable.

type Threshold

type Threshold struct {
	// Value represents a specified metric for the threshold, which triggers a visual change in the dashboard when this value is met or exceeded.
	// Nulls currently appear here when serializing -Infinity to JSON.
	Value *float64 `json:"value"`
	// Color represents the color of the visual change that will occur in the dashboard when the threshold value is met or exceeded.
	Color string `json:"color"`
}

User-defined value for a metric that triggers visual changes in a panel when this value is met or exceeded They are used to conditionally style and color visualizations based on query results , and can be applied to most visualizations.

func (Threshold) Equals

func (resource Threshold) Equals(other Threshold) bool

Equals tests the equality of two `Threshold` objects.

func (*Threshold) UnmarshalJSONStrict

func (resource *Threshold) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `Threshold` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (Threshold) Validate

func (resource Threshold) Validate() error

Validate checks all the validation constraints that may be defined on `Threshold` fields for violations and returns them.

type ThresholdsConfig

type ThresholdsConfig struct {
	// Thresholds mode.
	Mode ThresholdsMode `json:"mode"`
	// Must be sorted by 'value', first value is always -Infinity
	Steps []Threshold `json:"steps"`
}

Thresholds configuration for the panel

func (ThresholdsConfig) Equals

func (resource ThresholdsConfig) Equals(other ThresholdsConfig) bool

Equals tests the equality of two `ThresholdsConfig` objects.

func (*ThresholdsConfig) UnmarshalJSONStrict

func (resource *ThresholdsConfig) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `ThresholdsConfig` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (ThresholdsConfig) Validate

func (resource ThresholdsConfig) Validate() error

Validate checks all the validation constraints that may be defined on `ThresholdsConfig` fields for violations and returns them.

type ThresholdsConfigBuilder

type ThresholdsConfigBuilder struct {
	// contains filtered or unexported fields
}

Thresholds configuration for the panel

func NewThresholdsConfigBuilder

func NewThresholdsConfigBuilder() *ThresholdsConfigBuilder

func (*ThresholdsConfigBuilder) Build

func (builder *ThresholdsConfigBuilder) Build() (ThresholdsConfig, error)

func (*ThresholdsConfigBuilder) Mode

Thresholds mode.

func (*ThresholdsConfigBuilder) Steps

Must be sorted by 'value', first value is always -Infinity

type ThresholdsMode

type ThresholdsMode string

Thresholds can either be `absolute` (specific number) or `percentage` (relative to min or max, it will be values between 0 and 1).

const (
	ThresholdsModeAbsolute   ThresholdsMode = "absolute"
	ThresholdsModePercentage ThresholdsMode = "percentage"
)

type TimePickerBuilder

type TimePickerBuilder struct {
	// contains filtered or unexported fields
}

Time picker configuration It defines the default config for the time picker and the refresh picker for the specific dashboard.

func NewTimePickerBuilder

func NewTimePickerBuilder() *TimePickerBuilder

func (*TimePickerBuilder) Build

func (builder *TimePickerBuilder) Build() (TimePickerConfig, error)

func (*TimePickerBuilder) Hidden

func (builder *TimePickerBuilder) Hidden(hidden bool) *TimePickerBuilder

Whether timepicker is visible or not.

func (*TimePickerBuilder) NowDelay

func (builder *TimePickerBuilder) NowDelay(nowDelay string) *TimePickerBuilder

Override the now time by entering a time delay. Use this option to accommodate known delays in data aggregation to avoid null values.

func (*TimePickerBuilder) RefreshIntervals

func (builder *TimePickerBuilder) RefreshIntervals(refreshIntervals []string) *TimePickerBuilder

Interval options available in the refresh picker dropdown.

func (*TimePickerBuilder) TimeOptions

func (builder *TimePickerBuilder) TimeOptions(timeOptions []string) *TimePickerBuilder

Selectable options available in the time picker dropdown. Has no effect on provisioned dashboard.

type TimePickerConfig

type TimePickerConfig struct {
	// Whether timepicker is visible or not.
	Hidden *bool `json:"hidden,omitempty"`
	// Interval options available in the refresh picker dropdown.
	RefreshIntervals []string `json:"refresh_intervals,omitempty"`
	// Selectable options available in the time picker dropdown. Has no effect on provisioned dashboard.
	TimeOptions []string `json:"time_options,omitempty"`
	// Override the now time by entering a time delay. Use this option to accommodate known delays in data aggregation to avoid null values.
	NowDelay *string `json:"nowDelay,omitempty"`
}

Time picker configuration It defines the default config for the time picker and the refresh picker for the specific dashboard.

func (TimePickerConfig) Equals

func (resource TimePickerConfig) Equals(other TimePickerConfig) bool

Equals tests the equality of two `TimePickerConfig` objects.

func (*TimePickerConfig) UnmarshalJSONStrict

func (resource *TimePickerConfig) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `TimePickerConfig` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (TimePickerConfig) Validate

func (resource TimePickerConfig) Validate() error

Validate checks all the validation constraints that may be defined on `TimePickerConfig` fields for violations and returns them.

type ValueMap

type ValueMap struct {
	Type string `json:"type"`
	// Map with <value_to_match>: ValueMappingResult. For example: { "10": { text: "Perfection!", color: "green" } }
	Options map[string]ValueMappingResult `json:"options"`
}

Maps text values to a color or different display text and color. For example, you can configure a value mapping so that all instances of the value 10 appear as Perfection! rather than the number.

func (ValueMap) Equals

func (resource ValueMap) Equals(other ValueMap) bool

Equals tests the equality of two `ValueMap` objects.

func (*ValueMap) UnmarshalJSONStrict

func (resource *ValueMap) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `ValueMap` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (ValueMap) Validate

func (resource ValueMap) Validate() error

Validate checks all the validation constraints that may be defined on `ValueMap` fields for violations and returns them.

type ValueMapBuilder

type ValueMapBuilder struct {
	// contains filtered or unexported fields
}

Maps text values to a color or different display text and color. For example, you can configure a value mapping so that all instances of the value 10 appear as Perfection! rather than the number.

func NewValueMapBuilder

func NewValueMapBuilder() *ValueMapBuilder

func (*ValueMapBuilder) Build

func (builder *ValueMapBuilder) Build() (ValueMap, error)

func (*ValueMapBuilder) Options

func (builder *ValueMapBuilder) Options(options map[string]ValueMappingResult) *ValueMapBuilder

Map with <value_to_match>: ValueMappingResult. For example: { "10": { text: "Perfection!", color: "green" } }

type ValueMapOrRangeMapOrRegexMapOrSpecialValueMap

type ValueMapOrRangeMapOrRegexMapOrSpecialValueMap struct {
	ValueMap        *ValueMap        `json:"ValueMap,omitempty"`
	RangeMap        *RangeMap        `json:"RangeMap,omitempty"`
	RegexMap        *RegexMap        `json:"RegexMap,omitempty"`
	SpecialValueMap *SpecialValueMap `json:"SpecialValueMap,omitempty"`
}

func (ValueMapOrRangeMapOrRegexMapOrSpecialValueMap) Equals

Equals tests the equality of two `ValueMapOrRangeMapOrRegexMapOrSpecialValueMap` objects.

func (ValueMapOrRangeMapOrRegexMapOrSpecialValueMap) MarshalJSON

func (resource ValueMapOrRangeMapOrRegexMapOrSpecialValueMap) MarshalJSON() ([]byte, error)

MarshalJSON implements a custom JSON marshalling logic to encode `ValueMapOrRangeMapOrRegexMapOrSpecialValueMap` as JSON.

func (*ValueMapOrRangeMapOrRegexMapOrSpecialValueMap) UnmarshalJSON

func (resource *ValueMapOrRangeMapOrRegexMapOrSpecialValueMap) UnmarshalJSON(raw []byte) error

UnmarshalJSON implements a custom JSON unmarshalling logic to decode `ValueMapOrRangeMapOrRegexMapOrSpecialValueMap` from JSON.

func (*ValueMapOrRangeMapOrRegexMapOrSpecialValueMap) UnmarshalJSONStrict

func (resource *ValueMapOrRangeMapOrRegexMapOrSpecialValueMap) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `ValueMapOrRangeMapOrRegexMapOrSpecialValueMap` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (ValueMapOrRangeMapOrRegexMapOrSpecialValueMap) Validate

Validate checks all the validation constraints that may be defined on `ValueMapOrRangeMapOrRegexMapOrSpecialValueMap` fields for violations and returns them.

type ValueMapping

Allow to transform the visual representation of specific data values in a visualization, irrespective of their original units

type ValueMappingResult

type ValueMappingResult struct {
	// Text to display when the value matches
	Text *string `json:"text,omitempty"`
	// Text to use when the value matches
	Color *string `json:"color,omitempty"`
	// Icon to display when the value matches. Only specific visualizations.
	Icon *string `json:"icon,omitempty"`
	// Position in the mapping array. Only used internally.
	Index *int32 `json:"index,omitempty"`
}

Result used as replacement with text and color when the value matches

func (ValueMappingResult) Equals

func (resource ValueMappingResult) Equals(other ValueMappingResult) bool

Equals tests the equality of two `ValueMappingResult` objects.

func (*ValueMappingResult) UnmarshalJSONStrict

func (resource *ValueMappingResult) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `ValueMappingResult` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (ValueMappingResult) Validate

func (resource ValueMappingResult) Validate() error

Validate checks all the validation constraints that may be defined on `ValueMappingResult` fields for violations and returns them.

type ValueMappingResultBuilder

type ValueMappingResultBuilder struct {
	// contains filtered or unexported fields
}

Result used as replacement with text and color when the value matches

func NewValueMappingResultBuilder

func NewValueMappingResultBuilder() *ValueMappingResultBuilder

func (*ValueMappingResultBuilder) Build

func (*ValueMappingResultBuilder) Color

Text to use when the value matches

func (*ValueMappingResultBuilder) Icon

Icon to display when the value matches. Only specific visualizations.

func (*ValueMappingResultBuilder) Index

Position in the mapping array. Only used internally.

func (*ValueMappingResultBuilder) Text

Text to display when the value matches

type VariableHide

type VariableHide int64

Determine if the variable shows on dashboard Accepted values are 0 (show label and value), 1 (show value only), 2 (show nothing).

const (
	VariableHideDontHide     VariableHide = 0
	VariableHideHideLabel    VariableHide = 1
	VariableHideHideVariable VariableHide = 2
)

type VariableModel

type VariableModel struct {
	// Type of variable
	Type VariableType `json:"type"`
	// Name of variable
	Name string `json:"name"`
	// Optional display name
	Label *string `json:"label,omitempty"`
	// Visibility configuration for the variable
	Hide *VariableHide `json:"hide,omitempty"`
	// Whether the variable value should be managed by URL query params or not
	SkipUrlSync *bool `json:"skipUrlSync,omitempty"`
	// Description of variable. It can be defined but `null`.
	Description *string `json:"description,omitempty"`
	// Query used to fetch values for a variable
	Query *StringOrMap `json:"query,omitempty"`
	// Data source used to fetch values for a variable. It can be defined but `null`.
	Datasource *DataSourceRef `json:"datasource,omitempty"`
	// Shows current selected variable text/value on the dashboard
	Current *VariableOption `json:"current,omitempty"`
	// Whether multiple values can be selected or not from variable value list
	Multi *bool `json:"multi,omitempty"`
	// Options that can be selected for a variable.
	Options []VariableOption `json:"options,omitempty"`
	// Options to config when to refresh a variable
	Refresh *VariableRefresh `json:"refresh,omitempty"`
	// Options sort order
	Sort *VariableSort `json:"sort,omitempty"`
	// Whether all value option is available or not
	IncludeAll *bool `json:"includeAll,omitempty"`
	// Custom all value
	AllValue *string `json:"allValue,omitempty"`
	// 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.
	Regex *string `json:"regex,omitempty"`
}

A variable is a placeholder for a value. You can use variables in metric queries and in panel titles.

func (VariableModel) Equals

func (resource VariableModel) Equals(other VariableModel) bool

Equals tests the equality of two `VariableModel` objects.

func (*VariableModel) UnmarshalJSONStrict

func (resource *VariableModel) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `VariableModel` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (VariableModel) Validate

func (resource VariableModel) Validate() error

Validate checks all the validation constraints that may be defined on `VariableModel` fields for violations and returns them.

type VariableOption

type VariableOption struct {
	// Whether the option is selected or not
	Selected *bool `json:"selected,omitempty"`
	// Text to be displayed for the option
	Text StringOrArrayOfString `json:"text"`
	// Value of the option
	Value StringOrArrayOfString `json:"value"`
}

Option to be selected in a variable.

func (VariableOption) Equals

func (resource VariableOption) Equals(other VariableOption) bool

Equals tests the equality of two `VariableOption` objects.

func (*VariableOption) UnmarshalJSONStrict

func (resource *VariableOption) UnmarshalJSONStrict(raw []byte) error

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `VariableOption` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (VariableOption) Validate

func (resource VariableOption) Validate() error

Validate checks all the validation constraints that may be defined on `VariableOption` fields for violations and returns them.

type VariableRefresh

type VariableRefresh int64

Options to config when to refresh a variable `0`: Never refresh the variable `1`: Queries the data source every time the dashboard loads. `2`: Queries the data source when the dashboard time range changes.

const (
	VariableRefreshNever              VariableRefresh = 0
	VariableRefreshOnDashboardLoad    VariableRefresh = 1
	VariableRefreshOnTimeRangeChanged VariableRefresh = 2
)

type VariableSort

type VariableSort int64

Sort variable options Accepted values are: `0`: No sorting `1`: Alphabetical ASC `2`: Alphabetical DESC `3`: Numerical ASC `4`: Numerical DESC `5`: Alphabetical Case Insensitive ASC `6`: Alphabetical Case Insensitive DESC `7`: Natural ASC `8`: Natural DESC

const (
	VariableSortDisabled                        VariableSort = 0
	VariableSortAlphabeticalAsc                 VariableSort = 1
	VariableSortAlphabeticalDesc                VariableSort = 2
	VariableSortNumericalAsc                    VariableSort = 3
	VariableSortNumericalDesc                   VariableSort = 4
	VariableSortAlphabeticalCaseInsensitiveAsc  VariableSort = 5
	VariableSortAlphabeticalCaseInsensitiveDesc VariableSort = 6
	VariableSortNaturalAsc                      VariableSort = 7
	VariableSortNaturalDesc                     VariableSort = 8
)

type VariableType

type VariableType string

Dashboard variable type `query`: Query-generated list of values such as metric names, server names, sensor IDs, data centers, and so on. `adhoc`: Key/value filters that are automatically added to all metric queries for a data source (Prometheus, Loki, InfluxDB, and Elasticsearch only). `constant`: Define a hidden constant. `datasource`: Quickly change the data source for an entire dashboard. `interval`: Interval variables represent time spans. `textbox`: Display a free text input field with an optional default value. `custom`: Define the variable options manually using a comma-separated list. `system`: Variables defined by Grafana. See: https://grafana.com/docs/grafana/latest/dashboards/variables/add-template-variables/#global-variables

const (
	VariableTypeQuery      VariableType = "query"
	VariableTypeAdhoc      VariableType = "adhoc"
	VariableTypeGroupby    VariableType = "groupby"
	VariableTypeConstant   VariableType = "constant"
	VariableTypeDatasource VariableType = "datasource"
	VariableTypeInterval   VariableType = "interval"
	VariableTypeTextbox    VariableType = "textbox"
	VariableTypeCustom     VariableType = "custom"
	VariableTypeSystem     VariableType = "system"
	VariableTypeSnapshot   VariableType = "snapshot"
)

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL