查询同步任务信息

最近更新时间:2024-07-05 01:09:35

我的收藏

1. 接口描述

接口请求域名: dts.tencentcloudapi.com 。

查询同步任务信息

默认接口请求频率限制:100次/秒。

推荐使用 API Explorer
点击调试
API Explorer 提供了在线调用、签名验证、SDK 代码生成和快速检索接口等能力。您可查看每次调用的请求内容和返回结果以及自动生成 SDK 调用示例。

2. 输入参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数

参数名称 必选 类型 描述
Action String 公共参数,本接口取值:DescribeSyncJobs。
Version String 公共参数,本接口取值:2021-12-06。
Region String 公共参数,详见产品支持的 地域列表
JobId String 同步任务id,如sync-werwfs23
示例值:sync-n3gh7md9
JobName String 同步任务名
示例值:test
Order String 排序字段,可以取值为CreateTime
示例值:CreateTime
OrderSeq String 排序方式,升序为ASC,降序为DESC,默认为CreateTime降序
示例值:DESC
Offset Integer 偏移量,默认为0
示例值:0
Limit Integer 返回同步任务实例数量,默认20,有效区间[1,100]
示例值:2
Status.N Array of String 状态集合,如Initialized,CheckPass,Running,ResumableErr,Stopped
示例值:Running
RunMode String 运行模式,如Immediate:立即运行,Timed:定时运行
示例值:Immediate
JobType String 任务类型,如mysql2mysql:msyql同步到mysql
示例值:mysql2mysql
PayMode String 付费类型,PrePay:预付费,PostPay:后付费
示例值:PostPay
TagFilters.N Array of TagFilter tag

3. 输出参数

参数名称 类型 描述
TotalCount Integer 任务数目
注意:此字段可能返回 null,表示取不到有效值。
示例值:2
JobList Array of SyncJobInfo 任务详情数组
注意:此字段可能返回 null,表示取不到有效值。
RequestId String 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。

4. 示例

示例1 查询同步任务列表

查询同步任务列表

输入示例

POST / HTTP/1.1
Host: dts.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeSyncJobs
<公共请求参数>

{
    "JobId": "sync-bkm3mppi"
}

输出示例

