* Cloud migrations: store resource name in the cloud_migration_resource table
* remove unused function: convertMigrateDataResponseToDTO
* make swagger-clean && make openapi3-gen
* use DB_Text for cloud_migration_resource.name instead of DB_Varchar
* minor performance improvement
* apply a warning to any non-core plugins that successfully migrate
* commit frontend wip while I refactor some stuff
* update api
* repurpose error dialog to be a generic details dialog
* whitespace
* add unit test
* fixes from testing
* fix migration summary
* add comment
* fix localization stuff
* fix backend test
* reduce number of queries to the db
* some PR feedback
* whitespace
* store encryption key in unified secrets table
* fix local dev mode
* make metadata more realistic
* fix tests
* fix sql queries against postgres
* fix stats endpoint
* implement querying gms for snapshot status
* add some documentation
* provide snapshot resources after snapshot is created
* add rate limiting to backend
* fix compilation error
* fix typo
* add unit tests
* finish merge
* lint
* swagger gen
* more testing
* remove duplicate test
* address a couple PR comments
* update switch statement to a map
* add timeouts to gms client through the http client
* remove extra whitespace
* put method back where it was so the PR is less confusing
* fix tests
* add todo
* fix final unit test
* Cloud migration: upload snapshot files using presigned url
* log error if index file cannot be closed
* log error if file cannot be closed in uploadUsingPresignedURL
* order session list descending
* add snapshot status method to store
* query stats while retrieving snapshot
* return stats in dto
* swagger
* fix tests
* commit results of bingo get
* fix swagger
* minor improvement
* fix typo
* forgot a file
* Cloud migrations: create snapshot and store it on disk
* fix merge conflicts
* implement StartSnapshot for gms client
* pass snapshot directory as argument to snapshot builder
* ensure snapshot folder is set
* make swagger-gen
* remove Test_ExecuteAsyncWorkflow
* pass signed in user to buildSnapshot method / use github.com/grafana/grafana-cloud-migration-snapshot to create snapshot files
* fix FakeServiceImpl.CreateSnapshot
* remove new line
* create a new table for migration resources
* remove raw result bytes from db
* more snapshot resource management stuff
* integrate new table with snapshots
* pass in result limit and offset as params
* combine create and update
* set up xorm store test
* add unit tests
* save some cpu
* remove unneeded arg
* regen swagger
* fix bug with result processing
* fix update create logic so that uid isn't required for lookup
* change offset to page
* regen swagger
* revert accidental changes to file
* curl command page should be 1 indexed
* add regex support for api tests
* revert dumb thing
* add api tests
* add unit test for core async workflow
* add xorm store unit tests
* fix typo
* remove unnecessary assignment
* add new apis
* add payloads
* create snapshot status type
* add some impl
* finish implementing update
* start implementing build snapshot func
* add more fake build logic
* add cancel endpoint. do some cleanup
* implement GetSnapshot
* implement upload snapshot
* merge onprem status with gms result
* get it working
* update comment
* rename list endpoint
* add query limit and offset
* add helper method to snapshot
* little bit of cleanup
* work on swagger annotations
* manual merge
* generate swagger specs
* clean up curl commands
* fix bugs found during final testing
* fix linter issue
* fix unit test
* rename some stuff
* more renaming
* clean up api
* rename more functions
* rename cms -> gms
* update comment
* update swagger gen
* update endpoints
* overzealous
* final touches
* dont modify existing migrations
* break structs into domain and dtos
* add some conversion funcs
* fix build
* update frontend
* try to make swagger happy
* Cloud migration: create route to fetch cloud migration token
* implement gcomStub.ListTokens
* fix swagger for POST /cloudmigration/migration
* fix swagger for POST /cloudmigration/migration
* fix swagger for POST /cloudmigration/migration
* - Added migration to add a new collumn UID to both migration and migration_run tables.
- Added migration to set UID for records already existent in the database before adding a new column.
- Added UID field to CloudMigration and CloudMigrationRun dtos (model.go)
* Fix db migration
* Updating store and model
* Updating API to use UID
* fix typo
* update openapi specs and generated endpoints
* fix spec
* update openapi specs and generated endpoints
* Fixing db mapping
* Fix frontend
* fix migration
* remove migration uid from run fetch endpoint
* Revert "merge"
This reverts commit d654e4c530, reversing
changes made to 5fe0b483eb.
* manual merge
* rename some funcs for consistency
* make interfaces consistent
* validate uids
* update generated frontend api
* fix enterprise spec
* manually resolve api
* try again
* try yet again
* once more
---------
Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
Co-authored-by: Michael Mandrus <michael.mandrus@grafana.com>
Co-authored-by: joshhunt <josh@trtr.co>
* move run migration to the cloudmigrationimpl layer
* add migration run list logic down a layer
* remove useless comments
* pull cms calls into their own service
* Implement run migration endpoint
* Refactor RunMigration method into separate methods
* Save migration runs fix lint
* Minor changes
* Refactor how to use cms endpoint
* fix interface
* complete merge
* add individual items
* adds tracing to getMigration
* linter
* updated swagger definition with the latest changes
* CloudMigrations: Implement core API handlers for cloud migrations and migration runs (#85407)
* implement delete
* add auth token encryption
* implement token validation
* call token validation during migration creation
* implement get migration status
* implement list migration runs
* fix bug
* finish parse domain func
* fix urls
* fix typo
* fix encoding and decoding
* remove double decryption
* add missing slash
* fix id returned by create function
* inject missing services
* finish implementing (as far as I can tell right now) data migration and response handling
* comment out broken test, needs a rewrite
* add a few final touches
* get dashboard migration to work properly
* changed runMigration to a POST
* swagger
* swagger
* swagger
---------
Co-authored-by: Michael Mandrus <michael.mandrus@grafana.com>
Co-authored-by: Leonard Gram <leo@xlson.com>
Co-authored-by: Michael Mandrus <41969079+mmandrus@users.noreply.github.com>
* Add cloud migration endpoints
* Built auth into creating a migration.
* Added more detail to the migration result model
* goimports
* Update pkg/services/cloudmigration/api/api.go
Co-authored-by: lean.dev <34773040+leandro-deveikis@users.noreply.github.com>
* Update pkg/services/cloudmigration/api/api.go
Co-authored-by: lean.dev <34773040+leandro-deveikis@users.noreply.github.com>
---------
Co-authored-by: Leonard Gram <leo@xlson.com>
Co-authored-by: lean.dev <34773040+leandro-deveikis@users.noreply.github.com>