Requests a specified elastic IP address (EIP).

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes AllocateEipAddressPro

The operation that you want to perform. Set the value to AllocateEipAddressPro.

RegionId String Yes cn-hangzhou

The ID of the region where you want to request a specified EIP.

You can call the DescribeRegions operation to query the most recent region list.

IpAddress String No 192.0.XX.XX

The IP address of the EIP that you want to request.

Set IpAddress or InstanceId. If you leave both parameters empty, the system randomly allocates an EIP.

InstanceId String No eip-25877c70gddh****

The ID of the EIP.

Set IpAddress or InstanceId. If you leave both parameters empty, the system randomly allocates an EIP.

Bandwidth String No 5

The maximum bandwidth of the specified EIP. Unit: Mbit/s.

  • When InstanceChargeType is set to PostPaid and InternetChargeType is set to PayByBandwidth, valid values for Bandwidth are 1 to 500.
  • When InstanceChargeType is set to PostPaid and InternetChargeType is set to PayByTraffic, valid values for Bandwidth are 1 to 200.
  • When InstanceChargeType is set to PrePaid, valid values for Bandwidth are 1 to 1000.

Default value: 5. Unit: Mbit/s.

Period Integer No 1

The subscription duration.

  • When PricingCycle is set to Month, set Period to a value from 1 to 9.
  • When PricingCycle is set to Year, set Period to a value from 1 to 3.

When InstanceChargeType is set to PrePaid, this parameter is required.

Ignore this parameter when InstanceChargeType is set to PostPaid.

ISP String No BGP

The line type. Default value: BGP.

  • If you are allowed to use BGP (Single-ISP), valid values are ChinaTelecom, ChinaUnicom, and ChinaMobile.
  • If your services are deployed in China East 1 Finance, this parameter is required and you must set the value to BGP_FinanceCloud.
Netmode String No public

The network type. Set the value to public, which specifies the Internet.

AutoPay Boolean No true

Specifies whether to enable automatic payment. Default value: true. Valid values:

  • false: disables automatic payment. After an order is generated, you must go to the Order Center to complete the payment.
  • true: enables automatic payment. Payments are automatically completed.

When InstanceChargeType is set to PrePaid, this parameter is required. When InstanceChargeType is set to PostPaid, this parameter is not required.

PricingCycle String No Month

The billing cycle of the subscription EIP. Valid values:

  • Month (default): The EIP is billed on a monthly basis.
  • Year: The EIP is billed on an annual basis.

When InstanceChargeType is set to PrePaid, this parameter is required. When InstanceChargeType is set to PostPaid, this parameter is not required.

InstanceChargeType String No PostPaid

The billing method of the specified EIP. Valid values:

  • PrePaid: subscription
  • PostPaid (default): pay-as-you-go

When InstanceChargeType is set to PrePaid, you must set InternetChargeType to PayByBandwidth.

When InstanceChargeType is set to PostPaid, you must set InternetChargeType to PayByBandwidth or PayByTraffic.

InternetChargeType String No PayByBandwidth

The metering method of the specified EIP. Valid values:

  • PayByBandwidth (default): pay-by-bandwidth
  • PayByTraffic: pay-by-data-transfer

When InstanceChargeType is set to PrePaid, you must set InternetChargeType to PayByBandwidth.

When InstanceChargeType is set to PostPaid, set InternetChargeType to PayByBandwidth or PayByTraffic.

ResourceGroupId String No rg-resourcegroup****

The ID of the resource group to which the EIP belongs.

ClientToken String No 0c593ea1-3bea-11e9-b96b-88e9fe6****

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among different requests. ClientToken can contain only ASCII characters.

Note If you do not set this parameter, the system automatically uses RequestId as ClientToken. RequestId of each API request may be different.
PublicIpAddressPoolId String No pippool-2vc0kxcedhquybdsz****

The ID of the IP address pool.

The EIP is allocated from the IP address pool.

The feature is available only to users whose accounts are included in the whitelist. If you want to use the feature,submit a ticket.

SecurityProtectionTypes.N String No AntiDDoS_Enhanced

The edition of Anti-DDoS.

  • If you do not set this parameter, Anti-DDoS Origin Basic is used.
  • If you set the value to AntiDDoS_Enhanced, Anti-DDoS Pro/Premium is used.

You can configure Anti-DDoS for at most 10 EIPs.

Response parameters

Parameter Type Example Description
RequestId String 4EC47282-1B74-4534-BD0E-403F3EE64CAF

The ID of the request.

OrderId Long 20190000

The order number. This parameter is returned only when InstanceChargeType is set to PrePaid.

ResourceGroupId String rg-resourcegroup****

The ID of the resource group.

EipAddress String 192.0.XX.XX

The IP address of the requested EIP.

AllocationId String eip-25877c70gddh****

The ID of the specified EIP.

Examples

Sample requests

http(s)://[Endpoint]/?Action=AllocateEipAddressPro
&RegionId=cn-hangzhou
&IpAddress=192.0.XX.XX
&InstanceId=eip-25877c70gddh****
&Bandwidth=5
&Period=1
&ISP=BGP
&Netmode=public
&AutoPay=true
&PricingCycle=Month
&InstanceChargeType=PostPaid
&InternetChargeType=PayByBandwidth
&ResourceGroupId=rg-resourcegroup****
&ClientToken=0c593ea1-3bea-11e9-b96b-88e9fe6****
&SecurityProtectionTypes=["AntiDDoS_Enhanced"]
&PublicIpAddressPoolId=pippool-2vc0kxcedhquybdsz****
&Common request parameters

Sample responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<AllocateEipAddressProResponse>
    <RequestId>4EC47282-1B74-4534-BD0E-403F3EE64CAF</RequestId>
    <OrderId>20190000</OrderId>
    <ResourceGroupId>rg-resourcegroup****</ResourceGroupId>
    <EipAddress>192.0.XX.XX</EipAddress>
    <AllocationId>eip-25877c70gddh****</AllocationId>
</AllocateEipAddressProResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "4EC47282-1B74-4534-BD0E-403F3EE64CAF",
  "OrderId" : 20190000,
  "ResourceGroupId" : "rg-resourcegroup****",
  "EipAddress" : "192.0.XX.XX",
  "AllocationId" : "eip-25877c70gddh****"
}

Error codes

HttpCode Error code Error message Description
400 InvalidParameter Specified value of "Bandwidth" is not valid. The error message returned because the specified bandwidth value is invalid.
400 InsufficientBalance Your account does not have enough balance. The error message returned because you do not have sufficient balance within your Alibaba Cloud account. Top up your Alibaba Cloud account and try again.
400 QuotaExceeded.Eip Elastic IP address quota exceeded. The error message returned because the number of EIPs has reached the upper limit. We recommend that you use NAT gateways if you want to use more EIPs.
400 ReserveIpFail Reserve eip failed. The error message returned because the system failed to reserve the specified EIP.
400 InvalidRegion.NotSupport The specified region does not support. The error message returned because the operation is not supported in the specified region.
400 InvalidResourceGroupId The specified ResourceGroupId does not exist. The error message returned because the specified resource group ID is invalid.
400 OperationFailed.AllocateUnfamiliarIp The operation failed because only IP addresses used within the last seven days can be allocated. The error message returned because you can call this operation to request EIPs that were used within the last seven days.
400 OrderError.EIP The Account failed to create order. The error message returned because the system failed to generate the order.
403 Forbbiden User not authorized to operate on the specified resource. The error message returned because you are unauthorized to perform this operation on the specified resource. Apply for the required permissions and try again.

For a list of error codes, visit the API Error Center.