Help Center> Data Replication Service> API Reference> APIs V3.0 (Deprecated)> Public API Management> Querying the Overview of an Object Comparison Task
Updated on 2024-05-27 GMT+08:00

Querying the Overview of an Object Comparison Task

Function

This API is used to query the overview of an object comparison task.

URI

GET /v3/{project_id}/jobs/{job_id}/object/compare

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.

Request Parameters

Table 2 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 3 Response body parameters

Parameter

Type

Description

create_time

String

Time when a comparison task is created. The value is a UTC time, for example, 2024-04-09T07:00:57Z.

start_time

String

Time when a comparison task starts. The value is a UTC time, for example, 2024-04-09T07:00:57Z.

status

String

Status of a comparison task. Value:

  • RUNNING: The comparison task is in progress.
  • WAITING_FOR_RUNNING: The comparison task is waiting to be started.
  • SUCCESSFUL: The comparison task is complete.
  • FAILED: The comparison task fails.
  • CANCELLED: The comparison task is canceled.
  • TIMEOUT_INTERRUPT: The comparison task times out.
  • FULL_DOING: Full verification is in progress.
  • INCRE_DOING: Incremental verification is in progress.

export_status

String

Status of generating a comparison result file. The values are as follows:

  • INIT: indicates that the comparison result export is in the initial status.
  • EXPORTING: indicates that the comparison result is being exported.
  • EXPORT_COMPLETE: indicates that the comparison result is exported.
  • EXPORT_COMMON_FAILED: indicates that the comparison result fails to be exported.

report_remain_seconds

Long

Remaining validity period of a comparison result file, in seconds. If the report is not generated, -1 is returned.

compare_job_id

String

ID of a comparison task.

error_msg

String

Failure cause.

compare_result

Array of objects

Comparison result.

For details, see Table 4.

Table 4 Data structure description of field compare_result

Parameter

Type

Description

type

String

Object type. The values are as follows:

  • DB: indicates a database.
  • TABLE: indicates a table.
  • VIEW: indicates a view.
  • EVENT: indicates an event.
  • ROUTINE: indicates a stored procedure and function.
  • INDEX: indicates an index.
  • TRIGGER: indicates a trigger.
  • SYNONYM: indicates a synonym.
  • FUNCTION: indicates a function.
  • PROCEDURE: indicates a stored procedure.
  • TYPE: indicates a user-defined type.
  • RULE: indicates a rule.
  • DEFAULT_TYPE: indicates a default value.
  • PLAN_GUIDE: indicates an execution plan.
  • CONSTRAINT: indicates a constraint.
  • FILE_GROUP: indicates a file group.
  • PARTITION_FUNCTION: indicates a partition function.
  • PARTITION_SCHEME: indicates a partition scheme.
  • TABLE_COLLATION: indicates table collation.
  • EXTENSIONS: indicates a plug-in.

source_count

Long

Number of objects of this type in the source database.

target_count

Long

Number of objects of this type in the destination database.

status

Integer

Comparison result. The value 0 indicates that the result is inconsistent, the value 2 indicates that the result is consistent, and the value 3 indicates the comparison is incomplete.

Example Request

Querying the overview of an object comparison task

https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/f8688cfa-4e05-406f-a2e6-37a773cjb20y/object/compare

Example Response

Status code: 200

OK

{
  "status" : "SUCCESSFUL",
  "create_time" : "2024-04-02T06:17:56Z",
  "compare_result" : [ {
    "type" : "DB",
    "status" : 2,
    "source_count" : 2,
    "target_count" : 2
  }, {
    "type" : "TABLE",
    "status" : 2,
    "source_count" : 2,
    "target_count" : 2
  }, {
    "type" : "INDEX",
    "status" : 2,
    "source_count" : 2,
    "target_count" : 2
  }, {
    "type" : "TABLE_COLLATION",
    "status" : 2,
    "source_count" : 2,
    "target_count" : 2
  } ],
  "start_time" : "2024-04-02T06:17:49Z",
  "export_status" : "INIT",
  "report_remain_seconds" : -1,
  "compare_job_id" : "bfcdc4d9-f0ae-4108-be42-6974d60cd1d2"
}

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.