调用MigrateDBInstance接口迁移专属集群内的RDS实例。

专属集群功能以集群形式批量管理实例,一个地域可以创建多个专属集群,一个专属集群包含多个主机,一个主机包含多个实例。详情请参见专属集群简介

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String MigrateDBInstance

系统规定参数。取值:MigrateDBInstance

DBInstanceId String rm-uf6wjk5xxxxxxx

实例ID。

DedicatedHostGroupId String dhg-4nxxxxxxx

专属集群ID。可调用DescribeDedicatedHostGroups获取。

TargetDedicatedHostIdForMaster String i-bpxxxxxxx1

主实例要迁移的目标主机ID。可调用DescribeDedicatedHosts获取。

TargetDedicatedHostIdForSlave String i-bpxxxxxxx2

备实例要迁移的目标主机ID。可调用DescribeDedicatedHosts获取。

RegionId String cn-hangzhou

地域ID。可以通过接口DescribeRegions查看地域ID。

EffectiveTime String MaintainTime

迁移时间。取值:

  • Immediately:立即切换(默认)
  • MaintainTime:在运维时间段切换
  • Specified:指定时间切换
SpecifiedTime String 2019-10-21T10:00:00Z

指定切换的时间。格式:yyyy-MM-ddTHH:mm:ssZ(UTC时间)。

说明EffectiveTime=Specified时需要填入本参数。
ZoneIdForLog String cn-hangzhou-i

日志节点的可用区ID。

ZoneIdForFollower String cn-hangzhou-h

备节点的可用区ID。

返回数据

名称 类型 示例值 描述
MigrationId Integer 2245016

迁移排队序号。当序号为0时,就会进行迁移切换。

RequestId String 498AE8CA-8C81-4A01-AF37-2B902014ED30

请求ID。

TaskId Integer 108246861

任务ID。

示例

请求示例

http(s)://rds.aliyuncs.com/?Action=MigrateDBInstance
&DBInstanceId=rm-uf6wjk5xxxxxxx
&DedicatedHostGroupId=dhg-4nxxxxxxx
&TargetDedicatedHostIdForMaster=i-bpxxxxxxx1
&TargetDedicatedHostIdForSlave=i-bpxxxxxxx2
&<公共请求参数>

正常返回示例

XML格式

<MigrateDBInstanceResponse>
  <MigrationId>2245016</MigrationId>
  <RequestId>498AE8CA-8C81-4A01-AF37-2B902014ED30</RequestId>
  <TaskId>108246861</TaskId>
</MigrateDBInstanceResponse>

JSON格式

{
	"MigrationId":2245016,
	"RequestId":"498AE8CA-8C81-4A01-AF37-2B902014ED30",
	"TaskId":108246861
}

错误码

HttpCode 错误码 错误信息 描述
400 InvalidTargetDedicatedHostId.NotFound The target dedicated host ID is invalid. 目标专属主机不合法
400 InvalidMasterHostName The specified master host zoneId is different from the master zoneId. 传入的主机所在的zoneId和传入的主可用区ZoneId不一致
404 InsufficientResourceCapacity No host is available for the requested instance. 资源不足,分配失败
404 InvalidParam The specified parameter is invalid. 无效参数
403 OperationDenied.PrimaryDBInstanceStatus The operation is not permitted due to status of primary instance. 主实例状态不支持,实例处于运行态,才能做此操作。
404 InvalidDBInstance.NotFound The specified instance does not exist or is not supported. 指定的实例不存在或不支持。
400 InvalidDBInstanceName.NotFound The specified DB instance name does not exist. 指定DBInstanceId不存在,请检查该参数是否正确。
404 AllocateResourceFailed Failed to allocate resources. Please check the zone and the host you selected. 资源申请失败,请检查所选可用区、主机是否足够分配对应的规格资源。
400 InvalidPrimaryCustinsStatus Primary DBInstance status is not Active. 只读实例所属主实例必须是运行中才可以执行该操作。

访问错误中心查看更多错误码。