Updated on 2024-05-27 GMT+08:00

Querying Value Comparison Details

Function

This API is used to query value comparison details.

URI

GET /v3/{project_id}/jobs/{job_id}/compare/{compare_job_id}/content-detail

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

target_db_name

No

String

Destination database name.

db_name

No

String

Source database name.

type

No

String

Type. compare: Items that can be compared. unCompare: Items that cannot be compared.

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

Comparison quantity.

content_compare_result_infos

Array of objects

Comparison information list.

For details, see Table 5.

Table 5 Data structure description of field content_compare_result_infost

Parameter

Type

Description

source_db

String

Source database name.

target_db

String

Destination database name.

source_table_name

String

Table name of the source database.

target_table_name

String

Table name of the destination database.

source_row_num

Long

Number of table rows in the source database.

target_row_num

Long

Number of table rows in the destination database.

difference_row_num

Long

Difference between the tables in the source and destination databases.

line_compare_result

Boolean

Row comparison result.

  • true: consistent.
  • false: inconsistent.

content_compare_result

Boolean

Value comparison result.

  • true: consistent.
  • false: inconsistent.

message

String

Additional information.

compare_line_config_filter

String

Row filtering condition.

Example Request

Querying value comparison details

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

Example Response

Status code: 200

OK

{
  "total_count" : 2,
  "content_compare_result_infos" : [ {
    "source_db" : "db2",
    "source_table_name" : "tb2",
    "source_row_num" : 2434882,
    "target_db" : "db2",
    "target_table_name" : "tb2",
    "target_row_num" : 2434882,
    "difference_row_num" : 0,
    "line_compare_result" : true,
    "content_compare_result" : true
  }, {
    "source_db" : "db1",
    "source_table_name" : "tb1",
    "source_row_num" : 1,
    "target_db" : "db1",
    "target_table_name" : "tb1",
    "target_row_num" : 1,
    "difference_row_num" : 0,
    "line_compare_result" : true,
    "content_compare_result" : true
  } ]
}

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.