2022-06-27 12:23:15 -04:00
|
|
|
package datasources
|
|
|
|
|
|
2023-07-17 19:57:19 +05:30
|
|
|
import (
|
|
|
|
|
"errors"
|
|
|
|
|
|
2024-06-13 07:11:35 +03:00
|
|
|
"github.com/grafana/grafana/pkg/apimachinery/errutil"
|
2023-07-17 19:57:19 +05:30
|
|
|
)
|
2022-06-27 12:23:15 -04: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 15:19:07 +01:00
|
|
|
ErrDatasourceIsReadOnly = errors.New("data source is readonly, can only be updated from configuration")
|
2023-08-22 12:52:24 +02:00
|
|
|
ErrDataSourceNameInvalid = errutil.ValidationFailed("datasource.nameInvalid", errutil.WithPublicMessage("Invalid datasource name."))
|
|
|
|
|
ErrDataSourceURLInvalid = errutil.ValidationFailed("datasource.urlInvalid", errutil.WithPublicMessage("Invalid datasource url."))
|
2024-05-14 13:58:27 +02:00
|
|
|
ErrDataSourceAPIVersionInvalid = errutil.ValidationFailed("datasource.apiVersionInvalid", errutil.WithPublicMessage("Invalid datasource apiVersion."))
|
2024-06-20 12:56:39 +02:00
|
|
|
ErrDataSourceUIDInvalid = errutil.ValidationFailed("datasource.uidInvalid", errutil.WithPublicMessage("Invalid datasource UID."))
|
2022-06-27 12:23:15 -04:00
|
|
|
)
|