All Products
Search
Document Center

Virtual Private Cloud:AllocateEipAddressPro

Last Updated:Nov 13, 2024

Requests a specified elastic IP address (EIP).

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:AllocateEipAddressProupdate
  • Address
    acs:vpc:{#regionId}:{#accountId}:eip/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The ID of the region to which the EIP belongs.

You can call the DescribeRegions operation to query the region ID.

cn-hangzhou
IpAddressstringNo

The IP address of the EIP.

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

192.0.XX.XX
InstanceIdstringNo

The EIP ID.

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

eip-25877c70gddh****
BandwidthstringNo

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 Mbit /s.

5
PeriodintegerNo

The subscription duration.

  • Valid values when PricingCycle is set to Month: 1 to 9.****
  • Valid values when PricingCycle is set to Year: 1 to 3.****

This parameter is required if InstanceChargeType is set to PrePaid.

Leave this parameter empty if InstanceChargeType is set to PostPaid.

1
ISPstringNo

The line type. Valid values:

  • BGP (default): BGP (Multi-ISP) line The BGP (Multi-ISP) line is supported in all regions.
  • BGP_PRO: BGP (Multi-ISP) Pro line The BGP (Multi-ISP) Pro line is supported in the China (Hong Kong), Singapore, Malaysia (Kuala Lumpur), Philippines (Manila), Indonesia (Jakarta), and Thailand (Bangkok) regions.

For more information about the BGP (Multi-ISP) line and BGP (Multi-ISP) Pro line, see the "Line types" section of What is EIP?

  • If you are allowed to use single-ISP bandwidth, you can also choose one of the following values:

    • ChinaTelecom
    • ChinaUnicom
    • ChinaMobile
    • ChinaTelecom_L2
    • ChinaUnicom_L2
    • ChinaMobile_L2
  • If your services are deployed in China East 1 Finance, this parameter is required and you must set the parameter to BGP_FinanceCloud.

BGP
NetmodestringNo

The network type. By default, this value is set to public, which specifies the public network type.

public
AutoPaybooleanNo

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

  • false: Automatic payment is disabled. After an order is generated, you must go to the Order Center to complete the payment.
  • true: Automatic payment is enabled. After an order is generated, the payment is automatically completed.

This parameter is required if InstanceChargeType is set to PrePaid. This parameter is optional if InstanceChargeType is set to PostPaid.

true
PricingCyclestringNo

The billing cycle of the subscription EIP. Valid values:

  • Month (default)
  • Year

This parameter is required if InstanceChargeType is set to PrePaid. This parameter is optional if InstanceChargeType is set to PostPaid.

Month
InstanceChargeTypestringNo

The billing method of the EIP. Valid values:

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

Set the value of InternetChargeType to PayByBandwidth if InstanceChargeType is set to PrePaid.

Valid values when InstanceChargeType is set to PostPaid: PayByBandwidth or PayByTraffic.

PostPaid
InternetChargeTypestringNo

The metering method of the 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.

PayByBandwidth
ResourceGroupIdstringNo

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

rg-resourcegroup****
ClientTokenstringNo

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

You can use the client to generate a 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 automatically uses the request ID as the client token. The request ID may be different for each request.
0c593ea1-3bea-11e9-b96b-88e9fe6****
SecurityProtectionTypesarrayNo

The editions of Anti-DDoS.

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

You can configure Anti-DDoS editions for up to 10 EIPs.

stringNo

The edition of Anti-DDoS.

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

You can configure Anti-DDoS editions for up to 10 EIPs.

AntiDDoS_Enhanced
PublicIpAddressPoolIdstringNo

The ID of the IP address pool.

The EIP is allocated from the IP address pool.

By default, you cannot use the IP address pool. To use this feature, apply for the privilege in the Quota Center console. For more information, see the "Request a quota increase in the Quota Center console" section of Manage EIP quotas.

pippool-2vc0kxcedhquybdsz****

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

4EC47282-1B74-4534-BD0E-403F3EE64CAF
OrderIdlong

The order ID.

This parameter is returned when InstanceChargeType is set to PrePaid. If AutoPay is set to false, you must manually complete the payment in the Order Center.

20190000
ResourceGroupIdstring

The ID of the resource group. This parameter is returned only when InstanceChargeType is set to PostPaid.

rg-resourcegroup****
EipAddressstring

The IP address that is allocated to the EIP. This parameter is returned only when InstanceChargeType is set to PostPaid.

192.0.XX.XX
AllocationIdstring

The EIP ID.

eip-25877c70gddh****

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400FrequentPurchase.EIPeip frequent purchase-
400COMMODITY_NO_EXISTcommodity is not exist-
400QuotaExceeded.EipElastic IP address quota exceeded-
400InvalidParameterSpecified value of "InternetChargeType" is not valid-
400InvalidParameterSpecified value of "Bandwidth" is not valid.The specified bandwidth value is invalid.
400InsufficientBalanceYour account does not have enough balance.Your account balance is insufficient. Top up your account and try again.
400QuotaExceeded.EipElastic IP address quota exceeded.The number of EIPs has reached the upper limit. We recommend that you use NAT gateways if you want to use more EIPs.
400ReserveIpFailReserve eip failed.The system failed to reserve the specified EIP.
400InvalidRegion.NotSupportThe specified region does not support.The specified region does not support.
400InvalidBandwidth.MalformedThe specified Bandwidth is invalid.-
400INSTANCE_TYPE_NOT_SUPPORTThe instance type is invalid.-
400QueryParameter.Illegalquery parameter illegal-
400SYSTEM.UNKNOWN.ERRORThe Account failed to create order.-
400TokenVerfiy.Failedtoken verify failed.-
400OrderFailedThe Account failed to create order.-
400QuotaExceeded.LargeSpecEipElastic IP address with large spec quota exceeded.-
400InvalidResourceGroupIdThe specified ResourceGroupId does not exist.The specified resource group ID does not exist.
400Invalid.Reserve.IpThe reserve ip is invalid.-
400Ip.AllocatedThe reserve ip has been allocated.Reserved IP addresses are already specified.
400Ip.KeepedThe reserve ip been keeped in an hour.-
400OperationFailed.AllocateUnfamiliarIpThe operation failed because only IP addresses used within the last seven days can be allocated.Only IP addresses used within the last seven days can be used to apply for EIP.
400INVALID_INSTANCE_STATUSThe instance status is invalid.-
400OperationFailed.InstanceNotExistEip instanceId does not exist.-
400InvalidStatus.ValueNotSupportedThe specified status is not supported.-
400OperationFailed.RiskControlRisk control check failed.The error message returned because your payment method has security risks. Click the link for verification in your email or console message and submit your order after verification.
400OrderError.EIPThe Account failed to create order.Failed to place the order.
400ResourceNotEnough.PublicIpAddressPoolThe specified resource of PublicIpAddressPool is not enough.-
400Mismatch.IpAndPublicIpAddressPoolThe Ip and PublicIpAddressPool are mismatched.-
400ResourceNotFound.PublicIpAddressPoolThe specified resource of PublicIpAddressPool is not found.-
400ResourceNotFound.IpThe specified ip is not found.The specified IP could not be found.
400OperationDenied.IpBelongToOtherUserThe operation is not allowed because of ip belong to other user.Your application failed because the IP address belongs to another user.
400IncorrectStatus.IpThe status of ip is incorrect.The status of the IP is incorrect.
400OperationFailed.IpIsLockedThe operation is failed because of ip is locked.Your application failed because the IP address is locked.
400Mismatch.IpAndIspThe specified IP address does not match the ISP.The system failed to allocate the specified EIP because the ISP and IP address do not match.
400IncorrectStatus.PublicIpAddressPoolThe status of PublicIpAddressPool is incorrect.EIPs are not allowed to be allocated because the address pool is in an unstable state.
400IllegalParam.IpAddressThe specified IpAddress (%s) is illegal.The IpAddress parameter is set to an invalid value.
400OperationFailed.ResourceNotEnoughThe resources you have applied for are insufficient.The resources you have applied for are insufficient. If you still need to apply, please submit a work order for processing.
400Mismatch.EipSecurityProtectionTypeAndPoolSecurityProtectionTypeThe EipSecurityProtectionType and PoolSecurityProtectionType are mismatched.The EIP protection type does not match the address pool protection type.
403ForbiddenUser not authorized to operate on the specified resource.You do not have the permissions to manage the specified resource. Apply for the permissions and try again.
404InvalidRegionId.NotFoundSpecified value of "RegionId" is not supported.RegionId is set to an invalid value. Check whether the service is available in the specified region and try again.
404InvalidRegionId.NotFoundThe RegionId provided does not exist in our records.The RegionId parameter is set to an invalid value. Specify a valid value and try again.
404FUWU_BIZ_COMMODITY_VERIFY_FAIL????????, ????????PD.-
500InternalErrorThe request processing has failed due to some unknown error, exception or failure.An internal error occurred.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-07-16The Error code has changedView Change Details
2024-01-22The Error code has changedView Change Details
2023-10-19API Description Update. The Error code has changedView Change Details
2023-07-06The Error code has changedView Change Details
2023-05-15The Error code has changedView Change Details
2022-12-02The Error code has changedView Change Details