Documentation ¶
Index ¶
- Constants
- func AddAlertAdminConfigMigrations(mg *migrator.Migrator)
- func AddAlertDefinitionMigrations(mg *migrator.Migrator, defaultIntervalSeconds int64)
- func AddAlertDefinitionVersionMigrations(mg *migrator.Migrator)
- func AddAlertRuleMigrations(mg *migrator.Migrator, defaultIntervalSeconds int64)
- func AddAlertRuleVersionMigrations(mg *migrator.Migrator)
- func AddAlertmanagerConfigMigrations(mg *migrator.Migrator)
- func AddDashAlertMigration(mg *migrator.Migrator)
- func AddDashboardUIDPanelIDMigration(mg *migrator.Migrator)
- func AddTablesMigrations(mg *migrator.Migrator)
- func AlertInstanceMigration(mg *migrator.Migrator)
- func RerunDashAlertMigration(mg *migrator.Migrator)
- type AlertConfiguration
- type CreateAlertNotificationCommand
- type Matchers
- type MigrationError
- type PostableApiAlertingConfig
- type PostableApiReceiver
- type PostableGrafanaReceiver
- type PostableUserConfig
- type Route
- type SecureJsonData
Constants ¶
const ( ROLE_VIEWER roleType = "Viewer" ROLE_EDITOR roleType = "Editor" ROLE_ADMIN roleType = "Admin" )
const DASHBOARD_FOLDER = "Migrated %s"
const FOLDER_CREATED_BY = -8
FOLDER_CREATED_BY us used to track folders created by this migration during alert migration cleanup.
const GENERAL_FOLDER = "General Alerting"
const KV_NAMESPACE = "alertmanager"
const (
// Should be the same as 'NoDataAlertName' in pkg/services/schedule/compat.go.
NoDataAlertName = "DatasourceNoData"
)
Variables ¶
This section is empty.
Functions ¶
func AddAlertDefinitionMigrations ¶
AddAlertDefinitionMigrations should not be modified.
func AddAlertDefinitionVersionMigrations ¶
AddAlertDefinitionMigrations should not be modified.
func AddAlertRuleMigrations ¶
func AddDashAlertMigration ¶
func AddTablesMigrations ¶
AddMigration defines database migrations.
func AlertInstanceMigration ¶
func RerunDashAlertMigration ¶
RerunDashAlertMigration force the dashboard alert migration to run to make sure that the Alertmanager configurations will be created for each organisation
Types ¶
type AlertConfiguration ¶
type Matchers ¶
func (Matchers) MarshalJSON ¶
type MigrationError ¶
func (MigrationError) Error ¶
func (e MigrationError) Error() string
func (*MigrationError) Unwrap ¶
func (e *MigrationError) Unwrap() error
type PostableApiAlertingConfig ¶
type PostableApiAlertingConfig struct { Route *Route `yaml:"route,omitempty" json:"route,omitempty"` Templates []string `yaml:"templates" json:"templates"` Receivers []*PostableApiReceiver `yaml:"receivers,omitempty" json:"receivers,omitempty"` }
type PostableApiReceiver ¶
type PostableApiReceiver struct { Name string `yaml:"name" json:"name"` GrafanaManagedReceivers []*PostableGrafanaReceiver `yaml:"grafana_managed_receiver_configs,omitempty" json:"grafana_managed_receiver_configs,omitempty"` }
type PostableGrafanaReceiver ¶
type PostableGrafanaReceiver CreateAlertNotificationCommand
type PostableUserConfig ¶
type PostableUserConfig struct { TemplateFiles map[string]string `yaml:"template_files" json:"template_files"` AlertmanagerConfig PostableApiAlertingConfig `yaml:"alertmanager_config" json:"alertmanager_config"` }
func (*PostableUserConfig) EncryptSecureSettings ¶
func (c *PostableUserConfig) EncryptSecureSettings() error
type SecureJsonData ¶
SecureJsonData is used to store encrypted data (for example in data_source table). Only values are separately encrypted.
func GetEncryptedJsonData ¶
func GetEncryptedJsonData(sjd map[string]string) SecureJsonData
GetEncryptedJsonData returns map where all keys are encrypted.
func (SecureJsonData) Decrypt ¶
func (s SecureJsonData) Decrypt() map[string]string
Decrypt returns map of the same type but where the all the values are decrypted. Opposite of what GetEncryptedJsonData is doing.
func (SecureJsonData) DecryptedValue ¶
func (s SecureJsonData) DecryptedValue(key string) (string, bool)
DecryptedValue returns single decrypted value from SecureJsonData. Similar to normal map access second return value is true if the key exists and false if not.