Creates an Elastic IP Address (EIP).

After you call this action, an EIP in the Available state is allocated in the specified region. EIP supports ICMP, TCP, and UDP protocols, but does not support the IGMP and SCTP protocols.

Debug

Use OpenAPI Explorer to perform debug operations and generate SDK code examples.

Request parameters

Parameter Type Required? Example value Description
Action String Yes AllocateEipAddress

The name of this action. Value: AllocateEipAddress

RegionId String Yes cn-hangzhou-d

The ID of the region to which the EIP belongs. To query the region ID, call DescribeRegions .

AutoPay Boolean No false

Optional. Indicates whether to pay automatically. Valid values:

  • false : Do not enable automatic payment. You need to go to the order center to complete the payment after an order is generated.
  • true : Enable automatic payment. The order is paid automatically.
Bandwidth String No 5

Optional. The peak bandwidth of the EIP. Unit: Mbit/s. Default value: 5

ClientToken String No 02fb3da4-130e-11e9-8e44-001xxxxxxxx

Optional. A client token used to guarantee the idempotence of the request. This parameter value is generated by the client and is guaranteed to be unique among different requests. It is 1 to 64 ASCII characters in length.

ISP String No BGP

Optional. The type of the line. Default value: BGP .

  • If you have enabled a single-line bandwidth whitelist, you can set the ISP parameter to ChinaTelecom , ChinaUnicom or ChinaMobile to enable a single-line EIP provided by China Telecom, China Unicom, and China Mobile respectively.
  • This parameter is required if you are a financial cloud user and select the Hangzhou region. Value: BGP_FinanceCloud
InstanceChargeType String No PostPaid

Optional. The billing method of the EIP. Valid values:

PostPaid (default): Pay-As-You-Go.

InternetChargeType String No PayByBandwidth

The billing method of the EIP. Valid values:

PayByTraffic : The EIP is billed based on traffic.

Netmode String No Public

Optional. The network type. Default value: Public

Period Integer No 10

Optional. The validity period of subscription.

  • If the value of PricingCycle is Month , the value range of Period is 1 to 9 .
  • If the value of PricingCycle is Year , the value range of Period is 1 to 3 .
PricingCycle String No Month

The billing cycle of purchase. Valid values:

  • Month (default): billing on a monthly basis
  • Year : billing on a yearly basis

ResourceGroupId String No rg-acfmxazxxxxxxxx

The ID of the enterprise resource group.

Response parameters

Parameter Type Example value Description
EipAddress String 12.xx.xx.78

The allocated EIP.

AllocationId String eip-25877c70xxxxxxxx

The ID of the EIP.

OrderId Long 10

The order number, which is returned only when InstanceChargeType is set to PrePaid.

RequestId String 4EC47282-1B74-4534-BD0E-403F3EE64CAF

The request ID.

ResourceGroupId String rg-acfmxazxxxxxxxx

The ID of the enterprise resource group.

Examples

Request example


https://vpc.aliyuncs.com/?Action=AllocateEipAddress
&RegionId=cn-beijing
&CommonParameters

Response examples

XML format

<AllocateEipAddressResponse>
  <AllocationId>eip-25877c70xxxxxxxx</AllocationId>
  <EipAddress>123.xx.xx. 206</EipAddress>
  <RequestId>B6B9F518-60F8-4D81-9242-1207B356754D</RequestId>
</AllocateEipAddressResponse>

JSON format

{
	"RequestId":"B6B9F518-60F8-4D81-9242-1207B356754D",
	"EipAddress":"123.xx.xx. 206",
	"AllocationId":"eip-25877c70xxxxxxxx"
}

Error codes

HTTP status code Error code Error message Description
403 Forbbiden User not authorized to operate on the specified resource. You are not authorized to operate on this resource.
400 QuotaExceeded.Eip Elastic IP address quota exceeded The quota of EIPs has been reached. To increase the quota, open a ticket. Alternatively, we recommend that you use NAT Gateway to obtain more IP addresses.
400 InvalidParameter Specified value of "InternetChargeType" is not valid The value of the InternetChargeType parameter is invalid.
400 InvalidParameter Specified value of "Bandwidth" is not valid. The specified bandwidth value is invalid.
400 QuotaExceeded.Eip Elastic IP address quota exceeded. The quota of EIPs has been reached. To increase the quota, open a ticket. Alternatively, we recommend that you use NAT Gateway to obtain more IP addresses.
400 ReserveIpFail Reserve eip failed. The operation failed to reserve the EIP.
400 InvalidRegion.NotSupport The specified region does not support. The specified region does not support this operation.

See common error codes.