Applies for contiguous elastic IP addresses (EIPs).

Usage notes

The AllocateEipSegmentAddress operation is asynchronous. After you send the request, the system returns a request ID. However, the operation is still being performed in the system background. You can call the DescribeEipSegment operation to query the status of a contiguous EIP group:

  • If the contiguous EIP group is in the Allocating state, the EIPs are being allocated.
  • If the contiguous EIP group is in the Allocated state, the EIPs are allocated.

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
ClientToken String No 02fb3da4-130e-11e9-8e44-001****

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 client token can contain only ASCII characters.

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

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

Bandwidth String No 5

The maximum bandwidth of the contiguous EIPs. 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.

RegionId String Yes cn-hangzhou

The region ID of the contiguous EIPs.

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

EipMask String Yes 28

The subnet mask length for the contiguous EIP group. Valid values:

  • 28: applies for 16 contiguous EIPs in each call.
  • 27: applies for 32 contiguous EIPs in each call.
  • 26: applies for 64 contiguous EIPs each call.
  • 25: applies for 128 contiguous EIPs in each call.
  • 24: applies for 256 contiguous EIPs in each call.
Note The number of contiguous EIPs allocated by the system may be less than the requested number because one, three, or four EIPs may be reserved.
Netmode String No public

The network type. Valid values:

  • public (default): Internet After the contiguous EIP group is associated with a cloud resource, the cloud resource can communicate with the Internet by using the EIPs in the contiguous EIP group.
  • hybrid: hybrid cloud After the contiguous EIP group is associated with a cloud resource, the cloud resource can communicate with a hybrid cloud by using the EIPs in the contiguous EIP group.
Note This network type is available only to users who are included in the whitelist. To use this network type, contact your business manager.
InternetChargeType String No PayByBandwidth

The metering method of the contiguous EIPs. Valid values:

  • PayByBandwidth (default): pay-by-bandwidth.
  • PayByTraffic: pay-by-data-transfer
Note If the Netmode parameter is set to hybrid, you can set InternetChargeType only to PayByBandwidth.
ResourceGroupId String No rg-bp67acfmxazb4ph****

The ID of the resource group.

Isp String No BGP

The line type. Valid values:

  • BGP (default): BGP (Multi-ISP) lines. All regions support BGP (Multi-ISP) EIPs.
  • BGP_PRO :BGP (Multi-ISP) Pro lines. BGP (Multi-ISP) Pro EIPs are supported only in the China (Hong Kong) and Singapore (Singapore) regions.

For more information about BGP (Multi-ISP) and BGP (Multi-ISP) Pro, see EIP line types.

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

  • ChinaTelecom: China Telecom
  • ChinaUnicom: China Unicom
  • ChinaMobile: China Mobile
  • ChinaTelecom_L2: China Telecom L2
  • ChinaUnicom_L2: China Unicom L2
  • ChinaMobile_L2: China Mobile L2

If your services are deployed in China East 1 Finance, this parameter is required and you must set the value to BGP_FinanceCloud.

Response parameters

Parameter Type Example Description
RequestId String F7A6301A-64BA-41EC-8284-8F4838C15D1F

The ID of the request.

OrderId Long 2022****

The ID of the order.

EipSegmentInstanceId String eipsg-2zett8ba055tbsxme****

The ID of the contiguous EIP group.

Examples

Sample requests

http(s)://[Endpoint]/?ClientToken=02fb3da4-130e-11e9-8e44-001****
&Action=AllocateEipSegmentAddress
&Bandwidth=5
&RegionId=cn-hangzhou
&EipMask=28
&Netmode=public
&InternetChargeType=PayByBandwidth
&ResourceGroupId=rg-bp67acfmxazb4ph****
&Isp=BGP
&Common request parameters

Sample success responses

XML format

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

<AllocateEipSegmentAddressResponse>
    <RequestId>F7A6301A-64BA-41EC-8284-8F4838C15D1F	</RequestId>
    <EipSegmentInstanceId>eipsg-2zett8ba055tbsxme****</EipSegmentInstanceId>
</AllocateEipSegmentAddressResponse>

JSON format

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

{
  "RequestId" : "F7A6301A-64BA-41EC-8284-8F4838C15D1F\t",
  "EipSegmentInstanceId" : "eipsg-2zett8ba055tbsxme****"
}

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 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 is invalid.
400 ORDER.QUANTITY_INVALID User quota has exceeded the limit. The error message returned because the number of EIPs that you have created has reached the upper limit. Go to the Quota Management page to request a quota increase.
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.
409 OperationConflict Request was denied due to conflict with a previos request. The error message returned because your request is conflicting with another request. Try again later.

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