Converts the public IP address of an Elastic Compute Service (ECS) instance located in a virtual private cloud (VPC) into an elastic IP address (EIP).
Usage notes
After a public IP address is converted into an EIP, the EIP is billed separately. Familiarize yourself with the billing methods of EIPs. For more information, see Billing overview.
When you call this operation, make sure that the following requirements are met:
- The instance is in the Stopped (
Stopped
) or Running (Running
) state. - No EIPs are associated with the instance.
- The instance has no configuration change tasks that have not taken effect.
- The public bandwidth of the instance is 0 Mbit/s.
- The instance uses the pay-by-traffic billing method for network usage.
- If the instance is a subscription instance that resides in a VPC, the instance is not expiring within 24 hours.
Debugging
Request parameters
Parameter |
Type |
Required |
Example |
Description |
Action | String | Yes | ConvertNatPublicIpToEip | The operation that you want to perform. Set the value to ConvertNatPublicIpToEip. |
InstanceId | String | Yes | i-bp171jr36ge2ulvk**** | The ID of the instance. |
RegionId | String | Yes | cn-hangzhou | The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list. |
Response parameters
Parameter |
Type |
Example |
Description |
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E | The ID of the request. |
Examples
Sample requests
https://ecs.aliyuncs.com/?Action=ConvertNatPublicIpToEip
&RegionId=cn-hangzhou
&InstanceId=i-bp171jr36ge2ulvk****
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ConvertNatPublicIpToEipResponse>
<RequestId>B154D309-F3E1-4AB7-BA94-FEFCA8B89001</RequestId>
</ConvertNatPublicIpToEipResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "B154D309-F3E1-4AB7-BA94-FEFCA8B89001"
}
Error codes
HTTP status code |
Error code |
Error message |
Description |
403 | InvalidInstanceId.PlanedChange | %s | This operation is invalid because a configuration change has been scheduled for the specified instance. |
403 | InvalidEndTime.OperateNotSupport | %s | This operation cannot be performed on the instance in the current state. |
403 | InvalidInstanceStatus.Released | %s | This operation is invalid. Check the instance status. |
403 | IncorrectInstanceStatus | %s | This operation cannot be performed on the instance in the current state. |
403 | OperationDenied | %s | The operation is denied. |
403 | InvalidInternetChargeType.ValueNotSupported | %s | Invalid InternetChargeType value. |
403 | InvalidInstanceId.NotFound | %s | The InstanceId is not found. |
403 | MaxEIPQuotaExceeded | The number of EIP exceeds the limit per region. | The maximum number of EIPs in the current region is exceeded. |
403 | Forbidden.InvalidPublicBandwidth | The specified instance public bandwidth is less than 1M. | Invalid public bandwidth value. |
403 | InvalidInstance.OverduePayment | The special instance due to overdue payment,this operation is not supported. | Your account has overdue payments. Add funds to your account and try again. |
403 | InvalidAccountStatus.NotEnoughBalance | Your account does not have enough balance. | The account balance is insufficient. Add funds to your account and try again. |
403 | Forbidden.RiskControl | This operation is forbidden by Aliyun RiskControl system. | The operation is denied by the Alibaba Cloud Risk Control system. |
404 | InvalidInstance.IpAddressMissing | %s | The instance does not have a public IP address. For more information, see the return value of the %s placeholder in the error message. You can call the DescribeInstances operation to query the status of the specified instance. |
For a list of error codes, see Service error codes.