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

Querying Value Comparison Differences

Function

This API is used to query value comparison differences.

URI

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

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

table_name

No

String

Table name.

db_name

No

String

Source database name.

limit

No

Integer

Number of records displayed on each page. The maximum value is 1000.

Minimum value: 1

Maximum value: 1000

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

count

Long

Total number of records.

target_meta_is_null

Long

Inconsistency details: The objects were found only in the source database.

source_meta_is_null

Long

Inconsistency details: The objects were found only in the destination database.

source_target_meta_not_null

Long

Inconsistency details: The objects were found in the source and destination databases.

contents_infos

Array of objects

List of detailed information.

For details, see Table 5.

Table 5 Data structure description of field contents_infos

Parameter

Type

Description

source_key_value

Array of strings

Key value list of the source database.

target_key_value

Array of strings

Key value list of the destination database.

select_sql

String

Query the SQL statements of the source database.

target_select_sql

String

Query the SQL statements of the destination database.

Example Request

Querying value comparison differences

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

Example Response

Status code: 200

OK

{
  "count" : 1,
  "target_meta_is_null" : 0,
  "source_meta_is_null" : 0,
  "source_target_meta_not_null" : 1,
  "contents_infos" : [ {
    "source_key_value" : [ "id=5" ],
    "target_key_value" : [ "id=5" ],
    "select_sql" : "select * from db1.tb1 where id=5",
    "target_select_sql" : "select * from db1.tb1 where id=5"
  } ]
}

Status code: 400

Bad Request

{
  "error_code" : "DRS.10000010",
  "error_msg" : "Task not found. Check the task ID."
}

Status Code

Status Code

Description

200

OK

400

Bad Request

Error Code

For details, see Error Code.