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

Performing Primary/Standby Switchovers in Batches

Function

This API is used to perform primary/standby switchovers in batches.

Debugging

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

Constraints

This API only applies to tasks in the Disaster recovery in progress or Disaster recovery failed status. A switchover can be performed when the DR database can be properly connected. Dual-active DR does not support the switchover.

URI

POST /v3/{project_id}/jobs/batch-switchover

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 strings

IDs of batch primary/standby switchover tasks.

Response Parameters

Status code: 202

Table 4 Response body parameters

Parameter

Type

Description

results

Array of objects

Returned of batch primary/standby switchover tasks.

For details, see Table 5.

count

Integer

Total number.

Table 5 Data structure description of field results

Parameter

Type

Description

job_id

String

Task ID.

updated_at

String

Update time, in the format yyyy-MM-dd'T'HH:mm:ss'Z'.

source_db

Object

Source database.

For details, see Table 6.

target_db

Object

Destination database.

For details, see Table 6.

job_direction

String

Task direction. Values:

  • up: The current cloud is the standby cloud in the DR and to-the-cloud scenarios.
  • down: The current cloud is the active cloud in the DR and out-of-cloud scenarios.
  • non-dbs: self-built databases.

is_target_readonly

Boolean

Whether the destination database is read-only.

error_msg

String

Error message

error_code

String

Error code

Table 6 Data structure description of fields source_db and target_db

Parameter

Type

Description

id

String

Database ID.

obj_id

String

Object ID

instance_name

String

Name of the RDS DB instance.

db_type

String

Database type. Values:

  • mysql
  • mongodb

db_user

String

Database user.

db_password

String

Database password.

manage_ip

String

Management IP address.

traffic_ip

String

Traffic IP address.

db_port

Integer

Database port.

region

String

Region where the RDS DB instance is located.

created_at

String

Creation date, in the format yyyy-MM-dd'T'HH:mm:ss'Z'.

updated_at

String

Modification date, in the format yyyy-MM-dd'T'HH:mm:ss'Z'.

ip

String

Private IP address of the replication instance.

public_ip

String

EIP of the replication instance.

az_code

String

AZ code.

security_group_id

String

ID of the security group to which the source database belongs.

subnet_id

String

ID of the subnet where the source database is located.

vpc_id

String

ID of the VPC where the source database is located.

volume_size

Long

Storage space of a replication instance.

full_trans_user_pwd

String

Ciphertext password of the user for full migration.

increment_trans_user_pwd

String

Ciphertext password of the incremental migration user.

ssl_link

Boolean

Whether SSL is enabled.

ssl_cert_key

String

SSL certificate content.

ssl_cert_name

String

SSL certificate name.

ssl_cert_check_sum

String

Checksum value of the SSL certificate content.

ssl_cert_password

String

SSL certificate password, in ciphertext.

db_version

String

Database version.

mongo_ha_mode

String

Mongo HA mode. Values:

  • Sharding: cluster.
  • ReplicaSet: replica set.
  • ReplicaSingle: single node.

project_id

String

Project ID of an RDS DB instance.

cluster_mode

String

Cluster mode. Values:

  • Single: single-node RDS.
  • Ha: primary and standby RDS.
  • GR: RDS Finance Edition.
  • Sharding: MongoDB cluster or DDM mode. The default value is Sharding.
  • ReplicaSet: MongoDB replica set.
  • Replica: RDS read replica.
  • ReplicaSingle: MongoDB single node.
  • Cluster: cluster.
  • Independent: GaussDB independent mode.
  • Combined: GaussDB combined mode.
  • Distributed: TaurusDB distributed.

instance_id

String

RDS DB instance ID.

db_name

String

Oracle service name.

topic

String

Name of the mrskafka topic.

safe_mode

Integer

Whether to enable Kerberos authentication for MRSKafka. Values:

  • 0: non-security authentication.
  • 1: security authentication.

kerberos_vo

Object

Information required for Kerberos authentication.

For details, see Table 7.

multi_write_db_id

String

ID of the multi-write database.

Table 7 Data structure description of field kerberos_vo

Parameter

Type

Description

krb5_conf_file

String

krb5 configuration file.

