2024-02-26 21:52:16 +08:00
|
|
|
package cloudmigrationimpl
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/services/cloudmigration"
|
2024-05-31 20:39:10 +08:00
|
|
|
"github.com/grafana/grafana/pkg/services/gcom"
|
2024-02-26 21:52:16 +08:00
|
|
|
)
|
|
|
|
|
|
2024-05-02 00:29:25 +08:00
|
|
|
// NoopServiceImpl Define the Service Implementation.
|
2024-02-26 21:52:16 +08:00
|
|
|
type NoopServiceImpl struct{}
|
|
|
|
|
|
|
|
|
|
var _ cloudmigration.Service = (*NoopServiceImpl)(nil)
|
|
|
|
|
|
2024-05-31 20:39:10 +08:00
|
|
|
func (s *NoopServiceImpl) GetToken(ctx context.Context) (gcom.TokenView, error) {
|
|
|
|
|
return gcom.TokenView{}, cloudmigration.ErrFeatureDisabledError
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-25 23:43:28 +08:00
|
|
|
func (s *NoopServiceImpl) CreateToken(ctx context.Context) (cloudmigration.CreateAccessTokenResponse, error) {
|
|
|
|
|
return cloudmigration.CreateAccessTokenResponse{}, cloudmigration.ErrFeatureDisabledError
|
2024-03-25 20:30:47 +08:00
|
|
|
}
|
2024-05-31 21:03:43 +08:00
|
|
|
|
|
|
|
|
func (s *NoopServiceImpl) DeleteToken(ctx context.Context, uid string) error {
|
|
|
|
|
return cloudmigration.ErrFeatureDisabledError
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-14 01:58:59 +08:00
|
|
|
func (s *NoopServiceImpl) ValidateToken(ctx context.Context, cm cloudmigration.CloudMigrationSession) error {
|
2024-03-25 20:30:47 +08:00
|
|
|
return cloudmigration.ErrFeatureDisabledError
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-14 01:58:59 +08:00
|
|
|
func (s *NoopServiceImpl) GetSession(ctx context.Context, uid string) (*cloudmigration.CloudMigrationSession, error) {
|
2024-03-25 20:30:47 +08:00
|
|
|
return nil, cloudmigration.ErrFeatureDisabledError
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-14 01:58:59 +08:00
|
|
|
func (s *NoopServiceImpl) GetSessionList(ctx context.Context) (*cloudmigration.CloudMigrationSessionListResponse, error) {
|
2024-03-25 20:30:47 +08:00
|
|
|
return nil, cloudmigration.ErrFeatureDisabledError
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-14 01:58:59 +08:00
|
|
|
func (s *NoopServiceImpl) CreateSession(ctx context.Context, cm cloudmigration.CloudMigrationSessionRequest) (*cloudmigration.CloudMigrationSessionResponse, error) {
|
2024-03-25 20:30:47 +08:00
|
|
|
return nil, cloudmigration.ErrFeatureDisabledError
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-14 01:58:59 +08:00
|
|
|
func (s *NoopServiceImpl) GetMigrationStatus(ctx context.Context, runUID string) (*cloudmigration.CloudMigrationSnapshot, error) {
|
2024-03-25 20:30:47 +08:00
|
|
|
return nil, cloudmigration.ErrFeatureDisabledError
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-19 21:20:52 +08:00
|
|
|
func (s *NoopServiceImpl) GetMigrationRunList(ctx context.Context, uid string) (*cloudmigration.CloudMigrationRunList, error) {
|
2024-03-25 20:30:47 +08:00
|
|
|
return nil, cloudmigration.ErrFeatureDisabledError
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-14 01:58:59 +08:00
|
|
|
func (s *NoopServiceImpl) DeleteSession(ctx context.Context, uid string) (*cloudmigration.CloudMigrationSession, error) {
|
2024-03-25 20:30:47 +08:00
|
|
|
return nil, cloudmigration.ErrFeatureDisabledError
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-14 01:58:59 +08:00
|
|
|
func (s *NoopServiceImpl) CreateMigrationRun(context.Context, cloudmigration.CloudMigrationSnapshot) (string, error) {
|
2024-05-02 00:29:25 +08:00
|
|
|
return "", cloudmigration.ErrInternalNotImplementedError
|
2024-04-03 19:36:13 +08:00
|
|
|
}
|
|
|
|
|
|
2024-06-14 01:58:59 +08:00
|
|
|
func (s *NoopServiceImpl) RunMigration(context.Context, string) (*cloudmigration.MigrateDataResponse, error) {
|
2024-04-03 19:36:13 +08:00
|
|
|
return nil, cloudmigration.ErrFeatureDisabledError
|
|
|
|
|
}
|
2024-06-19 21:20:52 +08:00
|
|
|
|
|
|
|
|
func (s *NoopServiceImpl) CreateSnapshot(ctx context.Context, sessionUid string) (*cloudmigration.CloudMigrationSnapshot, error) {
|
|
|
|
|
return nil, cloudmigration.ErrFeatureDisabledError
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-25 11:50:07 +08:00
|
|
|
func (s *NoopServiceImpl) GetSnapshot(ctx context.Context, query cloudmigration.GetSnapshotsQuery) (*cloudmigration.CloudMigrationSnapshot, error) {
|
2024-06-19 21:20:52 +08:00
|
|
|
return nil, cloudmigration.ErrFeatureDisabledError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *NoopServiceImpl) GetSnapshotList(ctx context.Context, query cloudmigration.ListSnapshotsQuery) ([]cloudmigration.CloudMigrationSnapshot, error) {
|
|
|
|
|
return nil, cloudmigration.ErrFeatureDisabledError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *NoopServiceImpl) UploadSnapshot(ctx context.Context, sessionUid string, snapshotUid string) error {
|
|
|
|
|
return cloudmigration.ErrFeatureDisabledError
|
|
|
|
|
}
|
2024-06-21 21:35:15 +08:00
|
|
|
|
|
|
|
|
func (s *NoopServiceImpl) CancelSnapshot(ctx context.Context, sessionUid string, snapshotUid string) error {
|
|
|
|
|
return cloudmigration.ErrFeatureDisabledError
|
|
|
|
|
}
|