2022-06-28 00:23:15 +08:00
|
|
|
package datasources
|
|
|
|
|
|
2023-07-17 22:27:19 +08:00
|
|
|
import (
|
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/util/errutil"
|
|
|
|
|
)
|
2022-06-28 00:23:15 +08:00
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
ErrDataSourceNotFound = errors.New("data source not found")
|
|
|
|
|
ErrDataSourceNameExists = errors.New("data source with the same name already exists")
|
|
|
|
|
ErrDataSourceUidExists = errors.New("data source with the same uid already exists")
|
|
|
|
|
ErrDataSourceUpdatingOldVersion = errors.New("trying to update old version of datasource")
|
|
|
|
|
ErrDataSourceAccessDenied = errors.New("data source access denied")
|
|
|
|
|
ErrDataSourceFailedGenerateUniqueUid = errors.New("failed to generate unique datasource ID")
|
|
|
|
|
ErrDataSourceIdentifierNotSet = errors.New("unique identifier and org id are needed to be able to get or delete a datasource")
|
2022-07-25 22:19:07 +08:00
|
|
|
ErrDatasourceIsReadOnly = errors.New("data source is readonly, can only be updated from configuration")
|
2023-07-17 22:27:19 +08:00
|
|
|
ErrDataSourceNameInvalid = errutil.NewBase(errutil.StatusValidationFailed, "datasource.nameInvalid", errutil.WithPublicMessage("Invalid datasource name."))
|
|
|
|
|
ErrDataSourceURLInvalid = errutil.NewBase(errutil.StatusValidationFailed, "datasource.urlInvalid", errutil.WithPublicMessage("Invalid datasource url."))
|
2022-06-28 00:23:15 +08:00
|
|
|
)
|