The method of modifying the VPC attribute of an ECS instance proprietary network
How to modify the VPC properties of an ECS instance's proprietary network? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!
ModifyInstanceVpcAttribute
Description
You can only modify the VPC property of an ECS instance in the stopped (Stopped) state.
The newly created ECS instance must go through a round of startup and stop before calling this API.
ECS instances that have successfully modified the VPC property must go through a round of starts and stops before calling the interface.
Specifies that when VSwitchId modifies the VPC property, the specified VSwitchId must belong to the current private network.
When the specified VSwitchId does not specify PrivateIpAddress, the system automatically assigns a private network IP to the ECS instance.
The current switch and the new switch (VSwitchId) of the specified instance must belong to the availability zone in the same region.
The current switch and the new switch (VSwitchId) of the specified instance must belong to the same VPC.
When you specify both VSwitchId and PrivateIpAddress, the VPC IP belongs to the IP address range of the specified switch. PrivateIpAddress depends on VSwitchId, and PrivateIpAddress cannot be specified separately.
For more VPC-related interfaces, see the API reference for proprietary Networks (VPC).
Request parameter
Return parameters
All are common return parameters. See common parameters
Example
Request example
Https://ecs.aliyuncs.com/?Action=ModifyInstanceVpcAttribute&InstanceId=35F20777-0DFF-C152-41FA-BCE0EA0B2FD7&VSwitchId=[vswitchid]&
Return the example
XML format
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83EJSON format {"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"}
Error code
The following are the error codes specific to this API. For more error codes, please visit the API error Center.
Thank you for reading! After reading the above, do you have a general idea of how to modify the VPC properties of an ECS instance's proprietary network? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.