调用 CreateTransmissionTask 接口创建数据库传输服务任务。
同步请求。
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
TaskName | String | 是 | Test**** | 任务名称。命名规则:
|
TaskType | String | 是 | DataMigration | 任务类型。取值如下:
|
SrcConfig | 是 |
| 源库信息。详细信息,请参见 DataSource。 | |
DestConfig | 是 |
| 目标库信息。详细信息,请参见 DataSource。 | |
SolutionSettings | 是 |
| 迁移、订阅或同步任务对象的配置信息。详细信息,请参见 SolutionSetting。 | |
TrafficSpec | String | 否 | Compact | 任务链路规格。支持 Compact 和 Standard 取值。默认值为 Compact 。关于链路规格的详细信息,请参见产品规格。 |
ChargeConfig | 是 |
| 计费配置。详细信息,请参见 ChargeConfig。 | |
ProjectName | String | 否 | default | 项目名称。 说明 您可以调用 GetProject 接口创建项目。 |
CreateBackwardSyncTask | Bool | 否 | false | 是否创建反向同步任务。取值如下:
说明 数据同步功能支持多种同步拓扑,您可以根据业务需求选择合适的拓扑进行数据同步。更多信息,请参见同步拓扑。 |
Tags | Array of Tag | 否 |
| 标签信息。说明支持一次传入多组标签键值对像,多组标签键值对像间用英文逗号(,)分隔。最多同时传入 20 组标签键值对。单个任务最多可绑定 50 个键值。详细信息,请参见 Tag。 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
TaskId | String | af16a602e1134abdbb281864ca****** | 任务 ID。 |
POST /?Action=CreateTransmissionTask&Version=2022-10-01 HTTP/1.1 Content-Type: application/json Host:dts.volcengineapi.com X-Date: 20221001T101010Z Authorization: HMAC-SHA256 Credential=AKLTN2I0MmFiNzMxNWE5NDgzMzk4MmVjMTVkODlkZTZ****/20221001/cn-beijing/dts/request,SignedHeaders=x-date, Signature=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c645**** { "TaskName": "zaizaitest****1", "TaskType": "DataMigration", "SrcConfig": { "EndpointType": "Public_MySQL", "PublicMySQLSettings": { "Host": "192.168.***.***", "Port": 4, "Username": "test****", "Password": "Admin@****", "SSLSettings": { "EnableSSL": "true", "Cert": "-----BEGIN CERTIFICATE----- ...... -----END CERTIFICATE-----" }, "RegionSettings": { "Region": "cn-shanghai" } } }, "DestConfig": { "EndpointType": "Volc_MySQL", "VolcMySQLSettings": { "DBInstanceId": "mysql-7cd1dc4ab511", "DBInstanceName": "", "Password": "Admin@****", "RegionSettings": { "Region": "cn-guangzhou" }, "Username": "test****" } }, "TrafficSpec": "Compact", "ProjectName": "default", "SolutionSettings": { "MySQL2MySQLSettings": { "AccountTransmissionSettings": { "EnableAccount": true }, "ETLSettings": { "Script": "" }, "ErrorBehaviorSettings": { "MaxRetrySeconds": 7200 }, "FullTransmissionSettings": { "FullSyncParalell": 8, "RPSLimit": 100000, "BPSLimit": 25000000, "EnableFull": true }, "IncrTransmissionSettings": { "EnableIncr": true, "Statements": [ "StmtDDLAll", "StmtDMLDelete", "StmtDMLUpdate", "StmtDMLInsert" ] }, "MetaTransmissionSettings": { "EnableMeta": true }, "EnableForeignKeyChecks": true, "ObjectMappings": [ { "DestObjName": "huahua", "MappingList": [ { "DestObjName": "*", "ObjectType": "Table", "SrcObjName": "*" } ], "ObjectType": "Database", "SrcObjName": "huahua" } ], "PolicyForPrimaryKeyConflict": "Override", "AccountMapping": { "Account": "test****", "ResetPassword": "true", "Password": "*Test****" } }, "SolutionType": "MySQL2MySQL" }, "Tags": [ { "Key": "key1", "Value": "value1" } ], "ChargeConfig": { "ChargeType": "PostPaid" } }
{ "ResponseMetadata": { "RequestId": "2023032015110930FCAD0A8CC67B0EAB33", "Action": "CreateTransmissionTask", "Version": "2022-10-01", "Service": "dts", "Region": "cn-beijing" }, "Result": { "TaskId": "af16a602e1134abdbb281864ca*****" } }
更多详情,请参见错误码。