Updated on 2024-08-23 GMT+08:00

Querying the Row Comparison Overview

Function

This API is used to query the row comparison overview.

URI

GET /v3/{project_id}/jobs/{job_id}/compare/{compare_job_id}/line-overview

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

For details, see Obtaining a Project ID.

job_id

Yes

String

Task ID.

compare_job_id

Yes

String

ID of a comparison task.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

status

No

Integer

Comparison status.

  • 0: The comparison result is inconsistent.
  • 2: The comparison result is consistent.
  • 3: The destination database table does not exist.
  • 4: The comparison failed.
  • 5: The comparison task is in progress.
  • 6: The comparison task is waiting to be started.
  • 7: The comparison task is canceled.
  • 8: The source database is empty.
  • 9: The destination database is empty.
  • 10: Both the source and destination databases are empty.
  • 11: The source table does not exist.
  • 12: The destination table does not exist.
  • 13: Neither the source table nor the destination table exists.
  • 14: Failed to connect to the source database.
  • 15: Failed to connect to the destination database.
  • 16: SQL execution timed out on the source database.
  • 17: SQL execution timed out on the destination database.
  • 18: A source database SQL execution error occurred.
  • 19: A destination database SQL execution error occurred.
  • 20: Neither the source database nor the destination database exists.
  • 21: The source database does not exist.
  • 22: The destination database does not exist.
  • 23: The number of rows exceeds 100 million, and the comparison cannot be performed.
  • 27: The comparison task timed out.

limit

No

Integer

Number of items displayed per page.

Default value: 1000

offset

No

Integer

Offset, which is the position where the query starts. The value must be no less than 0.

Default value: 0

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

The content type.

The default value is application/json.

X-Auth-Token

Yes

String

User token obtained from IAM.

X-Language

No

String

Request language type.

Default value: en-us

Enumerated values:

  • en-us
  • zh-cn

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total_count

Integer

Number of comparison items.

data_compare_overview_infos

Array of objects

Information list.

For details, see Table 5.

Table 5 Data structure description of field data_compare_overview_infos

Parameter

Type

Description

source_db_name

String

Source database name.

target_db_name

String

Destination database name.

status

Integer

Comparison status.

  • 0: The comparison result is inconsistent.
  • 2: The comparison result is consistent.
  • 3: The destination database table does not exist.
  • 4: The comparison failed.
  • 5: The comparison task is in progress.
  • 6: The comparison task is waiting to be started.
  • 7: The comparison task is canceled.
  • 8: The source database is empty.
  • 9: The destination database is empty.
  • 10: Both the source and destination databases are empty.
  • 11: The source table does not exist.
  • 12: The destination table does not exist.
  • 13: Neither the source table nor the destination table exists.
  • 14: Failed to connect to the source database.
  • 15: Failed to connect to the destination database.
  • 16: SQL execution timed out on the source database.
  • 17: SQL execution timed out on the destination database.
  • 18: A source database SQL execution error occurred.
  • 19: A destination database SQL execution error occurred.
  • 20: Neither the source database nor the destination database exists.
  • 21: The source database does not exist.
  • 22: The destination database does not exist.
  • 23: The number of rows exceeds 100 million, and the comparison cannot be performed.
  • 27: The comparison task timed out.

Example Request

Querying the row comparison overview

https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/f8688cfa-4e05-406f-a2e6-37a773cjb20y/table/compare/48c6acb4-1473-48fd-8676-df3705758c27/line-overview?offset=0&limit=10&status=2

Example Response

Status code: 200

OK

{
  "total_count" : 1,
  "data_compare_overview_infos" : [ {
    "status" : 2,
    "source_db_name" : "my_db",
    "target_db_name" : "my_db"
  } ]
}

Status code: 400

Bad Request

{
  "error_code" : "DRS.M00202",
  "error_msg" : "The value of jobId is invalid."
}

Status Code

Status Code

Description

200

OK

400

Bad Request

Error Code

For details, see Error Code.