Documentation ¶
Overview ¶
Package dts defines the DTS services of BCE. The supported APIs are all defined in sub-package
dts.go - the dts APIs definition supported by the DTS service
Index ¶
- Constants
- type CheckResult
- type Client
- func (c *Client) ConfigDts(taskId string, args *ConfigArgs) (*ConfigDtsResult, error)
- func (c *Client) CreateDts(args *CreateDtsArgs) (*CreateDtsResult, error)
- func (c *Client) DeleteDts(taskId string) error
- func (c *Client) GetDetail(taskId string) (*DtsTaskMeta, error)
- func (c *Client) GetPreCheck(taskId string) (*GetPreCheckResult, error)
- func (c *Client) ListDts(args *ListDtsArgs) (*ListDtsResult, error)
- func (c *Client) PauseDts(taskId string) error
- func (c *Client) PreCheck(taskId string) (*PreCheckResult, error)
- func (c *Client) ShutdownDts(taskId string) error
- func (c *Client) StartDts(taskId string) error
- type ConfigArgs
- type ConfigDtsResult
- type Connection
- type CreateDtsArgs
- type CreateDtsResult
- type DtsId
- type DtsTaskMeta
- type DynamicInfo
- type GetPreCheckResult
- type InitPosition
- type ListDtsArgs
- type ListDtsResult
- type PayInfo
- type PreCheckResult
- type Schema
- type SchemaInfo
- type SubDataScope
- type SubStatus
Constants ¶
const ( URI_PREFIX = bce.URI_PREFIX + "v1" DEFAULT_ENDPOINT = "rds.bj.baidubce.com" REQUEST_DTS_URL = "/task" API_DTS_URL = "/api/dts/" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckResult ¶
type Client ¶
Client of DTS service is a kind of BceClient, so derived from BceClient
func (*Client) ConfigDts ¶
func (c *Client) ConfigDts(taskId string, args *ConfigArgs) (*ConfigDtsResult, error)
ConfigDts - config a dtsTask with the specific parameters
PARAMS:
- taskId: the specific dtsTask's ID
- args: the arguments to config a dtsTask
RETURNS:
- *ConfigDtsResult: the result of config dtsTask, contains the dtsTask's ID
- error: nil if success otherwise the specific error
func (*Client) CreateDts ¶
func (c *Client) CreateDts(args *CreateDtsArgs) (*CreateDtsResult, error)
CreateDts - create a dtsTask with the specific parameters
PARAMS:
- args: the arguments to create a dtsTask
RETURNS:
- *CreateDtsResult: the result of create dtsTask, contains new dtsTask's ID
- error: nil if success otherwise the specific error
func (*Client) DeleteDts ¶
DeleteDts - delete a dtsTask
PARAMS:
- taskId: the specific taskId
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) GetDetail ¶
func (c *Client) GetDetail(taskId string) (*DtsTaskMeta, error)
GetDetail - get a specific dtsTask's detail
PARAMS:
- taskId: the specific dtsTask's ID
RETURNS:
- *DtsTaskMeta: the specific dtsTask's detail
- error: nil if success otherwise the specific error
func (*Client) GetPreCheck ¶
func (c *Client) GetPreCheck(taskId string) (*GetPreCheckResult, error)
GetPreCheck - get a precheck result
PARAMS:
- taskId: the specific dtsTask's ID
RETURNS:
- *GetPreCheckResult: the specific dtsTask's precheck result
- error: nil if success otherwise the specific error
func (*Client) ListDts ¶
func (c *Client) ListDts(args *ListDtsArgs) (*ListDtsResult, error)
ListDts - list all dtsTask with the specific type
PARAMS:
- args: the arguments to list all dtsTask with the specific type
RETURNS:
- *ListDtsResult: the result of list all dtsTask, contains all dtsTask' detail
- error: nil if success otherwise the specific error
func (*Client) PauseDts ¶
PauseDts - pause a dtsTask
PARAMS:
- taskId: the specific dtsTask's ID
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) PreCheck ¶
func (c *Client) PreCheck(taskId string) (*PreCheckResult, error)
PreCheck - precheck a dtsTask
PARAMS:
- taskId: the specific dtsTask's ID
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) ShutdownDts ¶
ShutdownDts - shutdown a dtsTask
PARAMS:
- taskId: the specific dtsTask's ID
RETURNS:
- error: nil if success otherwise the specific error
type ConfigArgs ¶
type ConfigArgs struct { Type string `json:"type,omitempty"` DtsId string `json:"dtsId,omitempty"` TaskName string `json:"taskName"` DataType []string `json:"dataType"` SrcConnection Connection `json:"srcConnection"` DstConnection Connection `json:"dstConnection"` SchemaMapping []Schema `json:"schemaMapping"` Granularity string `json:"granularity,omitempty"` ProductType string `json:"productType,omitempty"` QueueType string `json:"queueType,omitempty"` InitPosition InitPosition `json:"initPosition,omitempty"` NetType string `json:"netType,omitempty"` Admin string `json:"admin,omitempty"` }
type ConfigDtsResult ¶
type ConfigDtsResult struct {
DtsId string `json:"dtsId"`
}
type Connection ¶
type Connection struct { Region string `json:"region"` DbType string `json:"dbType"` DbUser string `json:"dbUser"` DbPass string `json:"dbPass"` DbPort int `json:"dbPort"` DbHost string `json:"dbHost"` InstanceId string `json:"instanceId"` DbServer string `json:"dbServer,omitempty"` InstanceType string `json:"instanceType"` InstanceShortId string `json:"instanceShortId,omitempty"` FieldWhitelist string `json:"field_whitelist,omitempty"` FieldBlacklist string `json:"field_blacklist,omitempty"` StartTime string `json:"startTime,omitempty"` EndTime string `json:"endTime,omitempty"` }
type CreateDtsArgs ¶
type CreateDtsResult ¶
type CreateDtsResult struct {
DtsTasks []DtsId `json:"dtsTasks"`
}
type DtsTaskMeta ¶
type DtsTaskMeta struct { DtsId string `json:"dtsId"` TaskName string `json:"taskName"` Status string `json:"status"` DataType []string `json:"dataType"` Region string `json:"region"` CreateTime string `json:"createTime"` SrcConnection Connection `json:"srcConnection"` DstConnection Connection `json:"dstConnection"` SchemaMapping []Schema `json:"schemaMapping,omitempty"` RunningTime int `json:"runningTime"` SubStatus []SubStatus `json:"subStatus,omitempty"` DynamicInfo DynamicInfo `json:"dynamicInfo,omitempty"` Errmsg string `json:"errmsg,omitempty"` SdkRealtimeProgress string `json:"sdkRealtimeProgress,omitempty"` Granularity string `json:"granularity,omitempty"` SubDataScope SubDataScope `json:"subDataScope,omitempty"` PayInfo PayInfo `json:"payInfo,omitempty"` LockStatus string `json:"lockStatus,omitempty"` }
type DynamicInfo ¶
type DynamicInfo struct { Schema []SchemaInfo `json:"schema"` Base []SchemaInfo `json:"base"` Increment []map[string]string `json:"increment"` }
type GetPreCheckResult ¶
type GetPreCheckResult struct { Success bool `json:"success"` Result []CheckResult `json:"result"` }
type InitPosition ¶
type ListDtsArgs ¶
type ListDtsResult ¶
type ListDtsResult struct { Marker string `json:"marker"` MaxKeys int `json:"maxKeys"` IsTruncated string `json:"isTruncated"` NextMarker string `json:"nextMarker"` Task []DtsTaskMeta `json:"task"` }
type PayInfo ¶
type PayInfo struct { ProductType string `json:"productType"` SourceInstanceType string `json:"sourceInstanceType"` TargetInstanceType string `json:"targetInstanceType"` CrossRegionTag int `json:"crossRegionTag"` CreateTime int `json:"createTime"` Standard string `json:"standard"` EndTime string `json:"endTime"` }