2024-03-25 13:30:47 +01:00
|
|
|
package cloudmigration
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
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-03-25 13:30:47 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type Service interface {
|
2024-06-07 13:46:19 -03:00
|
|
|
// GetToken Returns the cloud migration token if it exists.
|
|
|
|
|
GetToken(ctx context.Context) (gcom.TokenView, error)
|
|
|
|
|
// CreateToken Creates a cloud migration token.
|
|
|
|
|
CreateToken(ctx context.Context) (CreateAccessTokenResponse, error)
|
2024-06-13 13:58:59 -04:00
|
|
|
// ValidateToken Sends a request to GMS to test the token.
|
|
|
|
|
ValidateToken(ctx context.Context, mig CloudMigrationSession) error
|
2024-05-31 10:03:43 -03:00
|
|
|
DeleteToken(ctx context.Context, uid string) error
|
2024-04-17 15:43:09 -04:00
|
|
|
|
2024-06-13 13:58:59 -04:00
|
|
|
CreateSession(ctx context.Context, req CloudMigrationSessionRequest) (*CloudMigrationSessionResponse, error)
|
|
|
|
|
GetSession(ctx context.Context, migUID string) (*CloudMigrationSession, error)
|
|
|
|
|
DeleteSession(ctx context.Context, migUID string) (*CloudMigrationSession, error)
|
|
|
|
|
GetSessionList(context.Context) (*CloudMigrationSessionListResponse, error)
|
2024-04-03 13:36:13 +02:00
|
|
|
|
2024-06-13 13:58:59 -04:00
|
|
|
RunMigration(ctx context.Context, migUID string) (*MigrateDataResponse, error)
|
|
|
|
|
GetMigrationStatus(ctx context.Context, runUID string) (*CloudMigrationSnapshot, error)
|
2024-06-19 09:20:52 -04:00
|
|
|
GetMigrationRunList(ctx context.Context, migUID string) (*CloudMigrationRunList, error)
|
|
|
|
|
|
2024-07-03 10:38:26 -03:00
|
|
|
CreateSnapshot(ctx context.Context, signedInUser *user.SignedInUser, sessionUid string) (*CloudMigrationSnapshot, error)
|
2024-06-24 23:50:07 -04:00
|
|
|
GetSnapshot(ctx context.Context, query GetSnapshotsQuery) (*CloudMigrationSnapshot, error)
|
2024-06-19 09:20:52 -04:00
|
|
|
GetSnapshotList(ctx context.Context, query ListSnapshotsQuery) ([]CloudMigrationSnapshot, error)
|
|
|
|
|
UploadSnapshot(ctx context.Context, sessionUid string, snapshotUid string) error
|
2024-06-21 09:35:15 -04:00
|
|
|
CancelSnapshot(ctx context.Context, sessionUid string, snapshotUid string) error
|
2024-03-25 13:30:47 +01:00
|
|
|
}
|