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

Selecting Database Objects in Batches

Function

This API is used to select the databases or tables to be migrated.

Debugging

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

Constraints

  • Only real-time migration and real-time synchronization support object selection.
  • After a task is created, the task status is CONFIGURATION. The task can be invoked only after the test of connections to the source and destination databases is successful and the API for modifying the task is invoked.
  • You can call a maximum of 10 APIs in batches.

URI

PUT /v3/{project_id}/jobs/batch-select-objects

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

jobs

Yes

Array of objects

Request task ID list for updating database objects in batches.

For details, see Table 4.

Table 4 Data structure description of field jobs

Parameter

Mandatory

Type

Description

job_id

Yes

String

Task ID.

selected

No

Boolean

Whether to select an object. If this parameter is not set, the default value is No.

Yes: Customize the objects to be migrated.

No: Migrate all VMs.

sync_database

No

Boolean

Whether to perform database-level synchronization.

job

No

Array of objects

Data object selection information. This parameter is mandatory when selected is set to true.

For details, see Table 5.

Table 5 Data structure description of field job

Parameter

Mandatory

Type

Description

id

No

String

When object_type is set to database, this parameter indicates the database name. If object_type is set to table or view, set the field value by referring to the example.

parent_id

No

String

Database name. This parameter is mandatory when object_type is set to table or view.

object_type

No

String

Type. Values:

  • database
  • table
  • schema
  • view

object_name

No

String

Database object name, database name, table name, and view name.

select

No

String

Whether to migrate the database objects. true indicates that the database objects will be migrated. false indicates that the database objects will not be migrated. partial indicates some tables in the database will be migrated. If this parameter is not specified, the default value is false.

object_alias_name

No

String

Alias, which is the new mapped name. This parameter is used only for synchronization tasks.

Response Parameters

Status code: 202

Table 6 Response body parameters

Parameter

Type

Description

all_counts

Long

Total number.

results

Array of objects

Response list for selecting objects in batches.

For details, see Table 7.

Table 7 Data structure description of field results

Parameter

Type

Description

job_id

String

Task ID.

status

Boolean

The status that indicates that objects are selected.

error_code

String

Error code.

error_msg

String

Error message.

Example Request

  • Selecting specified databases and tables for migration
    https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-select-objects
    
    {
      "jobs" : [ {
        "job" : [ {
          "id" : "fastunit",
          "parent_id" : null,
          "object_name" : "fastunit",
          "object_type" : "database",
          "select" : "partial",
          "object_alias_name" : null
        }, {
          "id" : "fastunit-*-*-coll",
          "parent_id" : "fastunit",
          "object_name" : "coll",
          "object_type" : "table",
          "select" : "true",
          "object_alias_name" : null
        }, {
          "id" : "ycy1",
          "parent_id" : null,
          "object_name" : "ycy1",
          "object_type" : "database",
          "select" : "partial",
          "object_alias_name" : null
        }, {
          "id" : "ycy1-*-*-coll",
          "parent_id" : "ycy1",
          "object_name" : "coll",
          "object_type" : "table",
          "select" : "true",
          "object_alias_name" : null
        }, {
          "id" : "ycy1-*-*-collcount",
          "parent_id" : "ycy1",
          "object_name" : "collcount",
          "object_type" : "table",
          "select" : "true",
          "object_alias_name" : null
        } ],
        "job_id" : "57fd2692-0ebe-4714-9b59-fe7aa65djb15",
        "selected" : true
      } ]
    }
  • Selecting all objects for migration
    https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-select-objects
    
    {
      "jobs" : [ {
        "job" : [ ],
        "job_id" : "e59f5eef-2bcc-4461-b9ac-10aded44jb15",
        "selected" : false
      } ]
    }

Example Response

Status code: 202

Accepted

{
	"all_counts": 1,
	"results": [{
		"job_id": "4d700f6f-9a17-47e0-a7d6-1bc2155jb101",
		"status": true
	}]
}

Status Code

Status Code

Description

202

Accepted

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