Request EIPs

Last Updated: Jul 25, 2017

Description

This operation allows users to request EIPs in Available status. When requesting an EIP, consider the following:

  • An EIP can only be bound to a VPC ECS instance in the same region.
  • Upon each request, an EIP is randomly allocated in the specified region.
  • Only ICMP, TCP, and UDP EIPs are supported. Transport layer EIPs (such as IGMP EIP and SCTP EIP) are not supported.

Request parameters

Name Type Required Description
Action String Yes Value: AllocateEipAddress.
RegionId String Yes Indicates the ID of the region where the requested EIP belongs.
Bandwidth String No Indicates the rate limit of the EIP. If not specified, the parameter is set to 5 Mbps by default.
InternetChargeType String No Optional values:
  • PayByBandwidth
  • PayByTraffic
The default value is PayByBandwidth.
ClientToken String No Used to ensure the idempotence of the request. The value is generated by a client. It must be unique among all requests and contain up to 64 ASCII characters. For details, refer to the appendix.

Return parameters

Name Type Description
EipAddress String Indicates the assigned EIP.
AllocationId String Indicates the instance ID of the EIP.

Error code

Error code Description Http status code Meaning
Forbbiden User not authorized to operate on the specified resource. 403 The user is not authorized to use EIPs. Submit a work order to request the authorization.
QuotaExceeded.Eip Elastic IP address quota exceeded. 400 The number of EIPs has exceeded the quota.
InvalidRegionId.NotFound Specified value of RegionId is not supported. 404 The specified RegionId does not exist.
InvalidParameter Specified value of InternetChargeType is not valid. 400 The specified InternetChargeType parameter is invalid.
InvalidParameter Specified value of Bandwidth is not valid. 400 The specified Bandwidth parameter is invalid.
InsufficientEipCapacity Insufficient EIP capacity to fulfill your request. 500 The EIPs in the specified region are insufficient.
InsufficientBalance Your account does not have enough balance. 400 The EIP cannot be requested because your account balance is insufficient.

Examples

Request example

https://ecs.aliyuncs.com/?Action=AllocateEipAddress
&RegionId=cn-beijing
&<Public Request Parameters>

Return example

XML format

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

JSON format

{
  "AllocationId": "eip-25877c70x", 
  "EipAddress": "123.56.0.206", 
  "RequestId": "B6B9F518-60F8-4D81-9242-1207B356754D"
}
Thank you! We've received your feedback.