edit-icon download-icon


Last Updated: Mar 19, 2018


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

Name Type Required Description
Common request parameters - Yes For more information, see Common request parameters.
Action String Yes Required parameter. Value: SwitchNetwork.
InstanceId String Yes Instance ID (globally unique)
TargetNetworkType String Yes Network type to be switched to.
- 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 retained
ClassicExpiredDays String No Period to retain the classic network IP address. Unit: day.
Supported values: 14, 30, 60, and 120. This parameter must be specified if RetainClassic is set to True.

Response parameters

Name Type Description
Common return parameters - For more information, see Common return parameters.


Request example

  1. https://r-kvstore.aliyuncs.com
  2. ?<Common request parameters>
  3. &Action= SwitchNetwork
  4. &InstanceId=fdafas32323ed
  5. &TargetNetworkType=VPC
  6. &VpcId=fadsfa
  7. &VSwitchId=131ed
  8. &RetainClassic=True
  9. &ClassicExpiredDays=30

Response example

  1. {
  2. "RequestId" : "AAAF99B1-69ED-4E80-8CD5-272C09E46ACF"
  3. }
Thank you! We've received your feedback.