调用DescribeDtsServiceLog查询一个数据迁移或同步任务的日志信息。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String DescribeDtsServiceLog

系统规定参数,取值:DescribeDtsServiceLog

DtsJobId String c1yr56py103****

迁移或同步任务ID。

PageSize Integer 20

每页记录的日志信息的数量,取值:20501005001000,默认值为20

PageNumber Integer 1

指定页码,取值为大于0且不超过Integer数据类型的最大值,默认值为1

StartTime Long 1620896327000

日志信息的起始时间。

说明
  • 如需查询特定时间范围内DTS子任务执行的日志信息,您可以调用DescribePreCheckStatus查询DTS子任务的执行时间。
  • 起始时间的格式为13位Unix时间戳,单位为毫秒。Unix时间戳转换工具可用搜索引擎获取。
EndTime Long 1620897227000

日志信息的截止时间,您可以调用DescribePreCheckStatus进行查询。

说明
  • 如需查询特定时间范围内DTS子任务执行的日志信息,您可以调用DescribePreCheckStatus查询DTS子任务的执行时间。
  • 起始时间的格式为13位Unix时间戳,单位为毫秒。Unix时间戳转换工具可用搜索引擎获取。
Status String NORMAL,WARN,ERROR

日志信息的日志级别,多个状态以英文逗号(,)分隔,取值为:

  • NORMAL:正常。
  • WARN:报警。
  • ERROR:报错。
SubJobType String SYNC_WRITER

DTS任务的具体子任务类型,取值为:

  • DATA_LOAD:全量迁移或全量同步。
  • ONLINE_WRITER:增量迁移。
  • SYNC_WRITER:增量同步。
Keyword String state = IDLE

传入关键词,指定查询内容。

说明 模糊匹配且区分大小写。
RegionId String cn-hangzhou

地域ID,传入本参数来指定实例所在地域,详情请参见支持的地域列表

返回数据

名称 类型 示例值 描述
DynamicCode String 403

动态错误码,本参数即将下线。

DynamicMessage String DtsJobId

动态错误信息,用于替换返回参数ErrMessage错误信息中的%s

ErrCode String InternalError

调用出错时返回的错误码。

ErrMessage String The Value of Input Parameter %s is not valid.

调用错误时返回的错误信息。

HttpStatusCode Integer 200

状态码。

PageNumber Integer 1

当前页码。

PageRecordCount Integer 20

每页记录的日志信息的数量。

RequestId String F87DF250-952C-47FE-8A02-69414FAA****

请求ID。

ServiceLogContexts Array of ServiceLogContext

任务日志信息详情。

Context String Statistics: generator = 369173; collector = 470109; replicator = 2470; ping = 2/2/2; execute = 29/29/29; rt = 29/29/29; state = IDLE; queries = -1; exceptions = {connects = 0, replicates = 0}; infos = {}

具体的日志信息。

State String NORMAL

日志信息的状态。

Time String 2021-05-13T09:13:39.443+00:00

日志采集时间,格式为yyyy-MM-ddTHH:mm:ssZ(UTC时间)。

Success Boolean true

请求是否成功。

TotalRecordCount Long 35

符合条件的日志信息的总数。

示例

请求示例

http(s)://dts.aliyuncs.com/?Action=DescribeDtsServiceLog
&DtsJobId=c1yr56py103****
&StartTime=1620896327000
&EndTime=1620897227000
&SubJobType=SYNC_WRITER
&<公共请求参数>

正常返回示例

XML格式