key_tab_file

String

Key file.

domain_name

String

Domain name.

user_principal

String

Kerberos user object.

Example Request

Performing primary/standby switchovers in batches

https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-switchover

{
  "jobs" : [ "8d0e8e36-a618-490d-8a46-8c61ac9jb502" ]
}

Example Response

Status code: 202

Accepted

{
  "count" : 1,
  "results" : [ {
    "job_id" : "8d0e8e36-a618-490d-8a46-8c61ac9jb502",
    "updated_at" : "2020-12-18T06:38:37Z",
    "source_db" : {
      "id" : "2706a49b-6dd0-4b70-b2a8-36cf0034703d",
      "region" : "cn-xianhz-1",
      "ip" : "192.168.1.144",
      "topic" : null,
      "obj_id" : "0b51710fd4e54d6bb90ab91bf68f86efno01",
      "instance_name" : "rds-zw-source",
      "db_type" : "mysql",
      "db_user" : "root",
      "db_password" : "********",
      "manage_ip" : null,
      "traffic_ip" : "192.168.1.144",
      "db_port" : 3306,
      "created_at" : "2020-12-16T12:09:54Z",
      "updated_at" : "2020-12-18T06:33:09Z",
      "public_ip" : null,
      "az_code" : "az3xahz",
      "security_group_id" : "652cbe2d-d487-407e-b666-d01948b33879",
      "subnet_id" : "c6f66ccb-be7a-499e-aa8a-1389355e67a8",
      "vpc_id" : "7c73a425-885b-4e54-a0e6-ef9ee271a1db",
      "volume_size" : null,
      "full_trans_user_pwd" : "******",
      "increment_trans_user_pwd" : "******",
      "ssl_link" : false,
      "ssl_cert_key" : null,
      "ssl_cert_name" : null,
      "ssl_cert_check_sum" : null,
      "ssl_cert_password" : null,
      "db_version" : "5.7.31",
      "mongo_ha_mode" : null,
      "project_id" : "054ba152d480d55b2f5dc0069e7ddef0",
      "cluster_mode" : "Single",
      "instance_id" : "3efbb0f1241f429e8e1d8f99ab094c7ain01",
      "db_name" : null,
      "safe_mode" : null,
      "kerberos_vo" : null,
      "multi_write_db_id" : null
    },
    "target_db" : {
      "id" : "81ca3c57-029b-4a37-8f2d-2ee5f128ef9d",
      "region" : "cn-xianhz-1",
      "ip" : "192.168.1.60",
      "topic" : null,
      "obj_id" : "b46e908dbbb44bb3b17f0a75c908d1d7no01",
      "instance_name" : "rds-zw-target",
      "db_type" : "mysql",
      "db_user" : "root",
      "db_password" : "********",
      "manage_ip" : null,
      "traffic_ip" : "192.168.1.60",
      "db_port" : 3306,
      "created_at" : "2020-12-16T12:09:55Z",
      "updated_at" : "2020-12-18T06:33:08Z",
      "public_ip" : null,
      "az_code" : "az3xahz",
      "security_group_id" : "652cbe2d-d487-407e-b666-d01948b33879",
      "subnet_id" : "c6f66ccb-be7a-499e-aa8a-1389355e67a8",
      "vpc_id" : "7c73a425-885b-4e54-a0e6-ef9ee271a1db",
      "volume_size" : 40,
      "full_trans_user_pwd" : "******",
      "increment_trans_user_pwd" : "******",
      "ssl_link" : false,
      "ssl_cert_key" : null,
      "ssl_cert_name" : null,
      "ssl_cert_check_sum" : null,
      "ssl_cert_password" : null,
      "db_version" : "5.7.31",
      "mongo_ha_mode" : null,
      "project_id" : "054ba152d480d55b2f5dc0069e7ddef0",
      "cluster_mode" : "Single",
      "instance_id" : "a3ab61173b1b4533b8c3dfc2bb3ec828in01",
      "db_name" : null,
      "safe_mode" : null,
      "kerberos_vo" : null,
      "multi_write_db_id" : null
    },
    "job_direction" : "down",
    "is_target_readonly" : false
  } ]
}

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