2021-03-17 10:06:10 -05:00
|
|
|
package dashboards
|
|
|
|
|
2021-09-23 10:43:32 -05:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/models"
|
|
|
|
)
|
2021-03-17 10:06:10 -05:00
|
|
|
|
|
|
|
// Store is a dashboard store.
|
|
|
|
type Store interface {
|
|
|
|
// ValidateDashboardBeforeSave validates a dashboard before save.
|
|
|
|
ValidateDashboardBeforeSave(dashboard *models.Dashboard, overwrite bool) (bool, error)
|
2021-04-14 04:02:50 -05:00
|
|
|
// GetFolderByTitle retrieves a dashboard by its title and is used by unified alerting
|
|
|
|
GetFolderByTitle(orgID int64, title string) (*models.Dashboard, error)
|
2021-03-17 10:06:10 -05:00
|
|
|
GetProvisionedDataByDashboardID(dashboardID int64) (*models.DashboardProvisioning, error)
|
2021-12-17 09:31:52 -06:00
|
|
|
GetProvisionedDataByDashboardUID(orgID int64, dashboardUID string) (*models.DashboardProvisioning, error)
|
2021-03-17 10:06:10 -05:00
|
|
|
GetProvisionedDashboardData(name string) ([]*models.DashboardProvisioning, error)
|
|
|
|
SaveProvisionedDashboard(cmd models.SaveDashboardCommand, provisioning *models.DashboardProvisioning) (*models.Dashboard, error)
|
|
|
|
SaveDashboard(cmd models.SaveDashboardCommand) (*models.Dashboard, error)
|
2021-09-23 10:43:32 -05:00
|
|
|
UpdateDashboardACLCtx(ctx context.Context, uid int64, items []*models.DashboardAcl) error
|
2021-03-17 10:06:10 -05:00
|
|
|
// SaveAlerts saves dashboard alerts.
|
2021-11-03 08:10:39 -05:00
|
|
|
SaveAlerts(ctx context.Context, dashID int64, alerts []*models.Alert) error
|
2021-03-17 10:06:10 -05:00
|
|
|
}
|