Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating a Comparison Task

Function

This API is used to create a comparison task

Debugging

You can debug the API in API Explorer to support automatic authentication. API Explorer can automatically generate and debug example SDK code.

Constraints

In the current version, a comparison task can be created only when the task is in the INCRE_TRANSFER_STARTED state. The parent task cannot call the API.

URI

POST /v3/{project_id}/jobs/create-compare-task

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region

For details about how to obtain the project ID, see Obtaining a Project 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

Values:

  • en-us
  • zh-cn
Table 3 Request body parameters

Parameter

Mandatory

Type

Description

job_id

Yes

String

Task ID.

object_level_compare_type

No

String

Object-level comparison type. If the value is empty, the object-level comparison is not created. If both object_level_compare_type and data_level_compare_info are left empty, only the created comparison task list is queried.

Value: objects

data_level_compare_info

No

Object

Data-level comparison information. If no data-level comparison is created, this parameter does not need to be transferred. If both object_level_compare_type and data_level_compare_info are left empty, only the created comparison task list is queried.

For details, see Table 4.

Table 4 Data structure description of field data_level_compare_info

Parameter

Mandatory

Type

Description

conflict_policy

Yes

String

Only one unfinished data-level comparison task can exist. This field determines how to process unfinished data-level comparison tasks. cancel: Cancel the unfinished task and create a new one. keep: Retain the unfinished task.

Values:

  • cancel
  • keep

compare_type

Yes

String

Data-level comparison type. lines: indicates row comparison. contents: indicates value comparison.

Values:

  • lines
  • contents
    NOTE:

    Object-level comparison and value comparison cannot be performed at the same time.

compare_mode

No

String

Data-level comparison mode. If the value is empty, the object information needs to be transferred in compare_object_infos or compare_object_infos_with_token. quick_comparison: indicates quick comparison, which can be used only by whitelisted users.

Default value: quick_comparison

Value: quick_comparison

start_time

No

String

Start time of a comparison task. If the value is empty, the task is started immediately.

compare_object_infos

No

Array of objects

Data-level comparison object. In non-quick comparison mode, either compare_object_infos or compare_object_infos_with_token must be specified based on the migration scenario.

For details, see Table 5.

compare_object_infos_with_token

No

Array of objects

Object for data-level comparison (Cassandra DR only, with token information). In non-quick comparison mode, either compare_object_infos or compare_object_infos_with_token must be specified based on the migration scenario.

For details, see Table 6.

Table 5 Data structure description of field compare_object_infos

Parameter

Mandatory

Type

Description

db_name

Yes

String

Database name.

table_name

No

Array of strings

List of table names in the database.

Table 6 Data structure description of field compare_object_infos_with_token

Parameter

Mandatory

Type

Description

db_name

Yes

String

Database name.

table_name_with_token

No

Array of objects

List of tables (with tokens) in the database.

For details, see Table 7.

Table 7 Data structure description of field table_name_with_token

Parameter

Mandatory

Type

Description

table_name

Yes

String

Table name

min_token

No

String

Min token of a table.

max_token

No

String

Max token of a table.

Response Parameters

Status code: 200

Table 8 Response body parameters

Parameter

Type

Description

job_id

String

Task ID

object_level_compare_create_result

Object

Result of creating an object-level comparison task.

For details, see Table 9.

data_level_compare_create_result

Object

Result of creating a data-level comparison task.

For details, see Table 9.

error_code

String

Error code.

error_msg

String

Error message.

Table 9 Data structure description of fields object_level_compare_create_result and data_level_compare_create_result

Parameter

Type

Description

compare_task_id

String

After the comparison task is created, the ID of the comparison task is returned for querying the result of the comparison task.

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Creating object-level comparison and data-level row comparison tasks

https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/create-compare-task

{
  "job_id" : "94800607-3cd8-4f7d-a340-63a10f8jb502",
  "object_level_compare_type" : "objects",
  "data_level_compare_info" : {
    "conflict_policy" : "keep",
    "compare_type" : "lines",
    "compare_mode" : null,
    "start_time" : null,
    "compare_object_infos" : [ {
      "db_name" : "may_5",
      "table_name" : [ "table_name_0", "table_name_1" ]
    } ]
  }
}

Example Response

Status code: 200

OK

{
  "job_id" : "94800607-3cd8-4f7d-a340-63a10f8jb502",
  "object_level_compare_create_result" : {
    "compare_task_id" : "dc1683d9-bdf2-4be9-967f-6ef0953369bc"
  },
  "data_level_compare_create_result" : {
    "compare_task_id" : "08cad1f8-9de2-42fa-b8ce-6c36daf730f6"
  }
}

Status Code

Status Code

Description

200

OK

400

Bad Request

Error Code

For details, see Error Code.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback