github.com/morlay/goqcloud@v0.0.0-20181123023149-b00e0b0b9afc/clients/sqlserver/create_migration.go (about) 1 package sqlserver 2 3 import ( 4 github_com_morlay_goqcloud "github.com/morlay/goqcloud" 5 ) 6 7 // 创建迁移任务 8 // https://cloud.tencent.com/document/api/238/19945 9 10 type CreateMigrationRequest struct { 11 // 迁移DB对象 ,离线迁移不使用(SourceType=4或SourceType=5)。 12 MigrateDBSet []*MigrateDB `name:"MigrateDBSet,omitempty"` 13 // 迁移任务的名称 14 MigrateName string `name:"MigrateName"` 15 // 迁移类型(1:结构迁移 2:数据迁移 3:增量同步) 16 MigrateType int64 `name:"MigrateType"` 17 // 区域 18 Region string `name:"Region"` 19 // 迁移源 20 Source MigrateSource `name:"Source"` 21 // 迁移源的类型 1:CDB for SQLServer 2:云服务器自建SQLServer数据库 4:SQLServer备份还原 5:SQLServer备份还原(COS方式) 22 SourceType int64 `name:"SourceType"` 23 // 迁移目标 24 Target MigrateTarget `name:"Target"` 25 } 26 27 func (req *CreateMigrationRequest) Invoke(client github_com_morlay_goqcloud.Client) (*CreateMigrationResponse, error) { 28 resp := &CreateMigrationResponse{} 29 err := client.Request("sqlserver", "CreateMigration", "2018-03-28").Do(req, resp) 30 return resp, err 31 } 32 33 type CreateMigrationResponse struct { 34 github_com_morlay_goqcloud.TencentCloudBaseResponse 35 // 迁移任务ID 36 MigrateId int64 `json:"MigrateId"` 37 }