8de772e55d
CloudMigrations: Add instance metadata to auth token (#85381)
* update how tokens are passed around
* rename structs
(cherry picked from commit 5a5f76ae0a)
Co-authored-by: Michael Mandrus <41969079+mmandrus@users.noreply.github.com>
30 lines
872 B
Go
30 lines
872 B
Go
package cloudmigrationimpl
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/grafana/grafana/pkg/infra/db"
|
|
"github.com/grafana/grafana/pkg/services/cloudmigration"
|
|
)
|
|
|
|
type sqlStore struct {
|
|
db db.DB
|
|
}
|
|
|
|
func (ss *sqlStore) MigrateDatasources(ctx context.Context, request *cloudmigration.MigrateDatasourcesRequest) (*cloudmigration.MigrateDatasourcesResponse, error) {
|
|
return nil, cloudmigration.ErrInternalNotImplementedError
|
|
}
|
|
|
|
func (ss *sqlStore) CreateMigration(ctx context.Context, token cloudmigration.Base64EncodedTokenPayload) error {
|
|
return nil
|
|
}
|
|
|
|
func (ss *sqlStore) GetAllCloudMigrations(ctx context.Context) ([]*cloudmigration.CloudMigration, error) {
|
|
var migrations = make([]*cloudmigration.CloudMigration, 0)
|
|
err := ss.db.WithDbSession(ctx, func(sess *db.Session) error { return sess.Find(&migrations) })
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return migrations, nil
|
|
}
|