mirror of https://github.com/grafana/grafana
Alerting: Update alerting cue definitions (#104053)
Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>pull/104131/head^2
parent
8d883ecda1
commit
c174c855c3
@ -1,4 +1,8 @@ |
||||
.PHONY: generate |
||||
generate: |
||||
## --crdencoding none is needed to avoid infinite loop while generating recursive models (see routingtree.cue)
|
||||
grafana-app-sdk generate -g ./pkg/apis --crdencoding none --nomanifest --postprocess
|
||||
## --defencoding=none is needed to avoid infinite loop while generating recursive models (see routingtree.cue)
|
||||
@grafana-app-sdk generate \
|
||||
--gogenpath=./pkg/apis \
|
||||
--source=./kinds/ \
|
||||
--defencoding=none \
|
||||
--noschemasinmanifest
|
||||
|
@ -1 +1,4 @@ |
||||
module: "github.com/grafana/grafana/apps/alerting/notifications/kinds" |
||||
module: "github.com/grafana/grafana/apps/alerting/notifications/kinds" |
||||
language: { |
||||
version: "v0.9.0" |
||||
} |
||||
|
@ -0,0 +1,12 @@ |
||||
package kinds |
||||
|
||||
manifest: { |
||||
appName: "alerting" |
||||
groupOverride: "notifications.alerting.grafana.app" |
||||
kinds: [ |
||||
receiver, |
||||
routeTree, |
||||
templateGroup, |
||||
timeInterval, |
||||
] |
||||
} |
@ -1,49 +1,25 @@ |
||||
package core |
||||
package kinds |
||||
|
||||
route: { |
||||
kind: "RoutingTree" |
||||
group: "notifications" |
||||
import ( |
||||
"github.com/grafana/grafana/apps/alerting/notifications/kinds/v0alpha1" |
||||
) |
||||
|
||||
routeTree: { |
||||
kind: "RoutingTree" |
||||
apiResource: { |
||||
groupOverride: "notifications.alerting.grafana.app" |
||||
} |
||||
codegen: { |
||||
frontend: false |
||||
backend: true |
||||
} |
||||
pluralName: "RoutingTrees" |
||||
current: "v0alpha1" |
||||
codegen: { |
||||
ts: {enabled: false} |
||||
go: {enabled: true} |
||||
} |
||||
versions: { |
||||
"v0alpha1": { |
||||
schema: { |
||||
#RouteDefaults: { |
||||
receiver: string |
||||
group_by?: [...string] |
||||
group_wait?: string |
||||
group_interval?: string |
||||
repeat_interval?: string |
||||
} |
||||
#Matcher: { |
||||
type: "=" |"!="|"=~"|"!~" @cuetsy(kind="enum") |
||||
label: string |
||||
value: string |
||||
} |
||||
#Route: { |
||||
receiver?: string |
||||
matchers?: [...#Matcher] |
||||
continue: bool |
||||
|
||||
group_by?: [...string] |
||||
mute_time_intervals?: [...string] |
||||
routes?: [...#Route] |
||||
group_wait?: string |
||||
group_interval?: string |
||||
repeat_interval?: string |
||||
} |
||||
spec: { |
||||
defaults: #RouteDefaults |
||||
routes: [...#Route] |
||||
} |
||||
spec: v0alpha1.RouteTreeSpec |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,40 +1,28 @@ |
||||
package core |
||||
package kinds |
||||
|
||||
import ( |
||||
"github.com/grafana/grafana/apps/alerting/notifications/kinds/v0alpha1" |
||||
) |
||||
|
||||
timeInterval: { |
||||
kind: "TimeInterval" |
||||
group: "notifications" |
||||
kind: "TimeInterval" |
||||
apiResource: { |
||||
groupOverride: "notifications.alerting.grafana.app" |
||||
} |
||||
codegen: { |
||||
frontend: false |
||||
backend: true |
||||
} |
||||
pluralName: "TimeIntervals" |
||||
current: "v0alpha1" |
||||
codegen: { |
||||
ts: {enabled: false} |
||||
go: {enabled: true} |
||||
} |
||||
versions: { |
||||
"v0alpha1": { |
||||
schema: { |
||||
#TimeRange: { |
||||
start_time: string |
||||
end_time: string |
||||
} |
||||
#Interval: { |
||||
times?: [...#TimeRange] |
||||
weekdays?: [...string] |
||||
days_of_month?: [...string] |
||||
months?: [...string] |
||||
years?: [...string] |
||||
location?: string |
||||
} |
||||
spec: { |
||||
name: string |
||||
time_intervals: [...#Interval] |
||||
} |
||||
spec: v0alpha1.TimeIntervalSpec |
||||
} |
||||
selectableFields: [ |
||||
"spec.name", |
||||
"spec.name", |
||||
] |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
@ -0,0 +1,16 @@ |
||||
package v0alpha1 |
||||
|
||||
ReceiverSpec: { |
||||
title: string |
||||
integrations: [...#Integration] |
||||
} |
||||
|
||||
#Integration: { |
||||
uid?: string |
||||
type: string |
||||
disableResolveMessage?: bool |
||||
settings: { |
||||
[string]: _ |
||||
} |
||||
secureFields?: [string]: bool |
||||
} |
@ -0,0 +1,33 @@ |
||||
package v0alpha1 |
||||
|
||||
RouteTreeSpec: { |
||||
defaults: #RouteDefaults |
||||
routes: [...#Route] |
||||
} |
||||
|
||||
#RouteDefaults: { |
||||
receiver: string |
||||
group_by?: [...string] |
||||
group_wait?: string |
||||
group_interval?: string |
||||
repeat_interval?: string |
||||
} |
||||
|
||||
#Matcher: { |
||||
type: "=" | "!=" | "=~" | "!~" @cuetsy(kind="enum",memberNames="Equal|NotEqual|EqualRegex|NotEqualRegex") |
||||
label: string |
||||
value: string |
||||
} |
||||
|
||||
#Route: { |
||||
receiver?: string |
||||
matchers?: [...#Matcher] |
||||
continue: bool |
||||
|
||||
group_by?: [...string] |
||||
mute_time_intervals?: [...string] |
||||
routes?: [...#Route] |
||||
group_wait?: string |
||||
group_interval?: string |
||||
repeat_interval?: string |
||||
} |
@ -0,0 +1,6 @@ |
||||
package v0alpha1 |
||||
|
||||
TemplateGroupSpec: { |
||||
title: string |
||||
content: string |
||||
} |
@ -0,0 +1,19 @@ |
||||
package v0alpha1 |
||||
|
||||
TimeIntervalSpec: { |
||||
name: string |
||||
time_intervals: [...#Interval] |
||||
} |
||||
|
||||
#TimeRange: { |
||||
start_time: string |
||||
end_time: string |
||||
} |
||||
#Interval: { |
||||
times?: [...#TimeRange] |
||||
weekdays?: [...string] |
||||
days_of_month?: [...string] |
||||
months?: [...string] |
||||
years?: [...string] |
||||
location?: string |
||||
} |
@ -0,0 +1,18 @@ |
||||
package v0alpha1 |
||||
|
||||
import "k8s.io/apimachinery/pkg/runtime/schema" |
||||
|
||||
const ( |
||||
// Group is the API group used by all kinds in this package
|
||||
Group = "notifications.alerting.grafana.app" |
||||
// Version is the API version used by all kinds in this package
|
||||
Version = "v0alpha1" |
||||
) |
||||
|
||||
var ( |
||||
// GroupVersion is a schema.GroupVersion consisting of the Group and Version constants for this package
|
||||
GroupVersion = schema.GroupVersion{ |
||||
Group: Group, |
||||
Version: Version, |
||||
} |
||||
) |
@ -0,0 +1,87 @@ |
||||
//
|
||||
// This file is generated by grafana-app-sdk
|
||||
// DO NOT EDIT
|
||||
//
|
||||
|
||||
package apis |
||||
|
||||
import ( |
||||
"encoding/json" |
||||
|
||||
"github.com/grafana/grafana-app-sdk/app" |
||||
) |
||||
|
||||
var () |
||||
|
||||
var appManifestData = app.ManifestData{ |
||||
AppName: "alerting", |
||||
Group: "notifications.alerting.grafana.app", |
||||
Kinds: []app.ManifestKind{ |
||||
{ |
||||
Kind: "Receiver", |
||||
Scope: "Namespaced", |
||||
Conversion: false, |
||||
Versions: []app.ManifestKindVersion{ |
||||
{ |
||||
Name: "v0alpha1", |
||||
SelectableFields: []string{ |
||||
"spec.title", |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
|
||||
{ |
||||
Kind: "RoutingTree", |
||||
Scope: "Namespaced", |
||||
Conversion: false, |
||||
Versions: []app.ManifestKindVersion{ |
||||
{ |
||||
Name: "v0alpha1", |
||||
}, |
||||
}, |
||||
}, |
||||
|
||||
{ |
||||
Kind: "TemplateGroup", |
||||
Scope: "Namespaced", |
||||
Conversion: false, |
||||
Versions: []app.ManifestKindVersion{ |
||||
{ |
||||
Name: "v0alpha1", |
||||
SelectableFields: []string{ |
||||
"spec.title", |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
|
||||
{ |
||||
Kind: "TimeInterval", |
||||
Scope: "Namespaced", |
||||
Conversion: false, |
||||
Versions: []app.ManifestKindVersion{ |
||||
{ |
||||
Name: "v0alpha1", |
||||
SelectableFields: []string{ |
||||
"spec.name", |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
} |
||||
|
||||
func jsonToMap(j string) map[string]any { |
||||
m := make(map[string]any) |
||||
json.Unmarshal([]byte(j), &j) |
||||
return m |
||||
} |
||||
|
||||
func LocalManifest() app.Manifest { |
||||
return app.NewEmbeddedManifest(appManifestData) |
||||
} |
||||
|
||||
func RemoteManifest() app.Manifest { |
||||
return app.NewAPIServerManifest("alerting") |
||||
} |
@ -0,0 +1,18 @@ |
||||
package v0alpha1 |
||||
|
||||
import "k8s.io/apimachinery/pkg/runtime/schema" |
||||
|
||||
const ( |
||||
// Group is the API group used by all kinds in this package
|
||||
Group = "notifications.alerting.grafana.app" |
||||
// Version is the API version used by all kinds in this package
|
||||
Version = "v0alpha1" |
||||
) |
||||
|
||||
var ( |
||||
// GroupVersion is a schema.GroupVersion consisting of the Group and Version constants for this package
|
||||
GroupVersion = schema.GroupVersion{ |
||||
Group: Group, |
||||
Version: Version, |
||||
} |
||||
) |
@ -0,0 +1,28 @@ |
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1 |
||||
|
||||
import ( |
||||
time "time" |
||||
) |
||||
|
||||
// metadata contains embedded CommonMetadata and can be extended with custom string fields
|
||||
// TODO: use CommonMetadata instead of redefining here; currently needs to be defined here
|
||||
// without external reference as using the CommonMetadata reference breaks thema codegen.
|
||||
type Metadata struct { |
||||
UpdateTimestamp time.Time `json:"updateTimestamp"` |
||||
CreatedBy string `json:"createdBy"` |
||||
Uid string `json:"uid"` |
||||
CreationTimestamp time.Time `json:"creationTimestamp"` |
||||
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"` |
||||
Finalizers []string `json:"finalizers"` |
||||
ResourceVersion string `json:"resourceVersion"` |
||||
Generation int64 `json:"generation"` |
||||
UpdatedBy string `json:"updatedBy"` |
||||
Labels map[string]string `json:"labels"` |
||||
} |
||||
|
||||
// NewMetadata creates a new Metadata object.
|
||||
func NewMetadata() *Metadata { |
||||
return &Metadata{} |
||||
} |
@ -1,18 +1,28 @@ |
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1 |
||||
|
||||
// Integration defines model for Integration.
|
||||
// +k8s:openapi-gen=true
|
||||
type Integration struct { |
||||
Uid *string `json:"uid,omitempty"` |
||||
Type string `json:"type"` |
||||
DisableResolveMessage *bool `json:"disableResolveMessage,omitempty"` |
||||
SecureFields map[string]bool `json:"secureFields,omitempty"` |
||||
Settings map[string]interface{} `json:"settings"` |
||||
Type string `json:"type"` |
||||
Uid *string `json:"uid,omitempty"` |
||||
SecureFields map[string]bool `json:"secureFields,omitempty"` |
||||
} |
||||
|
||||
// NewIntegration creates a new Integration object.
|
||||
func NewIntegration() *Integration { |
||||
return &Integration{} |
||||
} |
||||
|
||||
// Spec defines model for Spec.
|
||||
// +k8s:openapi-gen=true
|
||||
type Spec struct { |
||||
Integrations []Integration `json:"integrations"` |
||||
Title string `json:"title"` |
||||
Integrations []Integration `json:"integrations"` |
||||
} |
||||
|
||||
// NewSpec creates a new Spec object.
|
||||
func NewSpec() *Spec { |
||||
return &Spec{} |
||||
} |
@ -0,0 +1,44 @@ |
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1 |
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type StatusOperatorState struct { |
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
LastEvaluation string `json:"lastEvaluation"` |
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
State StatusOperatorStateState `json:"state"` |
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
DescriptiveState *string `json:"descriptiveState,omitempty"` |
||||
// details contains any extra information that is operator-specific
|
||||
Details map[string]interface{} `json:"details,omitempty"` |
||||
} |
||||
|
||||
// NewStatusOperatorState creates a new StatusOperatorState object.
|
||||
func NewStatusOperatorState() *StatusOperatorState { |
||||
return &StatusOperatorState{} |
||||
} |
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type Status struct { |
||||
// operatorStates is a map of operator ID to operator state evaluations.
|
||||
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
|
||||
OperatorStates map[string]StatusOperatorState `json:"operatorStates,omitempty"` |
||||
// additionalFields is reserved for future use
|
||||
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"` |
||||
} |
||||
|
||||
// NewStatus creates a new Status object.
|
||||
func NewStatus() *Status { |
||||
return &Status{} |
||||
} |
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type StatusOperatorStateState string |
||||
|
||||
const ( |
||||
StatusOperatorStateStateSuccess StatusOperatorStateState = "success" |
||||
StatusOperatorStateStateInProgress StatusOperatorStateState = "in_progress" |
||||
StatusOperatorStateStateFailed StatusOperatorStateState = "failed" |
||||
) |
@ -0,0 +1 @@ |
||||
API rule violation: list_type_missing,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/receiver/v0alpha1,Spec,Integrations |
@ -1,32 +0,0 @@ |
||||
package v0alpha1 |
||||
|
||||
import ( |
||||
"time" |
||||
) |
||||
|
||||
// Metadata defines model for Metadata.
|
||||
type Metadata struct { |
||||
CreatedBy string `json:"createdBy"` |
||||
CreationTimestamp time.Time `json:"creationTimestamp"` |
||||
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"` |
||||
Finalizers []string `json:"finalizers"` |
||||
Generation int64 `json:"generation"` |
||||
Labels map[string]string `json:"labels"` |
||||
ResourceVersion string `json:"resourceVersion"` |
||||
Uid string `json:"uid"` |
||||
UpdateTimestamp time.Time `json:"updateTimestamp"` |
||||
UpdatedBy string `json:"updatedBy"` |
||||
} |
||||
|
||||
// _kubeObjectMetadata is metadata found in a kubernetes object's metadata field.
|
||||
// It is not exhaustive and only includes fields which may be relevant to a kind's implementation,
|
||||
// As it is also intended to be generic enough to function with any API Server.
|
||||
type KubeObjectMetadata struct { |
||||
CreationTimestamp time.Time `json:"creationTimestamp"` |
||||
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"` |
||||
Finalizers []string `json:"finalizers"` |
||||
Generation int64 `json:"generation"` |
||||
Labels map[string]string `json:"labels"` |
||||
ResourceVersion string `json:"resourceVersion"` |
||||
Uid string `json:"uid"` |
||||
} |
@ -1,70 +0,0 @@ |
||||
package v0alpha1 |
||||
|
||||
// Defines values for OperatorStateState.
|
||||
const ( |
||||
OperatorStateStateFailed OperatorStateState = "failed" |
||||
OperatorStateStateInProgress OperatorStateState = "in_progress" |
||||
OperatorStateStateSuccess OperatorStateState = "success" |
||||
) |
||||
|
||||
// Defines values for StatusOperatorStateState.
|
||||
const ( |
||||
StatusOperatorStateStateFailed StatusOperatorStateState = "failed" |
||||
StatusOperatorStateStateInProgress StatusOperatorStateState = "in_progress" |
||||
StatusOperatorStateStateSuccess StatusOperatorStateState = "success" |
||||
) |
||||
|
||||
// OperatorState defines model for OperatorState.
|
||||
// +k8s:openapi-gen=true
|
||||
type OperatorState struct { |
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
DescriptiveState *string `json:"descriptiveState,omitempty"` |
||||
|
||||
// details contains any extra information that is operator-specific
|
||||
Details map[string]interface{} `json:"details,omitempty"` |
||||
|
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
LastEvaluation string `json:"lastEvaluation"` |
||||
|
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
State OperatorStateState `json:"state"` |
||||
} |
||||
|
||||
// OperatorStateState state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
// +k8s:openapi-gen=true
|
||||
type OperatorStateState string |
||||
|
||||
// Status defines model for Status.
|
||||
// +k8s:openapi-gen=true
|
||||
type Status struct { |
||||
// additionalFields is reserved for future use
|
||||
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"` |
||||
|
||||
// operatorStates is a map of operator ID to operator state evaluations.
|
||||
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
|
||||
OperatorStates map[string]StatusOperatorState `json:"operatorStates,omitempty"` |
||||
} |
||||
|
||||
// StatusOperatorState defines model for status.#OperatorState.
|
||||
// +k8s:openapi-gen=true
|
||||
type StatusOperatorState struct { |
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
DescriptiveState *string `json:"descriptiveState,omitempty"` |
||||
|
||||
// details contains any extra information that is operator-specific
|
||||
Details map[string]interface{} `json:"details,omitempty"` |
||||
|
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
LastEvaluation string `json:"lastEvaluation"` |
||||
|
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
State StatusOperatorStateState `json:"state"` |
||||
} |
||||
|
||||
// StatusOperatorStateState state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
// +k8s:openapi-gen=true
|
||||
type StatusOperatorStateState string |
@ -1,32 +0,0 @@ |
||||
package v0alpha1 |
||||
|
||||
import ( |
||||
"time" |
||||
) |
||||
|
||||
// Metadata defines model for Metadata.
|
||||
type Metadata struct { |
||||
CreatedBy string `json:"createdBy"` |
||||
CreationTimestamp time.Time `json:"creationTimestamp"` |
||||
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"` |
||||
Finalizers []string `json:"finalizers"` |
||||
Generation int64 `json:"generation"` |
||||
Labels map[string]string `json:"labels"` |
||||
ResourceVersion string `json:"resourceVersion"` |
||||
Uid string `json:"uid"` |
||||
UpdateTimestamp time.Time `json:"updateTimestamp"` |
||||
UpdatedBy string `json:"updatedBy"` |
||||
} |
||||
|
||||
// _kubeObjectMetadata is metadata found in a kubernetes object's metadata field.
|
||||
// It is not exhaustive and only includes fields which may be relevant to a kind's implementation,
|
||||
// As it is also intended to be generic enough to function with any API Server.
|
||||
type KubeObjectMetadata struct { |
||||
CreationTimestamp time.Time `json:"creationTimestamp"` |
||||
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"` |
||||
Finalizers []string `json:"finalizers"` |
||||
Generation int64 `json:"generation"` |
||||
Labels map[string]string `json:"labels"` |
||||
ResourceVersion string `json:"resourceVersion"` |
||||
Uid string `json:"uid"` |
||||
} |
@ -1,70 +0,0 @@ |
||||
package v0alpha1 |
||||
|
||||
// Defines values for OperatorStateState.
|
||||
const ( |
||||
OperatorStateStateFailed OperatorStateState = "failed" |
||||
OperatorStateStateInProgress OperatorStateState = "in_progress" |
||||
OperatorStateStateSuccess OperatorStateState = "success" |
||||
) |
||||
|
||||
// Defines values for StatusOperatorStateState.
|
||||
const ( |
||||
StatusOperatorStateStateFailed StatusOperatorStateState = "failed" |
||||
StatusOperatorStateStateInProgress StatusOperatorStateState = "in_progress" |
||||
StatusOperatorStateStateSuccess StatusOperatorStateState = "success" |
||||
) |
||||
|
||||
// OperatorState defines model for OperatorState.
|
||||
// +k8s:openapi-gen=true
|
||||
type OperatorState struct { |
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
DescriptiveState *string `json:"descriptiveState,omitempty"` |
||||
|
||||
// details contains any extra information that is operator-specific
|
||||
Details map[string]interface{} `json:"details,omitempty"` |
||||
|
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
LastEvaluation string `json:"lastEvaluation"` |
||||
|
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
State OperatorStateState `json:"state"` |
||||
} |
||||
|
||||
// OperatorStateState state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
// +k8s:openapi-gen=true
|
||||
type OperatorStateState string |
||||
|
||||
// Status defines model for Status.
|
||||
// +k8s:openapi-gen=true
|
||||
type Status struct { |
||||
// additionalFields is reserved for future use
|
||||
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"` |
||||
|
||||
// operatorStates is a map of operator ID to operator state evaluations.
|
||||
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
|
||||
OperatorStates map[string]StatusOperatorState `json:"operatorStates,omitempty"` |
||||
} |
||||
|
||||
// StatusOperatorState defines model for status.#OperatorState.
|
||||
// +k8s:openapi-gen=true
|
||||
type StatusOperatorState struct { |
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
DescriptiveState *string `json:"descriptiveState,omitempty"` |
||||
|
||||
// details contains any extra information that is operator-specific
|
||||
Details map[string]interface{} `json:"details,omitempty"` |
||||
|
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
LastEvaluation string `json:"lastEvaluation"` |
||||
|
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
State StatusOperatorStateState `json:"state"` |
||||
} |
||||
|
||||
// StatusOperatorStateState state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
// +k8s:openapi-gen=true
|
||||
type StatusOperatorStateState string |
@ -1,493 +0,0 @@ |
||||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
// Code generated by grafana-app-sdk. DO NOT EDIT.
|
||||
|
||||
package v0alpha1 |
||||
|
||||
import ( |
||||
common "k8s.io/kube-openapi/pkg/common" |
||||
spec "k8s.io/kube-openapi/pkg/validation/spec" |
||||
) |
||||
|
||||
func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { |
||||
return map[string]common.OpenAPIDefinition{ |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.Matcher": schema_apis_resource_routingtree_v0alpha1_Matcher(ref), |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.OperatorState": schema_apis_resource_routingtree_v0alpha1_OperatorState(ref), |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.Route": schema_apis_resource_routingtree_v0alpha1_Route(ref), |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.RouteDefaults": schema_apis_resource_routingtree_v0alpha1_RouteDefaults(ref), |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.RoutingTree": schema_apis_resource_routingtree_v0alpha1_RoutingTree(ref), |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.RoutingTreeList": schema_apis_resource_routingtree_v0alpha1_RoutingTreeList(ref), |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.Spec": schema_apis_resource_routingtree_v0alpha1_Spec(ref), |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.Status": schema_apis_resource_routingtree_v0alpha1_Status(ref), |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.StatusOperatorState": schema_apis_resource_routingtree_v0alpha1_StatusOperatorState(ref), |
||||
} |
||||
} |
||||
|
||||
func schema_apis_resource_routingtree_v0alpha1_Matcher(ref common.ReferenceCallback) common.OpenAPIDefinition { |
||||
return common.OpenAPIDefinition{ |
||||
Schema: spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "Matcher defines model for Matcher.", |
||||
Type: []string{"object"}, |
||||
Properties: map[string]spec.Schema{ |
||||
"label": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: "", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"type": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: "", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"value": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: "", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
}, |
||||
Required: []string{"label", "type", "value"}, |
||||
}, |
||||
}, |
||||
} |
||||
} |
||||
|
||||
func schema_apis_resource_routingtree_v0alpha1_OperatorState(ref common.ReferenceCallback) common.OpenAPIDefinition { |
||||
return common.OpenAPIDefinition{ |
||||
Schema: spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "OperatorState defines model for OperatorState.", |
||||
Type: []string{"object"}, |
||||
Properties: map[string]spec.Schema{ |
||||
"descriptiveState": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "descriptiveState is an optional more descriptive state field which has no requirements on format", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"details": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "details contains any extra information that is operator-specific", |
||||
Type: []string{"object"}, |
||||
AdditionalProperties: &spec.SchemaOrBool{ |
||||
Allows: true, |
||||
Schema: &spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"object"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
"lastEvaluation": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "lastEvaluation is the ResourceVersion last evaluated", |
||||
Default: "", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"state": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "state describes the state of the lastEvaluation. It is limited to three possible states for machine evaluation.", |
||||
Default: "", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
}, |
||||
Required: []string{"lastEvaluation", "state"}, |
||||
}, |
||||
}, |
||||
} |
||||
} |
||||
|
||||
func schema_apis_resource_routingtree_v0alpha1_Route(ref common.ReferenceCallback) common.OpenAPIDefinition { |
||||
return common.OpenAPIDefinition{ |
||||
Schema: spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "Route defines model for Route.", |
||||
Type: []string{"object"}, |
||||
Properties: map[string]spec.Schema{ |
||||
"continue": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: false, |
||||
Type: []string{"boolean"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"group_by": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"array"}, |
||||
Items: &spec.SchemaOrArray{ |
||||
Schema: &spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: "", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
"group_interval": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"group_wait": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"matchers": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"array"}, |
||||
Items: &spec.SchemaOrArray{ |
||||
Schema: &spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: map[string]interface{}{}, |
||||
Ref: ref("github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.Matcher"), |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
"mute_time_intervals": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"array"}, |
||||
Items: &spec.SchemaOrArray{ |
||||
Schema: &spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: "", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
"receiver": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"repeat_interval": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"routes": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"array"}, |
||||
Items: &spec.SchemaOrArray{ |
||||
Schema: &spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: map[string]interface{}{}, |
||||
Ref: ref("github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.Route"), |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
Required: []string{"continue"}, |
||||
}, |
||||
}, |
||||
Dependencies: []string{ |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.Matcher", "github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.Route"}, |
||||
} |
||||
} |
||||
|
||||
func schema_apis_resource_routingtree_v0alpha1_RouteDefaults(ref common.ReferenceCallback) common.OpenAPIDefinition { |
||||
return common.OpenAPIDefinition{ |
||||
Schema: spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "RouteDefaults defines model for RouteDefaults.", |
||||
Type: []string{"object"}, |
||||
Properties: map[string]spec.Schema{ |
||||
"group_by": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"array"}, |
||||
Items: &spec.SchemaOrArray{ |
||||
Schema: &spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: "", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
"group_interval": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"group_wait": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"receiver": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: "", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"repeat_interval": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
}, |
||||
Required: []string{"receiver"}, |
||||
}, |
||||
}, |
||||
} |
||||
} |
||||
|
||||
func schema_apis_resource_routingtree_v0alpha1_RoutingTree(ref common.ReferenceCallback) common.OpenAPIDefinition { |
||||
return common.OpenAPIDefinition{ |
||||
Schema: spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"object"}, |
||||
Properties: map[string]spec.Schema{ |
||||
"kind": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"apiVersion": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"metadata": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: map[string]interface{}{}, |
||||
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), |
||||
}, |
||||
}, |
||||
"spec": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: map[string]interface{}{}, |
||||
Ref: ref("github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.Spec"), |
||||
}, |
||||
}, |
||||
"status": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: map[string]interface{}{}, |
||||
Ref: ref("github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.Status"), |
||||
}, |
||||
}, |
||||
}, |
||||
Required: []string{"metadata", "spec", "status"}, |
||||
}, |
||||
}, |
||||
Dependencies: []string{ |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.Spec", "github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.Status", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, |
||||
} |
||||
} |
||||
|
||||
func schema_apis_resource_routingtree_v0alpha1_RoutingTreeList(ref common.ReferenceCallback) common.OpenAPIDefinition { |
||||
return common.OpenAPIDefinition{ |
||||
Schema: spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"object"}, |
||||
Properties: map[string]spec.Schema{ |
||||
"kind": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"apiVersion": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"metadata": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: map[string]interface{}{}, |
||||
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), |
||||
}, |
||||
}, |
||||
"items": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"array"}, |
||||
Items: &spec.SchemaOrArray{ |
||||
Schema: &spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: map[string]interface{}{}, |
||||
Ref: ref("github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.RoutingTree"), |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
Required: []string{"metadata", "items"}, |
||||
}, |
||||
}, |
||||
Dependencies: []string{ |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.RoutingTree", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, |
||||
} |
||||
} |
||||
|
||||
func schema_apis_resource_routingtree_v0alpha1_Spec(ref common.ReferenceCallback) common.OpenAPIDefinition { |
||||
return common.OpenAPIDefinition{ |
||||
Schema: spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "Spec defines model for Spec.", |
||||
Type: []string{"object"}, |
||||
Properties: map[string]spec.Schema{ |
||||
"defaults": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: map[string]interface{}{}, |
||||
Ref: ref("github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.RouteDefaults"), |
||||
}, |
||||
}, |
||||
"routes": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"array"}, |
||||
Items: &spec.SchemaOrArray{ |
||||
Schema: &spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: map[string]interface{}{}, |
||||
Ref: ref("github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.Route"), |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
Required: []string{"defaults", "routes"}, |
||||
}, |
||||
}, |
||||
Dependencies: []string{ |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.Route", "github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.RouteDefaults"}, |
||||
} |
||||
} |
||||
|
||||
func schema_apis_resource_routingtree_v0alpha1_Status(ref common.ReferenceCallback) common.OpenAPIDefinition { |
||||
return common.OpenAPIDefinition{ |
||||
Schema: spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "Status defines model for Status.", |
||||
Type: []string{"object"}, |
||||
Properties: map[string]spec.Schema{ |
||||
"additionalFields": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "additionalFields is reserved for future use", |
||||
Type: []string{"object"}, |
||||
AdditionalProperties: &spec.SchemaOrBool{ |
||||
Allows: true, |
||||
Schema: &spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"object"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
"operatorStates": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "operatorStates is a map of operator ID to operator state evaluations. Any operator which consumes this kind SHOULD add its state evaluation information to this field.", |
||||
Type: []string{"object"}, |
||||
AdditionalProperties: &spec.SchemaOrBool{ |
||||
Allows: true, |
||||
Schema: &spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: map[string]interface{}{}, |
||||
Ref: ref("github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.StatusOperatorState"), |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
Dependencies: []string{ |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1.StatusOperatorState"}, |
||||
} |
||||
} |
||||
|
||||
func schema_apis_resource_routingtree_v0alpha1_StatusOperatorState(ref common.ReferenceCallback) common.OpenAPIDefinition { |
||||
return common.OpenAPIDefinition{ |
||||
Schema: spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "StatusOperatorState defines model for status.#OperatorState.", |
||||
Type: []string{"object"}, |
||||
Properties: map[string]spec.Schema{ |
||||
"descriptiveState": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "descriptiveState is an optional more descriptive state field which has no requirements on format", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"details": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "details contains any extra information that is operator-specific", |
||||
Type: []string{"object"}, |
||||
AdditionalProperties: &spec.SchemaOrBool{ |
||||
Allows: true, |
||||
Schema: &spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"object"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
"lastEvaluation": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "lastEvaluation is the ResourceVersion last evaluated", |
||||
Default: "", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"state": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "state describes the state of the lastEvaluation. It is limited to three possible states for machine evaluation.", |
||||
Default: "", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
}, |
||||
Required: []string{"lastEvaluation", "state"}, |
||||
}, |
||||
}, |
||||
} |
||||
} |
@ -1,32 +0,0 @@ |
||||
package v0alpha1 |
||||
|
||||
import ( |
||||
"time" |
||||
) |
||||
|
||||
// Metadata defines model for Metadata.
|
||||
type Metadata struct { |
||||
CreatedBy string `json:"createdBy"` |
||||
CreationTimestamp time.Time `json:"creationTimestamp"` |
||||
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"` |
||||
Finalizers []string `json:"finalizers"` |
||||
Generation int64 `json:"generation"` |
||||
Labels map[string]string `json:"labels"` |
||||
ResourceVersion string `json:"resourceVersion"` |
||||
Uid string `json:"uid"` |
||||
UpdateTimestamp time.Time `json:"updateTimestamp"` |
||||
UpdatedBy string `json:"updatedBy"` |
||||
} |
||||
|
||||
// _kubeObjectMetadata is metadata found in a kubernetes object's metadata field.
|
||||
// It is not exhaustive and only includes fields which may be relevant to a kind's implementation,
|
||||
// As it is also intended to be generic enough to function with any API Server.
|
||||
type KubeObjectMetadata struct { |
||||
CreationTimestamp time.Time `json:"creationTimestamp"` |
||||
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"` |
||||
Finalizers []string `json:"finalizers"` |
||||
Generation int64 `json:"generation"` |
||||
Labels map[string]string `json:"labels"` |
||||
ResourceVersion string `json:"resourceVersion"` |
||||
Uid string `json:"uid"` |
||||
} |
@ -1,8 +0,0 @@ |
||||
package v0alpha1 |
||||
|
||||
// Spec defines model for Spec.
|
||||
// +k8s:openapi-gen=true
|
||||
type Spec struct { |
||||
Content string `json:"content"` |
||||
Title string `json:"title"` |
||||
} |
@ -1,70 +0,0 @@ |
||||
package v0alpha1 |
||||
|
||||
// Defines values for OperatorStateState.
|
||||
const ( |
||||
OperatorStateStateFailed OperatorStateState = "failed" |
||||
OperatorStateStateInProgress OperatorStateState = "in_progress" |
||||
OperatorStateStateSuccess OperatorStateState = "success" |
||||
) |
||||
|
||||
// Defines values for StatusOperatorStateState.
|
||||
const ( |
||||
StatusOperatorStateStateFailed StatusOperatorStateState = "failed" |
||||
StatusOperatorStateStateInProgress StatusOperatorStateState = "in_progress" |
||||
StatusOperatorStateStateSuccess StatusOperatorStateState = "success" |
||||
) |
||||
|
||||
// OperatorState defines model for OperatorState.
|
||||
// +k8s:openapi-gen=true
|
||||
type OperatorState struct { |
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
DescriptiveState *string `json:"descriptiveState,omitempty"` |
||||
|
||||
// details contains any extra information that is operator-specific
|
||||
Details map[string]interface{} `json:"details,omitempty"` |
||||
|
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
LastEvaluation string `json:"lastEvaluation"` |
||||
|
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
State OperatorStateState `json:"state"` |
||||
} |
||||
|
||||
// OperatorStateState state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
// +k8s:openapi-gen=true
|
||||
type OperatorStateState string |
||||
|
||||
// Status defines model for Status.
|
||||
// +k8s:openapi-gen=true
|
||||
type Status struct { |
||||
// additionalFields is reserved for future use
|
||||
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"` |
||||
|
||||
// operatorStates is a map of operator ID to operator state evaluations.
|
||||
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
|
||||
OperatorStates map[string]StatusOperatorState `json:"operatorStates,omitempty"` |
||||
} |
||||
|
||||
// StatusOperatorState defines model for status.#OperatorState.
|
||||
// +k8s:openapi-gen=true
|
||||
type StatusOperatorState struct { |
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
DescriptiveState *string `json:"descriptiveState,omitempty"` |
||||
|
||||
// details contains any extra information that is operator-specific
|
||||
Details map[string]interface{} `json:"details,omitempty"` |
||||
|
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
LastEvaluation string `json:"lastEvaluation"` |
||||
|
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
State StatusOperatorStateState `json:"state"` |
||||
} |
||||
|
||||
// StatusOperatorStateState state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
// +k8s:openapi-gen=true
|
||||
type StatusOperatorStateState string |
@ -1,32 +0,0 @@ |
||||
package v0alpha1 |
||||
|
||||
import ( |
||||
"time" |
||||
) |
||||
|
||||
// Metadata defines model for Metadata.
|
||||
type Metadata struct { |
||||
CreatedBy string `json:"createdBy"` |
||||
CreationTimestamp time.Time `json:"creationTimestamp"` |
||||
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"` |
||||
Finalizers []string `json:"finalizers"` |
||||
Generation int64 `json:"generation"` |
||||
Labels map[string]string `json:"labels"` |
||||
ResourceVersion string `json:"resourceVersion"` |
||||
Uid string `json:"uid"` |
||||
UpdateTimestamp time.Time `json:"updateTimestamp"` |
||||
UpdatedBy string `json:"updatedBy"` |
||||
} |
||||
|
||||
// _kubeObjectMetadata is metadata found in a kubernetes object's metadata field.
|
||||
// It is not exhaustive and only includes fields which may be relevant to a kind's implementation,
|
||||
// As it is also intended to be generic enough to function with any API Server.
|
||||
type KubeObjectMetadata struct { |
||||
CreationTimestamp time.Time `json:"creationTimestamp"` |
||||
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"` |
||||
Finalizers []string `json:"finalizers"` |
||||
Generation int64 `json:"generation"` |
||||
Labels map[string]string `json:"labels"` |
||||
ResourceVersion string `json:"resourceVersion"` |
||||
Uid string `json:"uid"` |
||||
} |
@ -1,70 +0,0 @@ |
||||
package v0alpha1 |
||||
|
||||
// Defines values for OperatorStateState.
|
||||
const ( |
||||
OperatorStateStateFailed OperatorStateState = "failed" |
||||
OperatorStateStateInProgress OperatorStateState = "in_progress" |
||||
OperatorStateStateSuccess OperatorStateState = "success" |
||||
) |
||||
|
||||
// Defines values for StatusOperatorStateState.
|
||||
const ( |
||||
StatusOperatorStateStateFailed StatusOperatorStateState = "failed" |
||||
StatusOperatorStateStateInProgress StatusOperatorStateState = "in_progress" |
||||
StatusOperatorStateStateSuccess StatusOperatorStateState = "success" |
||||
) |
||||
|
||||
// OperatorState defines model for OperatorState.
|
||||
// +k8s:openapi-gen=true
|
||||
type OperatorState struct { |
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
DescriptiveState *string `json:"descriptiveState,omitempty"` |
||||
|
||||
// details contains any extra information that is operator-specific
|
||||
Details map[string]interface{} `json:"details,omitempty"` |
||||
|
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
LastEvaluation string `json:"lastEvaluation"` |
||||
|
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
State OperatorStateState `json:"state"` |
||||
} |
||||
|
||||
// OperatorStateState state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
// +k8s:openapi-gen=true
|
||||
type OperatorStateState string |
||||
|
||||
// Status defines model for Status.
|
||||
// +k8s:openapi-gen=true
|
||||
type Status struct { |
||||
// additionalFields is reserved for future use
|
||||
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"` |
||||
|
||||
// operatorStates is a map of operator ID to operator state evaluations.
|
||||
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
|
||||
OperatorStates map[string]StatusOperatorState `json:"operatorStates,omitempty"` |
||||
} |
||||
|
||||
// StatusOperatorState defines model for status.#OperatorState.
|
||||
// +k8s:openapi-gen=true
|
||||
type StatusOperatorState struct { |
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
DescriptiveState *string `json:"descriptiveState,omitempty"` |
||||
|
||||
// details contains any extra information that is operator-specific
|
||||
Details map[string]interface{} `json:"details,omitempty"` |
||||
|
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
LastEvaluation string `json:"lastEvaluation"` |
||||
|
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
State StatusOperatorStateState `json:"state"` |
||||
} |
||||
|
||||
// StatusOperatorStateState state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
// +k8s:openapi-gen=true
|
||||
type StatusOperatorStateState string |
@ -0,0 +1,18 @@ |
||||
package v0alpha1 |
||||
|
||||
import "k8s.io/apimachinery/pkg/runtime/schema" |
||||
|
||||
const ( |
||||
// Group is the API group used by all kinds in this package
|
||||
Group = "notifications.alerting.grafana.app" |
||||
// Version is the API version used by all kinds in this package
|
||||
Version = "v0alpha1" |
||||
) |
||||
|
||||
var ( |
||||
// GroupVersion is a schema.GroupVersion consisting of the Group and Version constants for this package
|
||||
GroupVersion = schema.GroupVersion{ |
||||
Group: Group, |
||||
Version: Version, |
||||
} |
||||
) |
@ -0,0 +1,28 @@ |
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1 |
||||
|
||||
import ( |
||||
time "time" |
||||
) |
||||
|
||||
// metadata contains embedded CommonMetadata and can be extended with custom string fields
|
||||
// TODO: use CommonMetadata instead of redefining here; currently needs to be defined here
|
||||
// without external reference as using the CommonMetadata reference breaks thema codegen.
|
||||
type Metadata struct { |
||||
UpdateTimestamp time.Time `json:"updateTimestamp"` |
||||
CreatedBy string `json:"createdBy"` |
||||
Uid string `json:"uid"` |
||||
CreationTimestamp time.Time `json:"creationTimestamp"` |
||||
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"` |
||||
Finalizers []string `json:"finalizers"` |
||||
ResourceVersion string `json:"resourceVersion"` |
||||
Generation int64 `json:"generation"` |
||||
UpdatedBy string `json:"updatedBy"` |
||||
Labels map[string]string `json:"labels"` |
||||
} |
||||
|
||||
// NewMetadata creates a new Metadata object.
|
||||
func NewMetadata() *Metadata { |
||||
return &Metadata{} |
||||
} |
@ -1,52 +1,70 @@ |
||||
package v0alpha1 |
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
// Defines values for MatcherType.
|
||||
const ( |
||||
MatcherTypeEmpty MatcherType = "!=" |
||||
MatcherTypeEqual MatcherType = "=" |
||||
MatcherTypeEqualTilde MatcherType = "=~" |
||||
MatcherTypeN1 MatcherType = "!~" |
||||
) |
||||
package v0alpha1 |
||||
|
||||
// Matcher defines model for Matcher.
|
||||
// +k8s:openapi-gen=true
|
||||
type Matcher struct { |
||||
Label string `json:"label"` |
||||
Type MatcherType `json:"type"` |
||||
Value string `json:"value"` |
||||
type RouteDefaults struct { |
||||
Receiver string `json:"receiver"` |
||||
GroupBy []string `json:"group_by,omitempty"` |
||||
GroupWait *string `json:"group_wait,omitempty"` |
||||
GroupInterval *string `json:"group_interval,omitempty"` |
||||
RepeatInterval *string `json:"repeat_interval,omitempty"` |
||||
} |
||||
|
||||
// MatcherType defines model for Matcher.Type.
|
||||
// +k8s:openapi-gen=true
|
||||
type MatcherType string |
||||
// NewRouteDefaults creates a new RouteDefaults object.
|
||||
func NewRouteDefaults() *RouteDefaults { |
||||
return &RouteDefaults{} |
||||
} |
||||
|
||||
// Route defines model for Route.
|
||||
// +k8s:openapi-gen=true
|
||||
type Route struct { |
||||
Receiver *string `json:"receiver,omitempty"` |
||||
Matchers []Matcher `json:"matchers,omitempty"` |
||||
Continue bool `json:"continue"` |
||||
GroupBy []string `json:"group_by,omitempty"` |
||||
GroupInterval *string `json:"group_interval,omitempty"` |
||||
GroupWait *string `json:"group_wait,omitempty"` |
||||
Matchers []Matcher `json:"matchers,omitempty"` |
||||
MuteTimeIntervals []string `json:"mute_time_intervals,omitempty"` |
||||
Receiver *string `json:"receiver,omitempty"` |
||||
RepeatInterval *string `json:"repeat_interval,omitempty"` |
||||
Routes []Route `json:"routes,omitempty"` |
||||
GroupWait *string `json:"group_wait,omitempty"` |
||||
GroupInterval *string `json:"group_interval,omitempty"` |
||||
RepeatInterval *string `json:"repeat_interval,omitempty"` |
||||
} |
||||
|
||||
// NewRoute creates a new Route object.
|
||||
func NewRoute() *Route { |
||||
return &Route{} |
||||
} |
||||
|
||||
// RouteDefaults defines model for RouteDefaults.
|
||||
// +k8s:openapi-gen=true
|
||||
type RouteDefaults struct { |
||||
GroupBy []string `json:"group_by,omitempty"` |
||||
GroupInterval *string `json:"group_interval,omitempty"` |
||||
GroupWait *string `json:"group_wait,omitempty"` |
||||
Receiver string `json:"receiver"` |
||||
RepeatInterval *string `json:"repeat_interval,omitempty"` |
||||
type Matcher struct { |
||||
Type MatcherType `json:"type"` |
||||
Label string `json:"label"` |
||||
Value string `json:"value"` |
||||
} |
||||
|
||||
// NewMatcher creates a new Matcher object.
|
||||
func NewMatcher() *Matcher { |
||||
return &Matcher{} |
||||
} |
||||
|
||||
// Spec defines model for Spec.
|
||||
// +k8s:openapi-gen=true
|
||||
type Spec struct { |
||||
Defaults RouteDefaults `json:"defaults"` |
||||
Routes []Route `json:"routes"` |
||||
} |
||||
|
||||
// NewSpec creates a new Spec object.
|
||||
func NewSpec() *Spec { |
||||
return &Spec{ |
||||
Defaults: *NewRouteDefaults(), |
||||
} |
||||
} |
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MatcherType string |
||||
|
||||
const ( |
||||
MatcherTypeEqual MatcherType = "=" |
||||
MatcherTypeNotEqual MatcherType = "!=" |
||||
MatcherTypeEqualRegex MatcherType = "=~" |
||||
MatcherTypeNotEqualRegex MatcherType = "!~" |
||||
) |
@ -0,0 +1,44 @@ |
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1 |
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type StatusOperatorState struct { |
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
LastEvaluation string `json:"lastEvaluation"` |
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
State StatusOperatorStateState `json:"state"` |
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
DescriptiveState *string `json:"descriptiveState,omitempty"` |
||||
// details contains any extra information that is operator-specific
|
||||
Details map[string]interface{} `json:"details,omitempty"` |
||||
} |
||||
|
||||
// NewStatusOperatorState creates a new StatusOperatorState object.
|
||||
func NewStatusOperatorState() *StatusOperatorState { |
||||
return &StatusOperatorState{} |
||||
} |
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type Status struct { |
||||
// operatorStates is a map of operator ID to operator state evaluations.
|
||||
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
|
||||
OperatorStates map[string]StatusOperatorState `json:"operatorStates,omitempty"` |
||||
// additionalFields is reserved for future use
|
||||
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"` |
||||
} |
||||
|
||||
// NewStatus creates a new Status object.
|
||||
func NewStatus() *Status { |
||||
return &Status{} |
||||
} |
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type StatusOperatorStateState string |
||||
|
||||
const ( |
||||
StatusOperatorStateStateSuccess StatusOperatorStateState = "success" |
||||
StatusOperatorStateStateInProgress StatusOperatorStateState = "in_progress" |
||||
StatusOperatorStateStateFailed StatusOperatorStateState = "failed" |
||||
) |
@ -0,0 +1,15 @@ |
||||
API rule violation: list_type_missing,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/routingtree/v0alpha1,Route,GroupBy |
||||
API rule violation: list_type_missing,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/routingtree/v0alpha1,Route,Matchers |
||||
API rule violation: list_type_missing,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/routingtree/v0alpha1,Route,MuteTimeIntervals |
||||
API rule violation: list_type_missing,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/routingtree/v0alpha1,Route,Routes |
||||
API rule violation: list_type_missing,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/routingtree/v0alpha1,RouteDefaults,GroupBy |
||||
API rule violation: list_type_missing,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/routingtree/v0alpha1,Spec,Routes |
||||
API rule violation: names_match,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/routingtree/v0alpha1,Route,GroupBy |
||||
API rule violation: names_match,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/routingtree/v0alpha1,Route,GroupInterval |
||||
API rule violation: names_match,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/routingtree/v0alpha1,Route,GroupWait |
||||
API rule violation: names_match,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/routingtree/v0alpha1,Route,MuteTimeIntervals |
||||
API rule violation: names_match,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/routingtree/v0alpha1,Route,RepeatInterval |
||||
API rule violation: names_match,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/routingtree/v0alpha1,RouteDefaults,GroupBy |
||||
API rule violation: names_match,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/routingtree/v0alpha1,RouteDefaults,GroupInterval |
||||
API rule violation: names_match,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/routingtree/v0alpha1,RouteDefaults,GroupWait |
||||
API rule violation: names_match,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/routingtree/v0alpha1,RouteDefaults,RepeatInterval |
@ -0,0 +1,18 @@ |
||||
package v0alpha1 |
||||
|
||||
import "k8s.io/apimachinery/pkg/runtime/schema" |
||||
|
||||
const ( |
||||
// Group is the API group used by all kinds in this package
|
||||
Group = "notifications.alerting.grafana.app" |
||||
// Version is the API version used by all kinds in this package
|
||||
Version = "v0alpha1" |
||||
) |
||||
|
||||
var ( |
||||
// GroupVersion is a schema.GroupVersion consisting of the Group and Version constants for this package
|
||||
GroupVersion = schema.GroupVersion{ |
||||
Group: Group, |
||||
Version: Version, |
||||
} |
||||
) |
@ -0,0 +1,28 @@ |
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1 |
||||
|
||||
import ( |
||||
time "time" |
||||
) |
||||
|
||||
// metadata contains embedded CommonMetadata and can be extended with custom string fields
|
||||
// TODO: use CommonMetadata instead of redefining here; currently needs to be defined here
|
||||
// without external reference as using the CommonMetadata reference breaks thema codegen.
|
||||
type Metadata struct { |
||||
UpdateTimestamp time.Time `json:"updateTimestamp"` |
||||
CreatedBy string `json:"createdBy"` |
||||
Uid string `json:"uid"` |
||||
CreationTimestamp time.Time `json:"creationTimestamp"` |
||||
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"` |
||||
Finalizers []string `json:"finalizers"` |
||||
ResourceVersion string `json:"resourceVersion"` |
||||
Generation int64 `json:"generation"` |
||||
UpdatedBy string `json:"updatedBy"` |
||||
Labels map[string]string `json:"labels"` |
||||
} |
||||
|
||||
// NewMetadata creates a new Metadata object.
|
||||
func NewMetadata() *Metadata { |
||||
return &Metadata{} |
||||
} |
@ -0,0 +1,14 @@ |
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1 |
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type Spec struct { |
||||
Title string `json:"title"` |
||||
Content string `json:"content"` |
||||
} |
||||
|
||||
// NewSpec creates a new Spec object.
|
||||
func NewSpec() *Spec { |
||||
return &Spec{} |
||||
} |
@ -0,0 +1,44 @@ |
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1 |
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type StatusOperatorState struct { |
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
LastEvaluation string `json:"lastEvaluation"` |
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
State StatusOperatorStateState `json:"state"` |
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
DescriptiveState *string `json:"descriptiveState,omitempty"` |
||||
// details contains any extra information that is operator-specific
|
||||
Details map[string]interface{} `json:"details,omitempty"` |
||||
} |
||||
|
||||
// NewStatusOperatorState creates a new StatusOperatorState object.
|
||||
func NewStatusOperatorState() *StatusOperatorState { |
||||
return &StatusOperatorState{} |
||||
} |
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type Status struct { |
||||
// operatorStates is a map of operator ID to operator state evaluations.
|
||||
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
|
||||
OperatorStates map[string]StatusOperatorState `json:"operatorStates,omitempty"` |
||||
// additionalFields is reserved for future use
|
||||
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"` |
||||
} |
||||
|
||||
// NewStatus creates a new Status object.
|
||||
func NewStatus() *Status { |
||||
return &Status{} |
||||
} |
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type StatusOperatorStateState string |
||||
|
||||
const ( |
||||
StatusOperatorStateStateSuccess StatusOperatorStateState = "success" |
||||
StatusOperatorStateStateInProgress StatusOperatorStateState = "in_progress" |
||||
StatusOperatorStateStateFailed StatusOperatorStateState = "failed" |
||||
) |
@ -0,0 +1,241 @@ |
||||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
// Code generated by openapi-gen. DO NOT EDIT.
|
||||
|
||||
package v0alpha1 |
||||
|
||||
import ( |
||||
common "k8s.io/kube-openapi/pkg/common" |
||||
spec "k8s.io/kube-openapi/pkg/validation/spec" |
||||
) |
||||
|
||||
func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { |
||||
return map[string]common.OpenAPIDefinition{ |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/templategroup/v0alpha1.Spec": schema_pkg_apis_templategroup_v0alpha1_Spec(ref), |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/templategroup/v0alpha1.Status": schema_pkg_apis_templategroup_v0alpha1_Status(ref), |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/templategroup/v0alpha1.StatusOperatorState": schema_pkg_apis_templategroup_v0alpha1_StatusOperatorState(ref), |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/templategroup/v0alpha1.TemplateGroup": schema_pkg_apis_templategroup_v0alpha1_TemplateGroup(ref), |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/templategroup/v0alpha1.TemplateGroupList": schema_pkg_apis_templategroup_v0alpha1_TemplateGroupList(ref), |
||||
} |
||||
} |
||||
|
||||
func schema_pkg_apis_templategroup_v0alpha1_Spec(ref common.ReferenceCallback) common.OpenAPIDefinition { |
||||
return common.OpenAPIDefinition{ |
||||
Schema: spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"object"}, |
||||
Properties: map[string]spec.Schema{ |
||||
"title": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: "", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"content": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: "", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
}, |
||||
Required: []string{"title", "content"}, |
||||
}, |
||||
}, |
||||
} |
||||
} |
||||
|
||||
func schema_pkg_apis_templategroup_v0alpha1_Status(ref common.ReferenceCallback) common.OpenAPIDefinition { |
||||
return common.OpenAPIDefinition{ |
||||
Schema: spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"object"}, |
||||
Properties: map[string]spec.Schema{ |
||||
"operatorStates": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "operatorStates is a map of operator ID to operator state evaluations. Any operator which consumes this kind SHOULD add its state evaluation information to this field.", |
||||
Type: []string{"object"}, |
||||
AdditionalProperties: &spec.SchemaOrBool{ |
||||
Allows: true, |
||||
Schema: &spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: map[string]interface{}{}, |
||||
Ref: ref("github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/templategroup/v0alpha1.StatusOperatorState"), |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
"additionalFields": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "additionalFields is reserved for future use", |
||||
Type: []string{"object"}, |
||||
AdditionalProperties: &spec.SchemaOrBool{ |
||||
Allows: true, |
||||
Schema: &spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"object"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
Dependencies: []string{ |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/templategroup/v0alpha1.StatusOperatorState"}, |
||||
} |
||||
} |
||||
|
||||
func schema_pkg_apis_templategroup_v0alpha1_StatusOperatorState(ref common.ReferenceCallback) common.OpenAPIDefinition { |
||||
return common.OpenAPIDefinition{ |
||||
Schema: spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"object"}, |
||||
Properties: map[string]spec.Schema{ |
||||
"lastEvaluation": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "lastEvaluation is the ResourceVersion last evaluated", |
||||
Default: "", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"state": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "state describes the state of the lastEvaluation. It is limited to three possible states for machine evaluation.", |
||||
Default: "", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"descriptiveState": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "descriptiveState is an optional more descriptive state field which has no requirements on format", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"details": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "details contains any extra information that is operator-specific", |
||||
Type: []string{"object"}, |
||||
AdditionalProperties: &spec.SchemaOrBool{ |
||||
Allows: true, |
||||
Schema: &spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"object"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
Required: []string{"lastEvaluation", "state"}, |
||||
}, |
||||
}, |
||||
} |
||||
} |
||||
|
||||
func schema_pkg_apis_templategroup_v0alpha1_TemplateGroup(ref common.ReferenceCallback) common.OpenAPIDefinition { |
||||
return common.OpenAPIDefinition{ |
||||
Schema: spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"object"}, |
||||
Properties: map[string]spec.Schema{ |
||||
"kind": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"apiVersion": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"metadata": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: map[string]interface{}{}, |
||||
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), |
||||
}, |
||||
}, |
||||
"spec": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "Spec is the spec of the TemplateGroup", |
||||
Default: map[string]interface{}{}, |
||||
Ref: ref("github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/templategroup/v0alpha1.Spec"), |
||||
}, |
||||
}, |
||||
"status": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: map[string]interface{}{}, |
||||
Ref: ref("github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/templategroup/v0alpha1.Status"), |
||||
}, |
||||
}, |
||||
}, |
||||
Required: []string{"metadata", "spec", "status"}, |
||||
}, |
||||
}, |
||||
Dependencies: []string{ |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/templategroup/v0alpha1.Spec", "github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/templategroup/v0alpha1.Status", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, |
||||
} |
||||
} |
||||
|
||||
func schema_pkg_apis_templategroup_v0alpha1_TemplateGroupList(ref common.ReferenceCallback) common.OpenAPIDefinition { |
||||
return common.OpenAPIDefinition{ |
||||
Schema: spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"object"}, |
||||
Properties: map[string]spec.Schema{ |
||||
"kind": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"apiVersion": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", |
||||
Type: []string{"string"}, |
||||
Format: "", |
||||
}, |
||||
}, |
||||
"metadata": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: map[string]interface{}{}, |
||||
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), |
||||
}, |
||||
}, |
||||
"items": { |
||||
SchemaProps: spec.SchemaProps{ |
||||
Type: []string{"array"}, |
||||
Items: &spec.SchemaOrArray{ |
||||
Schema: &spec.Schema{ |
||||
SchemaProps: spec.SchemaProps{ |
||||
Default: map[string]interface{}{}, |
||||
Ref: ref("github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/templategroup/v0alpha1.TemplateGroup"), |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
Required: []string{"metadata", "items"}, |
||||
}, |
||||
}, |
||||
Dependencies: []string{ |
||||
"github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/templategroup/v0alpha1.TemplateGroup", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, |
||||
} |
||||
} |
@ -0,0 +1,18 @@ |
||||
package v0alpha1 |
||||
|
||||
import "k8s.io/apimachinery/pkg/runtime/schema" |
||||
|
||||
const ( |
||||
// Group is the API group used by all kinds in this package
|
||||
Group = "notifications.alerting.grafana.app" |
||||
// Version is the API version used by all kinds in this package
|
||||
Version = "v0alpha1" |
||||
) |
||||
|
||||
var ( |
||||
// GroupVersion is a schema.GroupVersion consisting of the Group and Version constants for this package
|
||||
GroupVersion = schema.GroupVersion{ |
||||
Group: Group, |
||||
Version: Version, |
||||
} |
||||
) |
@ -0,0 +1,28 @@ |
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1 |
||||
|
||||
import ( |
||||
time "time" |
||||
) |
||||
|
||||
// metadata contains embedded CommonMetadata and can be extended with custom string fields
|
||||
// TODO: use CommonMetadata instead of redefining here; currently needs to be defined here
|
||||
// without external reference as using the CommonMetadata reference breaks thema codegen.
|
||||
type Metadata struct { |
||||
UpdateTimestamp time.Time `json:"updateTimestamp"` |
||||
CreatedBy string `json:"createdBy"` |
||||
Uid string `json:"uid"` |
||||
CreationTimestamp time.Time `json:"creationTimestamp"` |
||||
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"` |
||||
Finalizers []string `json:"finalizers"` |
||||
ResourceVersion string `json:"resourceVersion"` |
||||
Generation int64 `json:"generation"` |
||||
UpdatedBy string `json:"updatedBy"` |
||||
Labels map[string]string `json:"labels"` |
||||
} |
||||
|
||||
// NewMetadata creates a new Metadata object.
|
||||
func NewMetadata() *Metadata { |
||||
return &Metadata{} |
||||
} |
@ -1,26 +1,40 @@ |
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1 |
||||
|
||||
// Interval defines model for Interval.
|
||||
// +k8s:openapi-gen=true
|
||||
type Interval struct { |
||||
DaysOfMonth []string `json:"days_of_month,omitempty"` |
||||
Location *string `json:"location,omitempty"` |
||||
Months []string `json:"months,omitempty"` |
||||
Times []TimeRange `json:"times,omitempty"` |
||||
Weekdays []string `json:"weekdays,omitempty"` |
||||
DaysOfMonth []string `json:"days_of_month,omitempty"` |
||||
Months []string `json:"months,omitempty"` |
||||
Years []string `json:"years,omitempty"` |
||||
Location *string `json:"location,omitempty"` |
||||
} |
||||
|
||||
// NewInterval creates a new Interval object.
|
||||
func NewInterval() *Interval { |
||||
return &Interval{} |
||||
} |
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type TimeRange struct { |
||||
StartTime string `json:"start_time"` |
||||
EndTime string `json:"end_time"` |
||||
} |
||||
|
||||
// NewTimeRange creates a new TimeRange object.
|
||||
func NewTimeRange() *TimeRange { |
||||
return &TimeRange{} |
||||
} |
||||
|
||||
// Spec defines model for Spec.
|
||||
// +k8s:openapi-gen=true
|
||||
type Spec struct { |
||||
Name string `json:"name"` |
||||
TimeIntervals []Interval `json:"time_intervals"` |
||||
} |
||||
|
||||
// TimeRange defines model for TimeRange.
|
||||
// +k8s:openapi-gen=true
|
||||
type TimeRange struct { |
||||
EndTime string `json:"end_time"` |
||||
StartTime string `json:"start_time"` |
||||
// NewSpec creates a new Spec object.
|
||||
func NewSpec() *Spec { |
||||
return &Spec{} |
||||
} |
@ -0,0 +1,44 @@ |
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1 |
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type StatusOperatorState struct { |
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
LastEvaluation string `json:"lastEvaluation"` |
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
State StatusOperatorStateState `json:"state"` |
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
DescriptiveState *string `json:"descriptiveState,omitempty"` |
||||
// details contains any extra information that is operator-specific
|
||||
Details map[string]interface{} `json:"details,omitempty"` |
||||
} |
||||
|
||||
// NewStatusOperatorState creates a new StatusOperatorState object.
|
||||
func NewStatusOperatorState() *StatusOperatorState { |
||||
return &StatusOperatorState{} |
||||
} |
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type Status struct { |
||||
// operatorStates is a map of operator ID to operator state evaluations.
|
||||
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
|
||||
OperatorStates map[string]StatusOperatorState `json:"operatorStates,omitempty"` |
||||
// additionalFields is reserved for future use
|
||||
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"` |
||||
} |
||||
|
||||
// NewStatus creates a new Status object.
|
||||
func NewStatus() *Status { |
||||
return &Status{} |
||||
} |
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type StatusOperatorStateState string |
||||
|
||||
const ( |
||||
StatusOperatorStateStateSuccess StatusOperatorStateState = "success" |
||||
StatusOperatorStateStateInProgress StatusOperatorStateState = "in_progress" |
||||
StatusOperatorStateStateFailed StatusOperatorStateState = "failed" |
||||
) |
@ -0,0 +1,10 @@ |
||||
API rule violation: list_type_missing,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/timeinterval/v0alpha1,Interval,DaysOfMonth |
||||
API rule violation: list_type_missing,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/timeinterval/v0alpha1,Interval,Months |
||||
API rule violation: list_type_missing,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/timeinterval/v0alpha1,Interval,Times |
||||
API rule violation: list_type_missing,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/timeinterval/v0alpha1,Interval,Weekdays |
||||
API rule violation: list_type_missing,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/timeinterval/v0alpha1,Interval,Years |
||||
API rule violation: list_type_missing,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/timeinterval/v0alpha1,Spec,TimeIntervals |
||||
API rule violation: names_match,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/timeinterval/v0alpha1,Interval,DaysOfMonth |
||||
API rule violation: names_match,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/timeinterval/v0alpha1,Spec,TimeIntervals |
||||
API rule violation: names_match,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/timeinterval/v0alpha1,TimeRange,EndTime |
||||
API rule violation: names_match,github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/timeinterval/v0alpha1,TimeRange,StartTime |
@ -1,4 +1,4 @@ |
||||
package resource |
||||
package apis |
||||
|
||||
import "k8s.io/apimachinery/pkg/runtime/schema" |
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue