Documentation
¶
Overview ¶
Package udts include resources of ucloud udts product
See also
- API: https://docs.ucloud.cn/api/udts-api/index
- Product: https://www.ucloud.cn/site/product/udts.html
for detail.
Index ¶
- type CSVNode
- type ConfigData
- type GetUDTSTaskConfigureRequest
- type GetUDTSTaskConfigureResponse
- type GetUDTSTaskStatusRequest
- type GetUDTSTaskStatusResponse
- type ListDataItem
- type ListUDTSTaskRequest
- type ListUDTSTaskResponse
- type MySQLNode
- type PolicyData
- type Progress
- type RedisNode
- type Source
- type StartUDTSTaskRequest
- type StartUDTSTaskResponse
- type StatusData
- type StopUDTSTaskRequest
- type StopUDTSTaskResponse
- type SyncData
- type TiDBNode
- type UDTSClient
- func (c *UDTSClient) GetUDTSTaskConfigure(req *GetUDTSTaskConfigureRequest) (*GetUDTSTaskConfigureResponse, error)
- func (c *UDTSClient) GetUDTSTaskStatus(req *GetUDTSTaskStatusRequest) (*GetUDTSTaskStatusResponse, error)
- func (c *UDTSClient) ListUDTSTask(req *ListUDTSTaskRequest) (*ListUDTSTaskResponse, error)
- func (c *UDTSClient) NewGetUDTSTaskConfigureRequest() *GetUDTSTaskConfigureRequest
- func (c *UDTSClient) NewGetUDTSTaskStatusRequest() *GetUDTSTaskStatusRequest
- func (c *UDTSClient) NewListUDTSTaskRequest() *ListUDTSTaskRequest
- func (c *UDTSClient) NewStartUDTSTaskRequest() *StartUDTSTaskRequest
- func (c *UDTSClient) NewStopUDTSTaskRequest() *StopUDTSTaskRequest
- func (c *UDTSClient) StartUDTSTask(req *StartUDTSTaskRequest) (*StartUDTSTaskResponse, error)
- func (c *UDTSClient) StopUDTSTask(req *StopUDTSTaskRequest) (*StopUDTSTaskResponse, error)
- type UDWNode
- type UFileNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSVNode ¶
type CSVNode struct {
// 如果 DupAction 为 ignore或者replace, 并且需要调整列的顺序的时候使用。 以逗号分割的列名字符串。
Columns string
// 当加载重复数据的时候所采取的行为,有效值有 ignore - 忽略, replace - 替换, update - 更新。 默认为replace
DupAction string
// 数据迁移的时候是否保留原有数据, 默认为 false 不保留
KeepExistData bool
// 如果 DupAction 为 update, 并且在插入数据的同时想给一些列赋予特定的值的时候使用。
SetPolicy []PolicyData
// 数据路径
URL string
// 如果 DupAction 为 update, 并且不想用CSV数据完整替换原有数据的时候使用。
UpdatePolicy []PolicyData
}
CSVNode - CSV 结点
type ConfigData ¶
type ConfigData struct {
// 最大失败重试次数
MaxRetryCount int
// 任务名称
Name string
// Source
Source Source
// Target
Target Source
// 任务 ID
TaskId string
// 任务类型, full全量, incremental增量,full+incremental全量+增量。
Type string
}
ConfigData - Task 的配置信息
type GetUDTSTaskConfigureRequest ¶
type GetUDTSTaskConfigureRequest struct {
request.CommonBase
// 任务ID
TaskId *string `required:"true"`
}
GetUDTSTaskConfigureRequest is request schema for GetUDTSTaskConfigure action
type GetUDTSTaskConfigureResponse ¶
type GetUDTSTaskConfigureResponse struct {
response.CommonBase
// 详细配置信息
Data ConfigData
}
GetUDTSTaskConfigureResponse is response schema for GetUDTSTaskConfigure action
type GetUDTSTaskStatusRequest ¶
type GetUDTSTaskStatusRequest struct {
request.CommonBase
// 任务ID
TaskId *string `required:"true"`
}
GetUDTSTaskStatusRequest is request schema for GetUDTSTaskStatus action
type GetUDTSTaskStatusResponse ¶
type GetUDTSTaskStatusResponse struct {
response.CommonBase
// StatusData
Data StatusData
// 返回信息
Message string
}
GetUDTSTaskStatusResponse is response schema for GetUDTSTaskStatus action
type ListDataItem ¶
type ListDataItem struct {
// 创建时间
CreateTime int
// 当前失败重试次数
CurRetryCount int
// 最大失败重试次数
MaxRetryCount int
// 任务名称
Name string
// 全量迁移进度信息,增量迁移时为空
Progress Progress
// 任务状态
Status string
// 任务 ID
TaskId string
// 任务类型, full全量, incremental增量,full+incremental全量+增量。
Type string
}
ListDataItem - 返回列表的一个 Task 的信息
type ListUDTSTaskRequest ¶
type ListUDTSTaskRequest struct {
request.CommonBase
// 请求数量,默认为 20
Limit *string `required:"false"`
// 偏移量,默认为 0
Offset *string `required:"false"`
}
ListUDTSTaskRequest is request schema for ListUDTSTask action
type ListUDTSTaskResponse ¶
type ListUDTSTaskResponse struct {
response.CommonBase
// ListDataItem 数组
Data []ListDataItem
// 返回信息
Message string
}
ListUDTSTaskResponse is response schema for ListUDTSTask action
type MySQLNode ¶
type MySQLNode struct {
// DB 名字, 长度不超过63个字符
DataBase string
// 地域,只有当 Host 为 UCloud 用户内网地址的时候需要提供
DataRegion string
// 数据库地址,长度不能超过 60个字符
Host string
// 数据库密码,长度不起来32个字符
Password string
// 数据库端口,端口范围 1-65535
Port int
// 子网 ID, 只有当 Host 为 UCloud 用户内网地址并且源目属于不同的地域的时候需要提供。
SubnetId string
// 增量同步数据
SyncData SyncData
// 表名, 长度不超过64个字符
Table string
// 数据库用户名,长度不能超过 32个字符
User string
// VPC 资源ID, 只有当 Host 为 UCloud 用户内网地址的时候需要提供。
VPCId string
}
MySQLNode - MySQL 结点
type PolicyData ¶
type PolicyData struct {
// 列名
Column string
// 与上面类型对应的值, 比如“1”, “now()”, "Nash".
Data string
// 可选值为 CSVData, Function, Fixed
Type string
}
PolicyData - Policy 数据结构
type Progress ¶
type Progress struct {
// 已迁移条目数
CurCount int
// 已耗时间(单位秒)
CurDuration int
// 完成进度
Percentage float64
// 总条目数
TotalCount int
// 估算总耗时间(单位秒)
TotalDuration int
}
Progress - 进度信息
type RedisNode ¶
type RedisNode struct {
// 数据库地址,只填写主(master)地址,集群模式下,多个地址用 ; 相连
Address string
// 数据库所在的地域。 只有当 Host 为 UCloud 用户内网地址的时候需要提供
DataRegion string
// Redis2Redis全量迁移是否使用rump,默认是dump-restore
IsRump string
// redis密码
Password string
// 子网 ID, 只有当 Host 为 UCloud 用户内网地址并且源目属于不同的地域的时候需要提供
SubnetId string
// redis模式
Type string
// 数据库所在机器的 VPCId, 只有内网跨域迁移的时候需要提供
VPCId string
}
RedisNode - Redis节点
type Source ¶
type Source struct {
// 设置的最大的速率,单位MB/s,公网/专线(0, 56],用户网(0, 1024],不填/超过默认是峰值
BandwidthLimit int
// 当 DataType 为csv的时候使用。
CSVNode CSVNode
// 源数据类型可以是 mysql, tidb, csv, oracle, udb-mysql。目的数据类型可以是 mysql, tidb, udb-mysql, udw.
DataType string
// 是否为专线迁移
IsDedicatedLine bool
// 当 DataType 为mysql的时候使用。
MySQLNode MySQLNode
// 网络类型
NWType string
// 当 DataType 为 redis 的时候使用
RedisNode RedisNode
// 当 DataType 为tidb的时候使用。
TiDBNode TiDBNode
// 当 DataType 为 udw 的时候使用。
UDWNode UDWNode
// 当 DataType 为 ufile 的时候使用。
UFileNode UFileNode
}
Source - 源端信息
type StartUDTSTaskRequest ¶
type StartUDTSTaskRequest struct {
request.CommonBase
// 任务ID
TaskId *string `required:"true"`
}
StartUDTSTaskRequest is request schema for StartUDTSTask action
type StartUDTSTaskResponse ¶
type StartUDTSTaskResponse struct {
response.CommonBase
// 返回信息
Message string
}
StartUDTSTaskResponse is response schema for StartUDTSTask action
type StatusData ¶
type StatusData struct {
// 当前失败重试次数
CurRetryCount int
// 当Status为Failed时, 显示失败原因
FailedMessage string
// 用户设置的最大失败重试次数
MaxRetryCount int
// Progress 全量迁移进度信息, 当类型为增量迁移时为空
Progress Progress
// 任务状态, 可能的状态有Checking, Dumping, Loading, Syncing, Done, Failed 等
Status string
// Binlog 信息
Sync SyncData
}
StatusData - 动态状态信息
type StopUDTSTaskRequest ¶
type StopUDTSTaskRequest struct {
request.CommonBase
// 任务 ID
TaskId *string `required:"true"`
}
StopUDTSTaskRequest is request schema for StopUDTSTask action
type StopUDTSTaskResponse ¶
type StopUDTSTaskResponse struct {
response.CommonBase
// 返回信息
Message string
}
StopUDTSTaskResponse is response schema for StopUDTSTask action
type SyncData ¶
type SyncData struct {
// GTID
BinlogGTID string
// Binlog 文件名, 长度不超过128字符
BinlogName string
// Binlog Pos
BinlogPos int
// 分配给UDTS task的server ID, 必须在MySQL集群中唯一
ServerId int
}
SyncData - 增量同步数据
type TiDBNode ¶
type TiDBNode struct {
// DB 名字, 长度不超过63个字符
DataBase string
// 地域,只有当 Host 为 UCloud 用户内网地址的时候需要提供
DataRegion string
// 数据库地址,长度不能超过 60个字符
Host string
// 数据库密码,长度不起来32个字符
Password string
// 数据库端口,端口范围 1-65535
Port int
// 子网 ID, 只有当 Host 为 UCloud 用户内网地址并且源目属于不同的地域的时候需要提供。
SubnetId string
// 表名, 长度不超过64个字符
Table string
// 数据库用户名,长度不能超过 32个字符
User string
// VPC 资源ID, 只有当 Host 为 UCloud 用户内网地址的时候需要提供。
VPCId string
}
TiDBNode - TiDB 结点
type UDTSClient ¶
UDTSClient is the client of UDTS
func NewClient ¶
func NewClient(config *ucloud.Config, credential *auth.Credential) *UDTSClient
NewClient will return a instance of UDTSClient
func (*UDTSClient) GetUDTSTaskConfigure ¶
func (c *UDTSClient) GetUDTSTaskConfigure(req *GetUDTSTaskConfigureRequest) (*GetUDTSTaskConfigureResponse, error)
API: GetUDTSTaskConfigure
获取任务配置
func (*UDTSClient) GetUDTSTaskStatus ¶
func (c *UDTSClient) GetUDTSTaskStatus(req *GetUDTSTaskStatusRequest) (*GetUDTSTaskStatusResponse, error)
API: GetUDTSTaskStatus
查看服务状态
func (*UDTSClient) ListUDTSTask ¶
func (c *UDTSClient) ListUDTSTask(req *ListUDTSTaskRequest) (*ListUDTSTaskResponse, error)
API: ListUDTSTask
获取用户创建的 Task 信息
func (*UDTSClient) NewGetUDTSTaskConfigureRequest ¶
func (c *UDTSClient) NewGetUDTSTaskConfigureRequest() *GetUDTSTaskConfigureRequest
NewGetUDTSTaskConfigureRequest will create request of GetUDTSTaskConfigure action.
func (*UDTSClient) NewGetUDTSTaskStatusRequest ¶
func (c *UDTSClient) NewGetUDTSTaskStatusRequest() *GetUDTSTaskStatusRequest
NewGetUDTSTaskStatusRequest will create request of GetUDTSTaskStatus action.
func (*UDTSClient) NewListUDTSTaskRequest ¶
func (c *UDTSClient) NewListUDTSTaskRequest() *ListUDTSTaskRequest
NewListUDTSTaskRequest will create request of ListUDTSTask action.
func (*UDTSClient) NewStartUDTSTaskRequest ¶
func (c *UDTSClient) NewStartUDTSTaskRequest() *StartUDTSTaskRequest
NewStartUDTSTaskRequest will create request of StartUDTSTask action.
func (*UDTSClient) NewStopUDTSTaskRequest ¶
func (c *UDTSClient) NewStopUDTSTaskRequest() *StopUDTSTaskRequest
NewStopUDTSTaskRequest will create request of StopUDTSTask action.
func (*UDTSClient) StartUDTSTask ¶
func (c *UDTSClient) StartUDTSTask(req *StartUDTSTaskRequest) (*StartUDTSTaskResponse, error)
API: StartUDTSTask
启动UDTS服务
func (*UDTSClient) StopUDTSTask ¶
func (c *UDTSClient) StopUDTSTask(req *StopUDTSTaskRequest) (*StopUDTSTaskResponse, error)
API: StopUDTSTask
停止UDTS任务
type UDWNode ¶
type UDWNode struct {
// DB 名字, 长度不超过63个字符
DataBase string
// 地域
DataRegion string
// 数据库地址,长度不能超过 60个字符
Host string
// 数据库密码,长度不起来32个字符
Password string
// 数据库端口,端口范围 1-65535
Port int
// 子网 ID, 只有当源目属于不同的地域的时候需要提供。
SubnetId string
// 数据库用户名,长度不能超过 32个字符
User string
// VPC 资源ID, 只有当 Host 为 UCloud 用户内网地址的时候需要提供。
VPCId string
}
UDWNode - UDW 结点