Requests a specified elastic IP address (EIP).
Debugging
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. Specify 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. Specify 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.
Default value: 5. Unit: Mbit/s. |
Period | Integer | No | 1 | The subscription duration.
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. Valid values:
For more information about BGP (Multi-ISP) and BGP (Multi-ISP) Pro, see EIP line types.
|
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:
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:
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:
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:
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 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 token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters. Note If you do not specify this parameter, the system uses the request ID as the client token. The request ID may be different for each request. |
SecurityProtectionTypes.N | String | No | AntiDDoS_Enhanced | The edition of Anti-DDoS.
You can configure Anti-DDoS for at most 10 EIPs. |
PublicIpAddressPoolId | String | No | pippool-2vc0kxcedhquybdsz**** | The ID of the IP address pool. The EIP is allocated from the IP address pool. You cannot use the IP address pool feature by default. To use this feature, apply for the privilege in the Quota Center console. For more information, see Request a quota increase in the Quota Center console. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 4EC47282-1B74-4534-BD0E-403F3EE64CAF | The request ID. |
OrderId | Long | 20190000 | The order ID. This parameter is returned only when InstanceChargeType is set to PrePaid. |
ResourceGroupId | String | rg-resourcegroup**** | The ID of the resource group. This parameter is returned only when InstanceChargeType is set to PostPaid. |
EipAddress | String | 192.0.XX.XX | The IP address of the requested EIP. This parameter is returned only when InstanceChargeType is set to PostPaid. |
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 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 you do not have sufficient balance in 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 EIPs. |
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 does not exist. |
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 | OperationFailed.RiskControl | Risk control check failed. | The error message returned because security risks are detected in your payment method. Click the link in the email that is sent to you or in the ApsaraDB RDS console to continue with the verification. After you complete the verification, submit the order again. |
400 | OrderError.EIP | The Account failed to create order. | The error message returned because the system failed to generate an order. |
400 | Mismatch.IpAndIsp | The specified IP address does not match the ISP. | The error message returned because the ISP and IP address do not match and the system failed to allocate the specified EIP. |
400 | IncorrectStatus.PublicIpAddressPool | The status of PublicIpAddressPool is incorrect. | The error message returned because because the address pool is in an unstable state and EIPs are not allowed to be allocated . |
403 | Forbidden | User not authorized to operate on the specified resource. | You do not have permissions to perform the operation on the specified resource. Acquire the required permissions and try again. |
500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | The error message returned because an internal error has occurred. |
For a list of error codes, see Service error codes.