Browse Source

docs: updates docs to refer to using uid

bergquist 7 năm trước cách đây
mục cha
commit
e218cc7637

+ 3 - 3
docs/sources/administration/provisioning.md

@@ -234,15 +234,15 @@ By default Grafana will delete dashboards in the database if the file is removed
 
 
 ## Alert Notification Channels
 ## Alert Notification Channels
 
 
-Alert Notification Channels can be provisionned by adding one or more yaml config files in the [`provisioning/notifiers`](/installation/configuration/#provisioning) directory.
+Alert Notification Channels can be provisioned by adding one or more yaml config files in the [`provisioning/notifiers`](/installation/configuration/#provisioning) directory.
 
 
 Each config file can contain the following top-level fields:
 Each config file can contain the following top-level fields:
 - `notifiers`, a list of alert notifications that will be added or updated during start up. If the notification channel already exists, Grafana will update it to match the configuration file.
 - `notifiers`, a list of alert notifications that will be added or updated during start up. If the notification channel already exists, Grafana will update it to match the configuration file.
 - `delete_notifiers`, a list of alert notifications to be deleted before before inserting/updating those in the `notifiers` list.
 - `delete_notifiers`, a list of alert notifications to be deleted before before inserting/updating those in the `notifiers` list.
 
 
-Provisionning looks up alert notifications by name, and will update any existing notification with the provided name.
+Provisioning looks up alert notifications by uid, and will update any existing notification with the provided uid.
 
 
-By default, exporting a dashboard as JSON will use a sequential identifier to refer to alert notifications. The field `name` can be optionally specified to specify a string identifier for the alert name.
+By default, exporting a dashboard as JSON will use a sequential identifier to refer to alert notifications. The field `uid` can be optionally specified to specify a string identifier for the alert name.
 
 
 ```json
 ```json
 {
 {

+ 2 - 0
pkg/services/sqlstore/alert_notification.go

@@ -281,10 +281,12 @@ func generateNewAlertNotificationUid(sess *DBSession, orgId int64) (string, erro
 		if err != nil {
 		if err != nil {
 			return "", err
 			return "", err
 		}
 		}
+
 		if !exists {
 		if !exists {
 			return uid, nil
 			return uid, nil
 		}
 		}
 	}
 	}
+
 	return "", m.ErrAlertNotificationFailedGenerateUniqueUid
 	return "", m.ErrAlertNotificationFailedGenerateUniqueUid
 }
 }
 
 

+ 3 - 0
pkg/services/sqlstore/migrations/alert_mig.go

@@ -141,13 +141,16 @@ func addAlertMigrations(mg *Migrator) {
 	mg.AddMigration("Add column uid in alert_notification", NewAddColumnMigration(alert_notification, &Column{
 	mg.AddMigration("Add column uid in alert_notification", NewAddColumnMigration(alert_notification, &Column{
 		Name: "uid", Type: DB_NVarchar, Length: 40, Nullable: true,
 		Name: "uid", Type: DB_NVarchar, Length: 40, Nullable: true,
 	}))
 	}))
+
 	mg.AddMigration("Update uid column values in alert_notification", new(RawSqlMigration).
 	mg.AddMigration("Update uid column values in alert_notification", new(RawSqlMigration).
 		Sqlite("UPDATE alert_notification SET uid=printf('%09d',id) WHERE uid IS NULL;").
 		Sqlite("UPDATE alert_notification SET uid=printf('%09d',id) WHERE uid IS NULL;").
 		Postgres("UPDATE alert_notification SET uid=lpad('' || id,9,'0') WHERE uid IS NULL;").
 		Postgres("UPDATE alert_notification SET uid=lpad('' || id,9,'0') WHERE uid IS NULL;").
 		Mysql("UPDATE alert_notification SET uid=lpad(id,9,'0') WHERE uid IS NULL;"))
 		Mysql("UPDATE alert_notification SET uid=lpad(id,9,'0') WHERE uid IS NULL;"))
+
 	mg.AddMigration("Add unique index alert_notification_org_id_uid", NewAddIndexMigration(alert_notification, &Index{
 	mg.AddMigration("Add unique index alert_notification_org_id_uid", NewAddIndexMigration(alert_notification, &Index{
 		Cols: []string{"org_id", "uid"}, Type: UniqueIndex,
 		Cols: []string{"org_id", "uid"}, Type: UniqueIndex,
 	}))
 	}))
+
 	mg.AddMigration("Remove unique index org_id_name", NewDropIndexMigration(alert_notification, &Index{
 	mg.AddMigration("Remove unique index org_id_name", NewDropIndexMigration(alert_notification, &Index{
 		Cols: []string{"org_id", "name"}, Type: UniqueIndex,
 		Cols: []string{"org_id", "name"}, Type: UniqueIndex,
 	}))
 	}))