Description

This API is used to switch the network type of an instance. An instance can be switched from a classic network to a VPC.

Request parameters

Table 1. Request parameters
Name Type Required Description
<Common request parameters> - Yes For more information, see Public parameters.
Action String Yes Required parameter. Value: SwitchNetwork.
InstanceId String Yes Instance ID (globally unique)
TargetNetworkType String Yes Network type to be switched to.
  • VPC
  • Classic

Currently, an instance can be switched only from a classic network to a VPC. In this case, this parameter must be set to VPC.

VpcId String No Virtual network ID of the switched VPC
VSwitchId String No VSwitch ID of the switched VPC. This parameter must be specified if VpcId is specified.
RetainClassic String No Whether the classic network IP address is retained. Default value: False.
  • True: retained
  • False: not retainedFalse: do not retain
ClassicExpiredDays String No Period to retain the classic network IP address. Unit: day.

Optional values: 14, 30, 60, 120. This parameter must be specified if RetainClassic is set to True.

Response parameters

Table 2. Response parameters
Name Type Description
<Common return parameters> - For more information, see Public return parameters.

Request example

https://r-kvstore.aliyuncs.com
<Common request parameters>
&Action= SwitchNetwork
&InstanceId=fdafas32323ed
& TargetNetworkType=VPC
&VpcId=fadsfa
&VSwitchId=131ed
&RetainClassic=True
&ClassicExpiredDays=30

Response example


"Requestid": "maid"