You can call this operation to apply for an Elastic IP address.
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 apply for an Elastic IP address. You can call the DescribeRegions operation to query region IDs. |
IpAddress | String | No | 12.xx.xx.23 |
The Elastic IP address for which you want to apply. Specify IpAddress or InstanceId. If you leave this parameter empty, the system randomly allocates an Elastic IP address. |
InstanceId | String | No | eip-25877c70gddh**** |
The instance ID of the Elastic IP address. Specify IpAddress or InstanceId. If you leave this parameter empty, the system randomly allocates an Elastic IP address. |
Bandwidth | String | No | 5 |
The maximum bandwidth of the Elastic IP address. Unit: Mbit/s. Default value: 5 Mbit/s. |
Period | Integer | No | 1 |
The subscription duration of the Elastic IP address. If PricingCycle is set to Month, set Period to a value from 1 to 9. If PricingCycle is set to Year, set Period to a value from 1 to 3. This parameter is required when InstanceChargeType is set to PrePaid. Ignore this parameter when InstanceChargeType is set to PostPaid. |
ISP | String | No | BGP |
The type of connection. Default value: BGP.
|
Netmode | String | No | public |
The network type. Set the value to public (public network). Default value: public. |
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 the Order Center to complete the payment. true: enables automatic payment. Payments are automatically completed. This parameter is required when InstanceChargeType is set to PrePaid. Ignore this parameter when InstanceChargeType is set to PostPaid. |
PricingCycle | String | No | Month |
Specifies whether to enable automatic payment. 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. This parameter is required when InstanceChargeType is set to PrePaid. Ignore this parameter when InstanceChargeType is set to PostPaid. |
InstanceChargeType | String | No | PostPaid |
The billing method of the Elastic IP address. Valid values: PrePaid: subscription. PostPaid: pay-as-you-go. This is the default value. If InstanceChargeType is set to PrePaid, you must set InternetChargeType to PayByBandwidth. If InstanceChargeType is set to PostPaid, you can set InternetChargeType to PayByBandwidth or PayByTraffic. |
InternetChargeType | String | No | PayByBandwidth |
The metering method of the Elastic IP address. Valid values: PayByBandwidth :The Elastic IP address is billed based on bandwidth usage. This is the default value. PayByTraffic : The Elastic IP address is billed based on data transfer. If InstanceChargeType is set to PrePaid, you must set InternetChargeType to PayByBandwidth. If InstanceChargeType is set to PostPaid, you can set InternetChargeType to PayByBandwidth or PayByTraffic. |
ResourceGroupId | String | No | rg-resourcegroup**** |
The ID of the resource group to which the Elastic IP address belongs. |
ClientToken | String | No | 0c593ea1-3bea-11e9-b96b-88e9fe637760 |
The token used to ensure idempotence. Each client generates a unique token to identify different requests. Only ASCII characters are allowed. It can contain up to 64 ASCII characters. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
AllocationId | String | eip-25877c70gddh**** |
The ID of the Elastic IP address. |
EipAddress | String | 123.xx.xx.206 |
The CIDR block of the Elastic IP address. |
OrderId | Long | 20190000 |
The ID of the order. |
RequestId | String | 4EC47282-1B74-4534-BD0E-403F3EE64CAF |
The ID of the request. |
ResourceGroupId | String | rg-resourcegroup**** |
The ID of the resource group to which the Elastic IP address belongs. |
Examples
Sample requests
http(s)://[Endpoint]/? Action=AllocateEipAddressPro
&RegionId=cn-hangzhou
&<Common request parameters>
Sample success responses
XML
format
<AllocateEipAddressProResponse>
<RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
<AllocationId>eip-25877c70gddh****</AllocationId>
<EipAddress>123.xx.xx.206</EipAddress>
<OrderId>20190000</OrderId>
<ResourceGroupId>rg-resourcegroup****</ResourceGroupId>
</AllocateEipAddressProResponse>
JSON
format
{
"RequestId":"473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"AllocationId":"eip-25877c70gddh****",
"EipAddress":"123.xx.xx.206",
"OrderId":"20190000",
"ResourceGroupId":"rg-resourcegroup****"
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
403 | Forbbiden | User not authorized to operate on the specified resource. | The error message returned because you are not authorized to perform this operation on the specified resource. You can apply for the permission and try again. |
400 | QuotaExceeded.Eip | Elastic IP address quota exceeded | The error message returned because the number of Elastic IP addresses exceeds the quota limit. To request a quota increase, submit a ticket. We recommend that you use NAT gateways. |
400 | InvalidParameter | Specified value of "InternetChargeType" is not valid | The error message returned because the value of InternetChargeType is invalid. |
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 account. Top up your account and try again. |
400 | QuotaExceeded.Eip | Elastic IP address quota exceeded. | The error message returned because the number of Elastic IP addresses exceeds the quota limit. To request a quota increase, submit a ticket. We recommend that you use NAT gateways. |
400 | ReserveIpFail | Reserve eip failed. | The error message returned because the system failed to reserve the IP addresses specified for the Elastic IP address. |
400 | InvalidRegion.NotSupport | The specified region does not support. | The error message returned because the region with the specified ID does not support this operation. |
For a list of error codes, visit the API Error Center.