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

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

RegionId String Yes cn-hangzhou

The region ID of the EIP that you want to request.

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

You can set one of the IpAddress and InstanceId parameters. If neither is set, the system randomly allocates an EIP.

InstanceId String No eip-25877c70gddh****

The ID of the EIP that you want to request.

You can set one of the IpAddress and InstanceId parameters. If neither is set, the system randomly allocates an EIP.

Bandwidth String No 5

The maximum bandwidth value for the 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, valid values for Period are 1 to 9.
  • When PricingCycle is set to Year, valid values for Period are 1 to 3.

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

When InstanceChargeType is set to PostPaid, ignore this parameter.

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. Valid values:

  • false: disables automatic payment. After an order is generated, you must go to 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: on a monthly basis. This is the default value.
  • Year: 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 EIP that you want to request. Valid values:

  • PrePaid: subscription
  • PostPaid: pay-as-you-go. This is the default value.

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 EIP that you want to request. 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, you must set InternetChargeType to PayByBandwidth or PayByTraffic.

ResourceGroupId String No rg-resourcegroup****

The ID of the resource group.

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. The token can contain only ASCII characters and cannot exceed 64 characters in length.

Note If you do not set this parameter, the system automatically uses RequestId as ClientToken. RequestId may be different for each API request.

Response parameters

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

The ID of the request.

OrderId Long 20190000

The ID of the order.

ResourceGroupId String rg-resourcegroup****

The ID of the resource group.

EipAddress String 192.0.XX.XX

The IP address of the EIP that is queried.

AllocationId String eip-25877c70gddh****

The ID of the 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****
&Common request parameters

Sample success 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 your account balance is insufficient. Top up your 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 specified region does not support this operation.
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.
403 Forbbiden User not authorized to operate on the specified resource. The error message returned because you are unauthorized to perform the operation on the specified resource. Apply for the permissions and try again.

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