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

By using API Explorer, you can easily debug APIs, automatically generate SDK code examples, and quickly search for APIs.

Request parameters

Parameter Type Required? Example value Description
Action String Yes AllocateEipAddress

The name of this action. Value:

AllocateEipAddress

RegionId String Yes cn-hangzhou

The ID of the region to which the EIP belongs.

To query the region ID, call DescribeRegions.

AutoPay string  No false

Indicates whether to pay the order automatically. Valid values:

  • false: Do not enable automatic payment. After an order is generated, you need to go to the order center to complete payment.

  • true: Enable automatic payment.

Note This parameter is required if the InstanceChargeType value is PrePaid.
Bandwidth String No 5

The peak bandwidth in Mbps of the EIP. Default value: 5.

ClientToken String  No 02fb3da4-130e-11e9-8e44-0016e04115b

A client token used to guarantee the idempotence of requests. 

This parameter value is generated by the client and must be unique. It must be 64 ASCII characters in length.

ISP String No BGP

The type of the line. Default value:BGP.

InstanceChargeType String No PostPaid

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: Billing based on traffic.

Netmode String No Public

The network type. Default value:Public.

Period String No 10

The validity period of subscription. Valid values:

  • Monthly subscription valid value range: 1 to 9.

  • Yearly subscription valid value range: 1 to 3.

Note This parameter is required if the InstanceChargeType parameter is PrePaid.
PricingCycle String No Month

The billing cycle of subscription. Valid values:

  • Month(default): billing on a monthly basis

  • Year: billing on a yearly basis

Note This parameter is required if the InstanceChargeType value is PrePaid.
ResourceGroupId String No rg-acfmxazb4ph6aiy

The ID of the enterprise resource group.

Response parameters

Parameter Type Example value Description
EipAddress String 12.34.56.78 The allocated EIP.
AllocationId String 12.34.56.78 The ID of the EIP.
OrderId String 10 Order number. This parameter is returned only when the Subscription billing method is selected.
RequestId String 4EC47282-1B74-4534-BD0E-403F3EE64CAF The ID of the request.
ResourceGroupId String rg-acfmxazb4ph6aiy

The ID of the enterprise resource group.

Examples

Request example


https://vpc.aliyuncs.com/?Action=AllocateEipAddress
&RegionId=cn-beijing
&CommonParameters
Response example
  • XML format

    <AllocateEipAddressResponse>
      <AllocationId>eip-25877c70x</AllocationId>
      <EipAddress>123.56.0.206</EipAddress>
      <RequestId>B6B9F518-60F8-4D81-9242-1207B356754D</RequestId>
    </AllocateEipAddressResponse>
    
  • JSON format

    {
    	"RequestId":"B6B9F518-60F8-4D81-9242-1207B356754D",
    	"EipAddress":"123.56.0.206",
    	"AllocationId":"eip-25877c70x"
    }

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