All Products
Search
Document Center

Elastic Compute Service:ConvertNatPublicIpToEip

Last Updated:Mar 19, 2024

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).

Operation description

After a public IP address is converted into an EIP, the EIP is billed separately. Make sure that you understand 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 or 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 not 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 does not expire within 24 hours.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the instance whose public IP address you want to convert into an EIP.

i-bp171jr36ge2ulvk****
RegionIdstringYes

The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Error codes

HTTP status codeError codeError messageDescription
400OperationDenied.CloudboxNotSupportThis operation is denied, because the specified ECS instance which is in the Cloudbox dose not support PublicIp or Eip.-
400InvalidParameter.CloudboxNotSupported%s-
403InvalidInstanceId.PlanedChange%sYour operation is invalid because a configuration change has been scheduled for the specified instance.
403InvalidEndTime.OperateNotSupport%sThe instance is in a state that does not support the current operation.
403InvalidInstanceStatus.Released%sThe operation is invalid. Check the state of the instance.
403IncorrectInstanceStatus%sThe instance is in a state that does not support the current operation.
403OperationDenied%sThe operation is denied.
403InvalidInstance.ZeroBandwidth%s-
403InvalidInternetChargeType.ValueNotSupported%sThe specified InternetChargeType parameter is invalid.
403InvalidInstanceId.NotFound%sThe specified instance does not exist. Check whether the InstanceId parameter is valid.
403MaxEIPQuotaExceededThe number of EIP exceeds the limit per region.The maximum number of EIPs in the current region has been reached.
403Forbidden.InvalidPublicBandwidthThe specified instance public bandwidth is less than 1M.The specified public bandwidth value of the instance is invalid.
403InvalidInstance.OverduePaymentThe special instance due to overdue payment,this operation is not supported.Your account has overdue payments. Add funds to your account and try again.
403EIPMaxBandwidthExceededThe bandwidth of instance exceeds the limitation of EIP in this region.-
403IncorrectInstanceStatusThe special instance status not support this operate!-
403InvalidAccountStatus.NotEnoughBalanceYour account does not have enough balance.Your account balance is insufficient. Add funds to your account and try again.
403Forbidden.RiskControlThis operation is forbidden by Aliyun RiskControl system.The operation is forbidden by the risk control system.
403UnsupportedPublicIpWithIsp%s-
404InvalidInstance.IpAddressMissing%s-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-10-10The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
    delete Error Codes: 403
    delete Error Codes: 404