|
|
|
@@ -5,7 +5,6 @@ package v2alpha1
|
|
|
|
|
import (
|
|
|
|
|
json "encoding/json"
|
|
|
|
|
errors "errors"
|
|
|
|
|
fmt "fmt"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// +k8s:openapi-gen=true
|
|
|
|
@@ -65,7 +64,9 @@ type DashboardDataQueryKind struct {
|
|
|
|
|
|
|
|
|
|
// NewDashboardDataQueryKind creates a new DashboardDataQueryKind object.
|
|
|
|
|
func NewDashboardDataQueryKind() *DashboardDataQueryKind {
|
|
|
|
|
return &DashboardDataQueryKind{}
|
|
|
|
|
return &DashboardDataQueryKind{
|
|
|
|
|
Spec: map[string]interface{}{},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// +k8s:openapi-gen=true
|
|
|
|
@@ -80,6 +81,7 @@ type DashboardAnnotationPanelFilter struct {
|
|
|
|
|
func NewDashboardAnnotationPanelFilter() *DashboardAnnotationPanelFilter {
|
|
|
|
|
return &DashboardAnnotationPanelFilter{
|
|
|
|
|
Exclude: (func(input bool) *bool { return &input })(false),
|
|
|
|
|
Ids: []uint32{},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -133,6 +135,7 @@ type DashboardPanelSpec struct {
|
|
|
|
|
// NewDashboardPanelSpec creates a new DashboardPanelSpec object.
|
|
|
|
|
func NewDashboardPanelSpec() *DashboardPanelSpec {
|
|
|
|
|
return &DashboardPanelSpec{
|
|
|
|
|
Links: []DashboardDataLink{},
|
|
|
|
|
Data: *NewDashboardQueryGroupKind(),
|
|
|
|
|
VizConfig: *NewDashboardVizConfigKind(),
|
|
|
|
|
}
|
|
|
|
@@ -174,7 +177,9 @@ type DashboardQueryGroupSpec struct {
|
|
|
|
|
// NewDashboardQueryGroupSpec creates a new DashboardQueryGroupSpec object.
|
|
|
|
|
func NewDashboardQueryGroupSpec() *DashboardQueryGroupSpec {
|
|
|
|
|
return &DashboardQueryGroupSpec{
|
|
|
|
|
QueryOptions: *NewDashboardQueryOptionsSpec(),
|
|
|
|
|
Queries: []DashboardPanelQueryKind{},
|
|
|
|
|
Transformations: []DashboardTransformationKind{},
|
|
|
|
|
QueryOptions: *NewDashboardQueryOptionsSpec(),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -313,6 +318,7 @@ type DashboardVizConfigSpec struct {
|
|
|
|
|
// NewDashboardVizConfigSpec creates a new DashboardVizConfigSpec object.
|
|
|
|
|
func NewDashboardVizConfigSpec() *DashboardVizConfigSpec {
|
|
|
|
|
return &DashboardVizConfigSpec{
|
|
|
|
|
Options: map[string]interface{}{},
|
|
|
|
|
FieldConfig: *NewDashboardFieldConfigSource(),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@@ -331,7 +337,8 @@ type DashboardFieldConfigSource struct {
|
|
|
|
|
// NewDashboardFieldConfigSource creates a new DashboardFieldConfigSource object.
|
|
|
|
|
func NewDashboardFieldConfigSource() *DashboardFieldConfigSource {
|
|
|
|
|
return &DashboardFieldConfigSource{
|
|
|
|
|
Defaults: *NewDashboardFieldConfig(),
|
|
|
|
|
Defaults: *NewDashboardFieldConfig(),
|
|
|
|
|
Overrides: []DashboardV2alpha1FieldConfigSourceOverrides{},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -417,7 +424,8 @@ type DashboardValueMap struct {
|
|
|
|
|
// NewDashboardValueMap creates a new DashboardValueMap object.
|
|
|
|
|
func NewDashboardValueMap() *DashboardValueMap {
|
|
|
|
|
return &DashboardValueMap{
|
|
|
|
|
Type: DashboardMappingTypeValue,
|
|
|
|
|
Type: DashboardMappingTypeValue,
|
|
|
|
|
Options: map[string]DashboardValueMappingResult{},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -526,7 +534,9 @@ type DashboardThresholdsConfig struct {
|
|
|
|
|
|
|
|
|
|
// NewDashboardThresholdsConfig creates a new DashboardThresholdsConfig object.
|
|
|
|
|
func NewDashboardThresholdsConfig() *DashboardThresholdsConfig {
|
|
|
|
|
return &DashboardThresholdsConfig{}
|
|
|
|
|
return &DashboardThresholdsConfig{
|
|
|
|
|
Steps: []DashboardThreshold{},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// +k8s:openapi-gen=true
|
|
|
|
@@ -693,7 +703,9 @@ type DashboardGridLayoutSpec struct {
|
|
|
|
|
|
|
|
|
|
// NewDashboardGridLayoutSpec creates a new DashboardGridLayoutSpec object.
|
|
|
|
|
func NewDashboardGridLayoutSpec() *DashboardGridLayoutSpec {
|
|
|
|
|
return &DashboardGridLayoutSpec{}
|
|
|
|
|
return &DashboardGridLayoutSpec{
|
|
|
|
|
Items: []DashboardGridLayoutItemKind{},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// +k8s:openapi-gen=true
|
|
|
|
@@ -779,7 +791,9 @@ type DashboardRowsLayoutSpec struct {
|
|
|
|
|
|
|
|
|
|
// NewDashboardRowsLayoutSpec creates a new DashboardRowsLayoutSpec object.
|
|
|
|
|
func NewDashboardRowsLayoutSpec() *DashboardRowsLayoutSpec {
|
|
|
|
|
return &DashboardRowsLayoutSpec{}
|
|
|
|
|
return &DashboardRowsLayoutSpec{
|
|
|
|
|
Rows: []DashboardRowsLayoutRowKind{},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// +k8s:openapi-gen=true
|
|
|
|
@@ -837,7 +851,9 @@ type DashboardConditionalRenderingGroupSpec struct {
|
|
|
|
|
|
|
|
|
|
// NewDashboardConditionalRenderingGroupSpec creates a new DashboardConditionalRenderingGroupSpec object.
|
|
|
|
|
func NewDashboardConditionalRenderingGroupSpec() *DashboardConditionalRenderingGroupSpec {
|
|
|
|
|
return &DashboardConditionalRenderingGroupSpec{}
|
|
|
|
|
return &DashboardConditionalRenderingGroupSpec{
|
|
|
|
|
Items: []DashboardConditionalRenderingVariableKindOrConditionalRenderingDataKindOrConditionalRenderingTimeRangeSizeKind{},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// +k8s:openapi-gen=true
|
|
|
|
@@ -955,6 +971,7 @@ func NewDashboardAutoGridLayoutSpec() *DashboardAutoGridLayoutSpec {
|
|
|
|
|
return &DashboardAutoGridLayoutSpec{
|
|
|
|
|
MaxColumnCount: (func(input float64) *float64 { return &input })(3),
|
|
|
|
|
FillScreen: (func(input bool) *bool { return &input })(false),
|
|
|
|
|
Items: []DashboardAutoGridLayoutItemKind{},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1018,7 +1035,9 @@ type DashboardTabsLayoutSpec struct {
|
|
|
|
|
|
|
|
|
|
// NewDashboardTabsLayoutSpec creates a new DashboardTabsLayoutSpec object.
|
|
|
|
|
func NewDashboardTabsLayoutSpec() *DashboardTabsLayoutSpec {
|
|
|
|
|
return &DashboardTabsLayoutSpec{}
|
|
|
|
|
return &DashboardTabsLayoutSpec{
|
|
|
|
|
Tabs: []DashboardTabsLayoutTabKind{},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// +k8s:openapi-gen=true
|
|
|
|
@@ -1090,6 +1109,7 @@ type DashboardDashboardLink struct {
|
|
|
|
|
// NewDashboardDashboardLink creates a new DashboardDashboardLink object.
|
|
|
|
|
func NewDashboardDashboardLink() *DashboardDashboardLink {
|
|
|
|
|
return &DashboardDashboardLink{
|
|
|
|
|
Tags: []string{},
|
|
|
|
|
AsDropdown: false,
|
|
|
|
|
TargetBlank: false,
|
|
|
|
|
IncludeVars: false,
|
|
|
|
@@ -1231,6 +1251,7 @@ func NewDashboardQueryVariableSpec() *DashboardQueryVariableSpec {
|
|
|
|
|
SkipUrlSync: false,
|
|
|
|
|
Query: *NewDashboardDataQueryKind(),
|
|
|
|
|
Regex: "",
|
|
|
|
|
Options: []DashboardVariableOption{},
|
|
|
|
|
Multi: false,
|
|
|
|
|
IncludeAll: false,
|
|
|
|
|
AllowCustomValue: true,
|
|
|
|
@@ -1446,6 +1467,7 @@ func NewDashboardDatasourceVariableSpec() *DashboardDatasourceVariableSpec {
|
|
|
|
|
String: (func(input string) *string { return &input })(""),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
Options: []DashboardVariableOption{},
|
|
|
|
|
Multi: false,
|
|
|
|
|
IncludeAll: false,
|
|
|
|
|
Hide: DashboardVariableHideDontHide,
|
|
|
|
@@ -1499,6 +1521,7 @@ func NewDashboardIntervalVariableSpec() *DashboardIntervalVariableSpec {
|
|
|
|
|
String: (func(input string) *string { return &input })(""),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
Options: []DashboardVariableOption{},
|
|
|
|
|
Auto: false,
|
|
|
|
|
AutoMin: "",
|
|
|
|
|
AutoCount: 0,
|
|
|
|
@@ -1546,6 +1569,7 @@ func NewDashboardCustomVariableSpec() *DashboardCustomVariableSpec {
|
|
|
|
|
Name: "",
|
|
|
|
|
Query: "",
|
|
|
|
|
Current: *NewDashboardVariableOption(),
|
|
|
|
|
Options: []DashboardVariableOption{},
|
|
|
|
|
Multi: false,
|
|
|
|
|
IncludeAll: false,
|
|
|
|
|
Hide: DashboardVariableHideDontHide,
|
|
|
|
@@ -1596,6 +1620,7 @@ func NewDashboardGroupByVariableSpec() *DashboardGroupByVariableSpec {
|
|
|
|
|
String: (func(input string) *string { return &input })(""),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
Options: []DashboardVariableOption{},
|
|
|
|
|
Multi: false,
|
|
|
|
|
Hide: DashboardVariableHideDontHide,
|
|
|
|
|
SkipUrlSync: false,
|
|
|
|
@@ -1636,6 +1661,9 @@ type DashboardAdhocVariableSpec struct {
|
|
|
|
|
func NewDashboardAdhocVariableSpec() *DashboardAdhocVariableSpec {
|
|
|
|
|
return &DashboardAdhocVariableSpec{
|
|
|
|
|
Name: "",
|
|
|
|
|
BaseFilters: []DashboardAdHocFilterWithLabels{},
|
|
|
|
|
Filters: []DashboardAdHocFilterWithLabels{},
|
|
|
|
|
DefaultKeys: []DashboardMetricFindValue{},
|
|
|
|
|
Hide: DashboardVariableHideDontHide,
|
|
|
|
|
SkipUrlSync: false,
|
|
|
|
|
AllowCustomValue: true,
|
|
|
|
@@ -1723,11 +1751,16 @@ type DashboardSpec struct {
|
|
|
|
|
// NewDashboardSpec creates a new DashboardSpec object.
|
|
|
|
|
func NewDashboardSpec() *DashboardSpec {
|
|
|
|
|
return &DashboardSpec{
|
|
|
|
|
Annotations: []DashboardAnnotationQueryKind{},
|
|
|
|
|
CursorSync: DashboardDashboardCursorSyncOff,
|
|
|
|
|
Editable: (func(input bool) *bool { return &input })(true),
|
|
|
|
|
Elements: map[string]DashboardElement{},
|
|
|
|
|
Layout: *NewDashboardGridLayoutKindOrRowsLayoutKindOrAutoGridLayoutKindOrTabsLayoutKind(),
|
|
|
|
|
Links: []DashboardDashboardLink{},
|
|
|
|
|
Preload: false,
|
|
|
|
|
Tags: []string{},
|
|
|
|
|
TimeSettings: *NewDashboardTimeSettingsSpec(),
|
|
|
|
|
Variables: []DashboardVariableKind{},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1740,7 +1773,8 @@ type DashboardV2alpha1FieldConfigSourceOverrides struct {
|
|
|
|
|
// NewDashboardV2alpha1FieldConfigSourceOverrides creates a new DashboardV2alpha1FieldConfigSourceOverrides object.
|
|
|
|
|
func NewDashboardV2alpha1FieldConfigSourceOverrides() *DashboardV2alpha1FieldConfigSourceOverrides {
|
|
|
|
|
return &DashboardV2alpha1FieldConfigSourceOverrides{
|
|
|
|
|
Matcher: *NewDashboardMatcherConfig(),
|
|
|
|
|
Matcher: *NewDashboardMatcherConfig(),
|
|
|
|
|
Properties: []DashboardDynamicConfigValue{},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1871,6 +1905,7 @@ func (resource DashboardPanelKindOrLibraryPanelKind) MarshalJSON() ([]byte, erro
|
|
|
|
|
if resource.LibraryPanelKind != nil {
|
|
|
|
|
return json.Marshal(resource.LibraryPanelKind)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return []byte("null"), nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1888,7 +1923,7 @@ func (resource *DashboardPanelKindOrLibraryPanelKind) UnmarshalJSON(raw []byte)
|
|
|
|
|
|
|
|
|
|
discriminator, found := parsedAsMap["kind"]
|
|
|
|
|
if !found {
|
|
|
|
|
return errors.New("discriminator field 'kind' not found in payload")
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch discriminator {
|
|
|
|
@@ -1910,7 +1945,7 @@ func (resource *DashboardPanelKindOrLibraryPanelKind) UnmarshalJSON(raw []byte)
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return fmt.Errorf("could not unmarshal resource with `kind = %v`", discriminator)
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// +k8s:openapi-gen=true
|
|
|
|
@@ -1940,6 +1975,7 @@ func (resource DashboardValueMapOrRangeMapOrRegexMapOrSpecialValueMap) MarshalJS
|
|
|
|
|
if resource.SpecialValueMap != nil {
|
|
|
|
|
return json.Marshal(resource.SpecialValueMap)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return []byte("null"), nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1957,7 +1993,7 @@ func (resource *DashboardValueMapOrRangeMapOrRegexMapOrSpecialValueMap) Unmarsha
|
|
|
|
|
|
|
|
|
|
discriminator, found := parsedAsMap["type"]
|
|
|
|
|
if !found {
|
|
|
|
|
return errors.New("discriminator field 'type' not found in payload")
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch discriminator {
|
|
|
|
@@ -1995,7 +2031,7 @@ func (resource *DashboardValueMapOrRangeMapOrRegexMapOrSpecialValueMap) Unmarsha
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return fmt.Errorf("could not unmarshal resource with `type = %v`", discriminator)
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// +k8s:openapi-gen=true
|
|
|
|
@@ -2025,6 +2061,7 @@ func (resource DashboardGridLayoutKindOrAutoGridLayoutKindOrTabsLayoutKindOrRows
|
|
|
|
|
if resource.RowsLayoutKind != nil {
|
|
|
|
|
return json.Marshal(resource.RowsLayoutKind)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return []byte("null"), nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -2042,7 +2079,7 @@ func (resource *DashboardGridLayoutKindOrAutoGridLayoutKindOrTabsLayoutKindOrRow
|
|
|
|
|
|
|
|
|
|
discriminator, found := parsedAsMap["kind"]
|
|
|
|
|
if !found {
|
|
|
|
|
return errors.New("discriminator field 'kind' not found in payload")
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch discriminator {
|
|
|
|
@@ -2080,7 +2117,7 @@ func (resource *DashboardGridLayoutKindOrAutoGridLayoutKindOrTabsLayoutKindOrRow
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return fmt.Errorf("could not unmarshal resource with `kind = %v`", discriminator)
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// +k8s:openapi-gen=true
|
|
|
|
@@ -2106,6 +2143,7 @@ func (resource DashboardConditionalRenderingVariableKindOrConditionalRenderingDa
|
|
|
|
|
if resource.ConditionalRenderingTimeRangeSizeKind != nil {
|
|
|
|
|
return json.Marshal(resource.ConditionalRenderingTimeRangeSizeKind)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return []byte("null"), nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -2123,7 +2161,7 @@ func (resource *DashboardConditionalRenderingVariableKindOrConditionalRenderingD
|
|
|
|
|
|
|
|
|
|
discriminator, found := parsedAsMap["kind"]
|
|
|
|
|
if !found {
|
|
|
|
|
return errors.New("discriminator field 'kind' not found in payload")
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch discriminator {
|
|
|
|
@@ -2153,7 +2191,7 @@ func (resource *DashboardConditionalRenderingVariableKindOrConditionalRenderingD
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return fmt.Errorf("could not unmarshal resource with `kind = %v`", discriminator)
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// +k8s:openapi-gen=true
|
|
|
|
@@ -2183,6 +2221,7 @@ func (resource DashboardGridLayoutKindOrRowsLayoutKindOrAutoGridLayoutKindOrTabs
|
|
|
|
|
if resource.TabsLayoutKind != nil {
|
|
|
|
|
return json.Marshal(resource.TabsLayoutKind)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return []byte("null"), nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -2200,7 +2239,7 @@ func (resource *DashboardGridLayoutKindOrRowsLayoutKindOrAutoGridLayoutKindOrTab
|
|
|
|
|
|
|
|
|
|
discriminator, found := parsedAsMap["kind"]
|
|
|
|
|
if !found {
|
|
|
|
|
return errors.New("discriminator field 'kind' not found in payload")
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch discriminator {
|
|
|
|
@@ -2238,7 +2277,7 @@ func (resource *DashboardGridLayoutKindOrRowsLayoutKindOrAutoGridLayoutKindOrTab
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return fmt.Errorf("could not unmarshal resource with `kind = %v`", discriminator)
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// +k8s:openapi-gen=true
|
|
|
|
@@ -2284,6 +2323,7 @@ func (resource DashboardQueryVariableKindOrTextVariableKindOrConstantVariableKin
|
|
|
|
|
if resource.AdhocVariableKind != nil {
|
|
|
|
|
return json.Marshal(resource.AdhocVariableKind)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return []byte("null"), nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -2301,7 +2341,7 @@ func (resource *DashboardQueryVariableKindOrTextVariableKindOrConstantVariableKi
|
|
|
|
|
|
|
|
|
|
discriminator, found := parsedAsMap["kind"]
|
|
|
|
|
if !found {
|
|
|
|
|
return errors.New("discriminator field 'kind' not found in payload")
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch discriminator {
|
|
|
|
@@ -2371,7 +2411,7 @@ func (resource *DashboardQueryVariableKindOrTextVariableKindOrConstantVariableKi
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return fmt.Errorf("could not unmarshal resource with `kind = %v`", discriminator)
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// +k8s:openapi-gen=true
|
|
|
|
|