Modifications for supporting migration
This commit is contained in:
@@ -304,5 +304,7 @@ func (r *ApiReceiver) Type() ReceiverType {
|
||||
}
|
||||
|
||||
type GrafanaReceivers struct {
|
||||
// required: true
|
||||
DefaultReceiver *GrafanaReceiver `yaml:"default_receiver" json:"default_receiver"`
|
||||
GrafanaManagedReceivers []*GrafanaReceiver `yaml:"grafana_managed_receiver_configs,omitempty" json:"grafana_managed_receiver_configs,omitempty"`
|
||||
}
|
||||
|
||||
@@ -157,6 +157,8 @@ type ExtendedUpsertAlertDefinitionCommand struct {
|
||||
NoDataState NoDataState `json:"no_data_state" yaml:"no_data_state"`
|
||||
ExecutionErrorState ExecutionErrorState `json:"exec_err_state" yaml:"exec_err_state"`
|
||||
Settings map[string]interface{} `json:"settings" yaml:"settings"`
|
||||
// Receivers are optional and used for migrating notification channels of existing alerts
|
||||
Receivers []*GrafanaReceiver `json:"receivers" yaml:"receivers"`
|
||||
// internal state
|
||||
FolderUID string `json:"-" yaml:"-"`
|
||||
DatasourceUIDs []string `json:"-" yaml:"-"`
|
||||
|
||||
@@ -1057,7 +1057,13 @@
|
||||
},
|
||||
"ApiReceiver": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"default_receiver"
|
||||
],
|
||||
"properties": {
|
||||
"default_receiver": {
|
||||
"$ref": "#/definitions/GrafanaReceiver"
|
||||
},
|
||||
"email_configs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@@ -1500,6 +1506,14 @@
|
||||
],
|
||||
"x-go-name": "NoDataState"
|
||||
},
|
||||
"receivers": {
|
||||
"description": "Receivers are optional and used for migrating notification channels of existing alerts",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/GrafanaReceiver"
|
||||
},
|
||||
"x-go-name": "Receivers"
|
||||
},
|
||||
"settings": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
@@ -1610,7 +1624,13 @@
|
||||
},
|
||||
"GrafanaReceivers": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"default_receiver"
|
||||
],
|
||||
"properties": {
|
||||
"default_receiver": {
|
||||
"$ref": "#/definitions/GrafanaReceiver"
|
||||
},
|
||||
"grafana_managed_receiver_configs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
||||
Reference in New Issue
Block a user