{
    "Response": {
        "JobList": [
            {
                "Actions": [
                    "pause",
                    "stop",
                    "limitRate",
                    "view",
                    "resize",
                    "isolate",
                    "postPay2prePay",
                    "configureOptObj"
                ],
                "AllActions": [
                    "view",
                    "configure",
                    "check",
                    "start",
                    "stop",
                    "resume",
                    "pause",
                    "continue",
                    "limitRate",
                    "resize",
                    "isolate",
                    "offline",
                    "recover",
                    "postPay2prePay",
                    "configureOptObj",
                    "checkOptObj",
                    "startOptObj",
                    "createCmpTask"
                ],
                "AutoRenew": 0,
                "AutoRetryTimeRangeMinutes": 0,
                "CreateTime": "2023-12-18 20:55:27",
                "Detail": {
                    "CauseOfCompareDisable": "当前任务开启了DML过滤()。",
                    "CurrentStepProgress": 0,
                    "ErrInfo": {
                        "Message": "",
                        "Reason": "",
                        "Solution": ""
                    },
                    "MasterSlaveDistance": 0,
                    "Message": "",
                    "Progress": -1,
                    "SecondsBehindMaster": 0,
                    "StepAll": 4,
                    "StepInfos": [
                        {
                            "Errors": null,
                            "Progress": -1,
                            "StartTime": "2023-12-20 17:03:39",
                            "Status": "finished",
                            "StepId": "schema-init",
                            "StepName": "增量库表初始化",
                            "StepNo": 1,
                            "Warnings": []
                        },
                        {
                            "Errors": null,
                            "Progress": -1,
                            "StartTime": "2023-12-20 17:03:49",
                            "Status": "finished",
                            "StepId": "dumper",
                            "StepName": "全量导出",
                            "StepNo": 2,
                            "Warnings": []
                        },
                        {
                            "Errors": null,
                            "Progress": -1,
                            "StartTime": "2023-12-20 17:07:50",
                            "Status": "finished",
                            "StepId": "loader",
                            "StepName": "全量导入",
                            "StepNo": 3,
                            "Warnings": []
                        },
                        {
                            "Errors": null,
                            "Progress": -1,
                            "StartTime": "2023-12-20 17:16:49",
                            "Status": "running",
                            "StepId": "sinker",
                            "StepName": "同步增量",
                            "StepNo": 4,
                            "Warnings": []
                        }
                    ],
                    "StepNow": 4
                },
                "DstAccessType": "noProxy",
                "DstDatabaseType": "mysql",
                "DstInfo": {
                    "Account": "",
                    "AccountMode": "",
                    "AccountRole": "",
                    "CcnId": "",
                    "CcnOwnerUin": "",
                    "CvmInstanceId": "",
                    "DatabaseNetEnv": "",
                    "DbKernel": "",
                    "DbName": "",
                    "EncryptConn": "",
                    "EngineVersion": "",
                    "InstanceId": "",
                    "Ip": "11.141.232.156",
                    "Password": "",
                    "Port": 3306,
                    "Region": "ap-guangzhou",
                    "Role": "",
                    "RoleExternalId": "",
                    "SubnetId": "",
                    "Supplier": "",
                    "TmpSecretId": "",
                    "TmpSecretKey": "",
                    "TmpToken": "",
                    "UniqDcgId": "",
                    "UniqVpnGwId": "",
                    "User": "root",
                    "VpcId": ""
                },
                "DstInfos": {
                    "AccessType": "",
                    "DatabaseType": "",
                    "Info": null,
                    "Region": ""
                },
                "DstNodeType": "single",
                "DstRegion": "ap-qingyuan",
                "DumperResumeCtrl": "yes",
                "EndTime": "0000-00-00 00:00:00",
                "ExpectRunTime": "0000-00-00 00:00:00",
                "ExpireTime": "0000-00-00 00:00:00",
                "InstanceClass": "medium",
                "JobId": "sync-09vy1os1",
                "JobName": "roger_test",
                "Objects": {
                    "Databases": [
                        {
                            "DbMode": "All",
                            "DbName": "db_big",
                            "EventMode": "",
                            "FunctionMode": "",
                            "NewDbName": "",
                            "NewSchemaName": "",
                            "ProcedureMode": "",
                            "SchemaName": "",
                            "TableMode": "All",
                            "TriggerMode": "",
                            "ViewMode": "All"
                        }
                    ],
                    "Mode": "Partial",
                    "OnlineDDL": {
                        "Status": ""
                    }
                },
                "OfflineTime": "0000-00-00 00:00:00",
                "Options": {
                    "AddAdditionalColumn": false,
                    "AutoRetryTimeRangeMinutes": 0,
                    "ConflictHandleOption": {
                        "ConditionColumn": "",
                        "ConditionOperator": "",
                        "ConditionOrderInSrcAndDst": ""
                    },
                    "ConflictHandleType": "Cover",
                    "DdlOptions": null,
                    "DealOfExistSameTable": "ExecuteAfterIgnore",
                    "FilterBeginCommit": false,
                    "FilterCheckpoint": false,
                    "InitType": "Full",
                    "KafkaOption": {
                        "DDLTopicName": "",
                        "DataType": "",
                        "TopicRules": [],
                        "TopicType": ""
                    },
                    "OpTypes": null,
                    "RateLimitOption": {
                        "CurrentDumpRps": 0,
                        "CurrentDumpThread": 8,
                        "CurrentLoadRps": 0,
                        "CurrentLoadThread": 8,
                        "CurrentSinkerThread": 32,
                        "DefaultDumpRps": 0,
                        "DefaultDumpThread": 8,
                        "DefaultLoadRps": 0,
                        "DefaultLoadThread": 8,
                        "DefaultSinkerThread": 32,
                        "HasUserSetRateLimit": "no"
                    }
                },
                "PayMode": "PostPay",
                "RunMode": "Immediate",
                "Specification": "",
                "SrcAccessType": "noProxy",
                "SrcDatabaseType": "mysql",
                "SrcInfo": {
                    "Account": "",
                    "AccountMode": "",
                    "AccountRole": "",
                    "CcnId": "",
                    "CcnOwnerUin": "",
                    "CvmInstanceId": "",
                    "DatabaseNetEnv": "",
                    "DbKernel": "",
                    "DbName": "",
                    "EncryptConn": "",
                    "EngineVersion": "",
                    "InstanceId": "",
                    "Ip": "11.141.232.195",
                    "Password": "",
                    "Port": 3306,
                    "Region": "ap-guangzhou",
                    "Role": "",
                    "RoleExternalId": "",
                    "SubnetId": "",
                    "Supplier": "",
                    "TmpSecretId": "",
                    "TmpSecretKey": "",
                    "TmpToken": "",
                    "UniqDcgId": "",
                    "UniqVpnGwId": "",
                    "User": "root",
                    "VpcId": ""
                },
                "SrcInfos": {
                    "AccessType": "",
                    "DatabaseType": "",
                    "Info": null,
                    "Region": ""
                },
                "SrcNodeType": "single",
                "SrcRegion": "ap-qingyuan",
                "StartTime": "2023-12-19 15:54:18",
                "Status": "Running",
                "Tags": [],
                "TradeStatus": "Normal"
            }
        ],
        "RequestId": "268b0711-a3b2-4692-8c91-88d743bc8b9f",
        "TotalCount": 1
    }
}

5. 开发者资源

腾讯云 API 平台

腾讯云 API 平台 是综合 API 文档、错误码、API Explorer 及 SDK 等资源的统一查询平台,方便您从同一入口查询及使用腾讯云提供的所有 API 服务。

API Inspector

用户可通过 API Inspector 查看控制台每一步操作关联的 API 调用情况,并自动生成各语言版本的 API 代码,也可前往 API Explorer 进行在线调试。

SDK

云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。

命令行工具

6. 错误码

以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码

错误码 描述
AuthFailure.AuthFailureError 认证失败。
AuthFailure.UnauthorizedOperationError 鉴权失败,当前用户不允许执行该操作。
FailedOperation.NotAllowOperation 禁止该操作。
InternalError.DatabaseError 迁移平台数据库访问失败。
InternalError.InternalErrorError 内部错误。
InternalError.ProtocolError 通信协议错误。
InvalidParameter 参数错误。
InvalidParameterValue.InvalidParameterValueError 非法参数。