すべてのプロダクト
Search
ドキュメントセンター

:Change VPC or vSwitch

最終更新日:Mar 07, 2025

You can call the SwitchDBInstanceVpc operation to change the virtual private cloud (VPC) or vSwitch of an ApsaraDB RDS instance.

The instance must run one of the following database engines:

  • MySQL with local SSDs, standard SSDs, or enhanced SSDs (ESSDs)
  • SQL Server with standard SSDs or ESSDs
  • MariaDB TX with standard SSDs or ESSDs
  • PostgreSQL with standard SSDs or ESSDs

For more information about the impact of VPC and vSwitch changes, see Switch an ApsaraDB RDS for MySQL instance to a new VPC and a new vSwitch.

デバッグ

OpenAPI Explorer は署名値を自動的に計算します。 この操作は、OpenAPI Explorer で呼び出すことを推奨します。 OpenAPI Explorer は、さまざまな SDK に対して操作のサンプルコードを動的に生成します。

リクエストパラメーター

項目 データ型 必須/任意 例: 説明 
操作 String 必須 SwitchDBInstanceVpc

実行する操作です。 Set the value to SwitchDBInstanceVpc.

DBInstanceId String 必須 rm-uf6wjk5*******

インスタンスの ID です。

説明
  • The instance must run one of the following database engines:
    • MySQL with local SSDs, standard SSDs, or ESSDs
    • SQL Server with standard SSDs or ESSDs
    • MariaDB TX with standard SSDs or ESSDs
    • PostgreSQL with standard SSDs or ESSDs
  • The instance must be in the Running state.
  • The instance must reside in a VPC.
  • The instance cannot be a temporary instance or use an instance type in the shared instance family.
VPCId String 任意 vpc-uf6f7l4fg90**********

VPC の ID です。

説明 The VPC must belong to the same region as the instance.
VSwitchId String 任意 vsw-uf6adz52c2p**********

VSwitch の ID です。

説明 The vSwitch must belong to the same zone as the instance.
PrivateIpAddress String 任意 10.23.**.**

インスタンスのプライベート IP アドレス。 The private IP address must be within the CIDR block of the vSwitch that is specified by the VSwitchId parameter.

説明 You can call the DescribeVSwitches operation to query the CIDR block of a specified vSwitch.

レスポンスパラメーター

項目 データ型 例: 説明 
RequestId String 777C4593-8053-427B-99E2-10xxxxxxxxxx

リクエストの ID です。

リクエストの例

http(s)://rds.aliyuncs.com/?Action=SwitchDBInstanceVpc
&DBInstanceId=rm-uf6wjk5xxxxxxx	 
&VPCId=vpc-uf6f7l4fg90xxxxxxxxxx
&VSwitchId=vsw-uf6adz52c2pxxxxxxxxxx
&<Common request parameters>

正常に処理された場合のレスポンス例

XML 形式

HTTP/1.1 200 OK
Content-Type:application/xml

<RequestId>777C4593-8053-427B-99E2-10xxxxxxxxxx	 </RequestId>

JSON 形式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "777C4593-8053-427B-99E2-10xxxxxxxxxx"
}

エラーコード

HTTP ステータスコード エラーコード エラーメッセージ 説明 
400 MigrateAlreadyExistsFault Duplicate migration is forbidden. The error message returned because a duplicate migration task is found.
400 InvalidInstanceKind.NotSupport The instance kind does not support this operation. The error message returned because the operation is not supported by the configuration of the instance.
400 InvalidPrivateIpAddress.Mismatch 指定されたプライベート IP アドレスは仮想スイッチの CIDR ブロックにありません。 指定された PrivateIpAddress パラメーターが無効な場合に返されるエラーメッセージ。

エラーコードリストについては、「API エラーセンター」をご参照ください。