Modifies the attributes of a Virtual Private Cloud (VPC). When you call this interface, consider the following:
- For more information about the APIs for VPC, see API Reference of VPC.
- The ECS instance must be in the
Stoppedstatus before the VSwitch can be changed.
- A new instance must have been started and stopped before you call this interface.
- The VPC attributes of an instance that have been modified once must have been started and stopped before you call this interface again.
- When VPC attributes are modified for a specified
VSwitchIdmust belong to the same VPC.
- The current VSwitch and new VSwitch of the specified instance must belong to the same zone.
VSwitchIdis specified and
PrivateIpAddressis not specified, the system automatically allocates a private IP address for your ECS instance.
- When both
PrivateIpAddressare specified, the specified
PrivateIpAddressmust be in the network segment of the specified VSwitch. You must specify the
VSwitchIdwhen you modify the
PrivateIpAddressof your instance.
|Action||String||Yes||The name of this interface. Value: ModifyInstanceVpcAttribute.|
|InstanceId||String||Yes||The specified instance ID.|
|VSwitchId||String||Yes||ID of a new VSwitch. Only VSwitches in the same zone can be changed.|
|PrivateIpAddress||String||No||New private IP addresses of your instance. You must specify the |
All parameters are common response parameters. For more information, see Common parameters.
&<Common Request Parameters>
|Error code||Error message||HTTP status code||Meaning|
|IncorrectInstanceStatus||The current status of the instance does not support this operation.||400||Only an instance in Stopped status supports this operation.|
|InvalidPrivateIp.Changing||Previous action is not finished yet.||400||The private IP address cannot be modified because the previous modification is not finished yet.|
|InvalidPrivateIp.Changing||Specified private IP address is not in the CIDR block of the virtual switch.||400||The private IP address is being modified by the instance (the private IP address can be modified only when the instance is stopped).|
|InvalidPrivateIpAddress.Duplicated||Specified private IP address is duplicated.||400||The specified private IP address is already in use.|
|InvalidPrivateIpAddress.Malformed||Specified private IP address is malformed.||400||The specified private IP address is invalid.|
|InvalidPrivateIpAddress.Mismatch||Specified private IP address is not in the CIDR block of virtual switch.||400||The specified private IP address is not in the network segment of the specified VSwitch.|
|InvalidVSwitchId.Mismatch||Specified instance and virtual switch are not in the same zone.||400||The specified instance and VSwitch are not in the same zone.|
|OperationDenied||Specified operation is denied as your instance is not in the VPC.||400||The instance is not in the VPC.|
|InvalidInstanceId.NotFound||The specified InstanceId does not exist.||404||The specified ECS instance does not exist.|
|InvalidVSwitchId.NotFound||Specified virtual switch does not exist.||404||The specified VSwitch ID does not exist.|
|InvalidVSwitchId.NotFound||Specified virtual switch is not found in the current VPC.||404||The specified VSwitch of the instance cannot be modified because it is not found in the current VPC.|