Grafana: define the api for the grafana cloudmigration api (not the csm api) (#84430)
* 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>
This commit is contained in:
co-authored by
lean.dev
Leonard Gram
parent
4be5eaa14f
commit
e2f155f9f7
@@ -1,6 +1,8 @@
|
||||
package cloudmigration
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/util/errutil"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
@@ -10,6 +12,53 @@ var (
|
||||
ErrFeatureDisabledError = errutil.Internal("cloudmigrations.disabled", errutil.WithPublicMessage("Cloud migrations are disabled on this instance"))
|
||||
)
|
||||
|
||||
type CloudMigration struct {
|
||||
ID int64 `json:"id" xorm:"pk autoincr 'id'"`
|
||||
AuthToken string `json:"authToken"`
|
||||
Stack string `json:"stack"`
|
||||
Created time.Time `json:"created"`
|
||||
Updated time.Time `json:"updated"`
|
||||
}
|
||||
|
||||
type MigratedResourceResult struct {
|
||||
Status string `json:"status"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type MigrationResult struct {
|
||||
Status string `json:"status"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type MigratedResource struct {
|
||||
Type string `json:"type"`
|
||||
ID string `json:"id"`
|
||||
RefID string `json:"refID"`
|
||||
Name string `json:"name"`
|
||||
Result MigratedResourceResult `json:"result"`
|
||||
}
|
||||
|
||||
type CloudMigrationRun struct {
|
||||
ID int64 `json:"id" xorm:"pk autoincr 'id'"`
|
||||
CloudMigrationUID string `json:"uid" xorm:"cloud_migration_uid"`
|
||||
Resources []MigratedResource `json:"items"`
|
||||
Result MigrationResult `json:"result"`
|
||||
Created time.Time `json:"created"`
|
||||
Updated time.Time `json:"updated"`
|
||||
Finished time.Time `json:"finished"`
|
||||
}
|
||||
|
||||
type CloudMigrationRequest struct {
|
||||
AuthToken string `json:"authToken"`
|
||||
}
|
||||
|
||||
type CloudMigrationResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Stack string `json:"stack"`
|
||||
Created time.Time `json:"created"`
|
||||
Updated time.Time `json:"updated"`
|
||||
}
|
||||
|
||||
type MigrateDatasourcesRequest struct {
|
||||
MigrateToPDC bool
|
||||
MigrateCredentials bool
|
||||
|
||||
Reference in New Issue
Block a user