<DescribeDtsServiceLogResponse>
      <requestId>F87DF250-952C-47FE-8A02-69414FAA****</requestId>
      <success>true</success>
      <httpStatusCode>200</httpStatusCode>
      <pageNumber>1</pageNumber>
      <pageRecordCount>20</pageRecordCount>
      <totalRecordCount>35</totalRecordCount>
      <serviceLogContexts>
            <context>Statistics: generator = 369173; collector = 470109; replicator = 2470; ping = 2/2/2; execute = 29/29/29; rt = 29/29/29; state = IDLE; queries = -1; exceptions = {connects = 0, replicates = 0}; infos = {}</context>
            <state>NORMAL</state>
            <time>2021-05-13T09:13:39.443+00:00</time>
      </serviceLogContexts>
      <serviceLogContexts>
            <context>Statistics: generator = 368934; collector = 469795; replicator = 2470; ping = 2/2/2; execute = 29/29/29; rt = 29/29/29; state = IDLE; queries = -1; exceptions = {connects = 0, replicates = 0}; infos = {}</context>
            <state>NORMAL</state>
            <time>2021-05-13T09:10:53.275+00:00</time>
      </serviceLogContexts>
      <serviceLogContexts>
            <context>Statistics: generator = 368702; collector = 469492; replicator = 2470; ping = 2/2/2; execute = 29/29/29; rt = 29/29/29; state = IDLE; queries = -1; exceptions = {connects = 0, replicates = 0}; infos = {}</context>
            <state>NORMAL</state>
            <time>2021-05-13T09:08:08.855+00:00</time>
      </serviceLogContexts>
      <serviceLogContexts>
            <context>Statistics: generator = 368456; collector = 469180; replicator = 2470; ping = 2/2/2; execute = 29/29/29; rt = 29/29/29; state = IDLE; queries = -1; exceptions = {connects = 0, replicates = 0}; infos = {}</context>
            <state>NORMAL</state>
            <time>2021-05-13T09:05:22.343+00:00</time>
      </serviceLogContexts>
      <serviceLogContexts>
            <context>Statistics: generator = 368222; collector = 468877; replicator = 2470; ping = 2/2/2; execute = 29/29/29; rt = 29/29/29; state = IDLE; queries = -1; exceptions = {connects = 0, replicates = 0}; infos = {}</context>
            <state>NORMAL</state>
            <time>2021-05-13T09:02:37.851+00:00</time>
      </serviceLogContexts>
      <serviceLogContexts>
            <context>Statistics: generator = 367988; collector = 468571; replicator = 2470; ping = 2/2/2; execute = 29/29/29; rt = 29/29/29; state = IDLE; queries = -1; exceptions = {connects = 0, replicates = 0}; infos = {}</context>
            <state>NORMAL</state>
            <time>2021-05-13T08:59:51.070+00:00</time>
      </serviceLogContexts>
</DescribeDtsServiceLogResponse>

JSON格式

{
    "requestId": "F87DF250-952C-47FE-8A02-69414FAA****",
    "success": true,
    "httpStatusCode": 200,
    "pageNumber": 1,
    "pageRecordCount": 20,
    "totalRecordCount": 35,
    "serviceLogContexts": [
        {
            "context": "Statistics: generator = 369173; collector = 470109; replicator = 2470; ping = 2/2/2; execute = 29/29/29; rt = 29/29/29; state = IDLE; queries = -1; exceptions = {connects = 0, replicates = 0}; infos = {}",
            "state": "NORMAL",
            "time": "2021-05-13T09:13:39.443+00:00"
        },
        {
            "context": "Statistics: generator = 368934; collector = 469795; replicator = 2470; ping = 2/2/2; execute = 29/29/29; rt = 29/29/29; state = IDLE; queries = -1; exceptions = {connects = 0, replicates = 0}; infos = {}",
            "state": "NORMAL",
            "time": "2021-05-13T09:10:53.275+00:00"
        },
        {
            "context": "Statistics: generator = 368702; collector = 469492; replicator = 2470; ping = 2/2/2; execute = 29/29/29; rt = 29/29/29; state = IDLE; queries = -1; exceptions = {connects = 0, replicates = 0}; infos = {}",
            "state": "NORMAL",
            "time": "2021-05-13T09:08:08.855+00:00"
        },
        {
            "context": "Statistics: generator = 368456; collector = 469180; replicator = 2470; ping = 2/2/2; execute = 29/29/29; rt = 29/29/29; state = IDLE; queries = -1; exceptions = {connects = 0, replicates = 0}; infos = {}",
            "state": "NORMAL",
            "time": "2021-05-13T09:05:22.343+00:00"
        },
        {
            "context": "Statistics: generator = 368222; collector = 468877; replicator = 2470; ping = 2/2/2; execute = 29/29/29; rt = 29/29/29; state = IDLE; queries = -1; exceptions = {connects = 0, replicates = 0}; infos = {}",
            "state": "NORMAL",
            "time": "2021-05-13T09:02:37.851+00:00"
        },
        {
            "context": "Statistics: generator = 367988; collector = 468571; replicator = 2470; ping = 2/2/2; execute = 29/29/29; rt = 29/29/29; state = IDLE; queries = -1; exceptions = {connects = 0, replicates = 0}; infos = {}",
            "state": "NORMAL",
            "time": "2021-05-13T08:59:51.070+00:00"
        }
    ]
}

错误码

访问错误中心查看更多错误码。