@ -1,8 +1,10 @@
// This file is autogenerated. DO NOT EDIT.
// This file is autogenerated. DO NOT EDIT.
//
//
// Run "make gen-cue" from repository root to regenerate.
// Generated by pkg/framework/coremodel/gen.go
//
//
// Derived from the Thema lineage at pkg/coremodel/dashboard
// Derived from the Thema lineage declared in pkg/coremodel/dashboard/coremodel.cue
//
// Run `make gen-cue` from repository root to regenerate.
package dashboard
package dashboard
@ -15,7 +17,7 @@ import (
"github.com/grafana/thema"
"github.com/grafana/thema"
)
)
// Defines values for Dashboard GraphTooltip.
// Defines values for GraphTooltip.
const (
const (
GraphTooltipN0 GraphTooltip = 0
GraphTooltipN0 GraphTooltip = 0
@ -24,14 +26,14 @@ const (
GraphTooltipN2 GraphTooltip = 2
GraphTooltipN2 GraphTooltip = 2
)
)
// Defines values for Dashboard Style.
// Defines values for Style.
const (
const (
StyleDark Style = "dark"
StyleDark Style = "dark"
StyleLight Style = "light"
StyleLight Style = "light"
)
)
// Defines values for Dashboard Timezone.
// Defines values for Timezone.
const (
const (
TimezoneBrowser Timezone = "browser"
TimezoneBrowser Timezone = "browser"
@ -40,7 +42,7 @@ const (
TimezoneUtc Timezone = "utc"
TimezoneUtc Timezone = "utc"
)
)
// Defines values for DashboardDashboard CursorSync.
// Defines values for DashboardCursorSync.
const (
const (
DashboardCursorSyncN0 DashboardCursorSync = 0
DashboardCursorSyncN0 DashboardCursorSync = 0
@ -49,14 +51,14 @@ const (
DashboardCursorSyncN2 DashboardCursorSync = 2
DashboardCursorSyncN2 DashboardCursorSync = 2
)
)
// Defines values for DashboardDashboard LinkType.
// Defines values for DashboardLinkType.
const (
const (
DashboardLinkTypeDashboards DashboardLinkType = "dashboards"
DashboardLinkTypeDashboards DashboardLinkType = "dashboards"
DashboardLinkTypeLink DashboardLinkType = "link"
DashboardLinkTypeLink DashboardLinkType = "link"
)
)
// Defines values for Dashboard FieldColorModeId.
// Defines values for FieldColorModeId.
const (
const (
FieldColorModeIdContinuousGrYlRd FieldColorModeId = "continuous-GrYlRd"
FieldColorModeIdContinuousGrYlRd FieldColorModeId = "continuous-GrYlRd"
@ -69,7 +71,7 @@ const (
FieldColorModeIdThresholds FieldColorModeId = "thresholds"
FieldColorModeIdThresholds FieldColorModeId = "thresholds"
)
)
// Defines values for Dashboard FieldColorSeriesByMode.
// Defines values for FieldColorSeriesByMode.
const (
const (
FieldColorSeriesByModeLast FieldColorSeriesByMode = "last"
FieldColorSeriesByModeLast FieldColorSeriesByMode = "last"
@ -78,43 +80,43 @@ const (
FieldColorSeriesByModeMin FieldColorSeriesByMode = "min"
FieldColorSeriesByModeMin FieldColorSeriesByMode = "min"
)
)
// Defines values for Dashboard GraphPanelType.
// Defines values for GraphPanelType.
const (
const (
GraphPanelTypeGraph GraphPanelType = "graph"
GraphPanelTypeGraph GraphPanelType = "graph"
)
)
// Defines values for Dashboard HeatmapPanelType.
// Defines values for HeatmapPanelType.
const (
const (
HeatmapPanelTypeHeatmap HeatmapPanelType = "heatmap"
HeatmapPanelTypeHeatmap HeatmapPanelType = "heatmap"
)
)
// Defines values for Dashboard PanelRepeatDirection.
// Defines values for PanelRepeatDirection.
const (
const (
PanelRepeatDirectionH PanelRepeatDirection = "h"
PanelRepeatDirectionH PanelRepeatDirection = "h"
PanelRepeatDirectionV PanelRepeatDirection = "v"
PanelRepeatDirectionV PanelRepeatDirection = "v"
)
)
// Defines values for Dashboard RowPanelType.
// Defines values for RowPanelType.
const (
const (
RowPanelTypeRow RowPanelType = "row"
RowPanelTypeRow RowPanelType = "row"
)
)
// Defines values for Dashboard ThresholdsConfigMode.
// Defines values for ThresholdsConfigMode.
const (
const (
ThresholdsConfigModeAbsolute ThresholdsConfigMode = "absolute"
ThresholdsConfigModeAbsolute ThresholdsConfigMode = "absolute"
ThresholdsConfigModePercentage ThresholdsConfigMode = "percentage"
ThresholdsConfigModePercentage ThresholdsConfigMode = "percentage"
)
)
// Defines values for Dashboard ThresholdsMode.
// Defines values for ThresholdsMode.
const (
const (
ThresholdsModeAbsolute ThresholdsMode = "absolute"
ThresholdsModeAbsolute ThresholdsMode = "absolute"
ThresholdsModePercentage ThresholdsMode = "percentage"
ThresholdsModePercentage ThresholdsMode = "percentage"
)
)
// Defines values for Dashboard VariableModelType.
// Defines values for VariableModelType.
const (
const (
VariableModelTypeAdhoc VariableModelType = "adhoc"
VariableModelTypeAdhoc VariableModelType = "adhoc"
@ -133,7 +135,7 @@ const (
VariableModelTypeTextbox VariableModelType = "textbox"
VariableModelTypeTextbox VariableModelType = "textbox"
)
)
// Defines values for Dashboard VariableType.
// Defines values for VariableType.
const (
const (
VariableTypeAdhoc VariableType = "adhoc"
VariableTypeAdhoc VariableType = "adhoc"
@ -152,7 +154,7 @@ const (
VariableTypeTextbox VariableType = "textbox"
VariableTypeTextbox VariableType = "textbox"
)
)
// Dashboard defines model for dashboard.
// Model is the Go representation of a dashboard.
//
//
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
@ -243,7 +245,7 @@ type Model struct {
WeekStart * string ` json:"weekStart,omitempty" `
WeekStart * string ` json:"weekStart,omitempty" `
}
}
// DashboardGraphTooltip defines model for Dashboard .GraphTooltip.
// GraphTooltip is the Go representation of a Model .GraphTooltip.
//
//
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
@ -294,7 +296,7 @@ type AnnotationQuery struct {
// Schema for panel targets is specified by datasource
// Schema for panel targets is specified by datasource
// plugins. We use a placeholder definition, which the Go
// plugins. We use a placeholder definition, which the Go
// schema loader either left open/as-is with the Base
// schema loader either left open/as-is with the Base
// variant of the Dashboard and Panel families, or filled
// variant of the Model and Panel families, or filled
// with types derived from plugins in the Instance variant.
// with types derived from plugins in the Instance variant.
// When working directly from CUE, importers can extend this
// When working directly from CUE, importers can extend this
// type directly to achieve the same effect.
// type directly to achieve the same effect.
@ -310,7 +312,7 @@ type AnnotationQuery struct {
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
type DashboardCursorSync int
type DashboardCursorSync int
// FROM public/app/features/dashboard/state/Dashboard Models.ts - ish
// FROM public/app/features/dashboard/state/Models.ts - ish
// TODO docs
// TODO docs
//
//
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
@ -328,7 +330,7 @@ type DashboardLink struct {
Url * string ` json:"url,omitempty" `
Url * string ` json:"url,omitempty" `
}
}
// DashboardDashboardLinkType defines model for Dashboard DashboardLink.Type.
// DashboardLinkType is the Go representation of a DashboardLink.Type.
//
//
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
@ -361,7 +363,7 @@ type FieldColorModeId string
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
type FieldColorSeriesByMode string
type FieldColorSeriesByMode string
// DashboardGraphPanel defines model for dashboard.GraphPanel.
// GraphPanel is the Go representation of a dashboard.GraphPanel.
//
//
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
@ -376,7 +378,7 @@ type GraphPanel struct {
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
type GraphPanelType string
type GraphPanelType string
// DashboardGridPos defines model for dashboard.GridPos.
// GridPos is the Go representation of a dashboard.GridPos.
//
//
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
@ -397,7 +399,7 @@ type GridPos struct {
Y int ` json:"y" `
Y int ` json:"y" `
}
}
// DashboardHeatmapPanel defines model for dashboard.HeatmapPanel.
// HeatmapPanel is the Go representation of a dashboard.HeatmapPanel.
//
//
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
@ -405,13 +407,13 @@ type HeatmapPanel struct {
Type HeatmapPanelType ` json:"type" `
Type HeatmapPanelType ` json:"type" `
}
}
// DashboardHeatmapPanelType defines model for Dashboard HeatmapPanel.Type.
// HeatmapPanelType is the Go representation of a HeatmapPanel.Type.
//
//
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
type HeatmapPanelType string
type HeatmapPanelType string
// Dashboard panels. Panels are canonically defined inline
// Model panels. Panels are canonically defined inline
// because they share a version timeline with the dashboard
// because they share a version timeline with the dashboard
// schema; they do not evolve independently.
// schema; they do not evolve independently.
//
//
@ -588,7 +590,7 @@ type RowPanel struct {
Type RowPanelType ` json:"type" `
Type RowPanelType ` json:"type" `
}
}
// DashboardRowPanelType defines model for Dashboard RowPanel.Type.
// RowPanelType is the Go representation of a RowPanel.Type.
//
//
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
@ -597,7 +599,7 @@ type RowPanelType string
// Schema for panel targets is specified by datasource
// Schema for panel targets is specified by datasource
// plugins. We use a placeholder definition, which the Go
// plugins. We use a placeholder definition, which the Go
// schema loader either left open/as-is with the Base
// schema loader either left open/as-is with the Base
// variant of the Dashboard and Panel families, or filled
// variant of the Model and Panel families, or filled
// with types derived from plugins in the Instance variant.
// with types derived from plugins in the Instance variant.
// When working directly from CUE, importers can extend this
// When working directly from CUE, importers can extend this
// type directly to achieve the same effect.
// type directly to achieve the same effect.
@ -624,7 +626,7 @@ type Threshold struct {
Value * float32 ` json:"value,omitempty" `
Value * float32 ` json:"value,omitempty" `
}
}
// DashboardThresholdsConfig defines model for dashboard.ThresholdsConfig.
// ThresholdsConfig is the Go representation of a dashboard.ThresholdsConfig.
//
//
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
@ -647,13 +649,13 @@ type ThresholdsConfig struct {
} ` json:"steps" `
} ` json:"steps" `
}
}
// DashboardThresholdsConfigMode defines model for Dashboard ThresholdsConfig.Mode.
// ThresholdsConfigMode is the Go representation of a ThresholdsConfig.Mode.
//
//
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
type ThresholdsConfigMode string
type ThresholdsConfigMode string
// DashboardThresholdsMode defines model for dashboard.ThresholdsMode.
// ThresholdsMode is the Go representation of a dashboard.ThresholdsMode.
//
//
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
@ -682,7 +684,7 @@ type VariableModel struct {
Type VariableModelType ` json:"type" `
Type VariableModelType ` json:"type" `
}
}
// DashboardVariableModelType defines model for Dashboard VariableModel.Type.
// VariableModelType is the Go representation of a VariableModel.Type.
//
//
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
// Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.
@ -699,7 +701,11 @@ type VariableType string
//go:embed coremodel.cue
//go:embed coremodel.cue
var cueFS embed . FS
var cueFS embed . FS
// codegen ensures that this is always the latest Thema schema version
// The current version of the coremodel schema, as declared in coremodel.cue.
// This version determines what schema version is returned from [Coremodel.CurrentSchema],
// and which schema version is used for code generation within the grafana/grafana repository.
//
// The code generator ensures that this is always the latest Thema schema version.
var currentVersion = thema . SV ( 0 , 0 )
var currentVersion = thema . SV ( 0 , 0 )
// Lineage returns the Thema lineage representing a Grafana dashboard.
// Lineage returns the Thema lineage representing a Grafana dashboard.