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