You can call this operation to apply for a contiguous Elastic IP address.

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 Yes AllocateEipSegmentAddress

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

EipMask String Yes /32

The mask of the contiguous Elastic IP address group. Valid values:

  • 28: 16 contiguous IP addresses are allocated for one call.
  • 27: 32 contiguous IP addresses are allocated for one call.
  • 26: 64 contiguous IP addresses are allocated for one call.
  • 25: 128 contiguous IP addresses are allocated for one call.
  • 24: 256 contiguous IP addresses are allocated for one call.
RegionId String Yes cn-hangzhou

The ID of the region to which the contiguous Elastic IP address belongs. You can call the DescribeRegions operation to query the region ID.

ClientToken String No 02fb3da4-130e-11e9-8e44-001sdfg

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 ensure that the token is unique among different requests. The token must be a maximum of 64 characters in length and can contain only ASCII characters.

Bandwidth String No 5

The peak bandwidth of the contiguous Elastic IP address. Unit: Mbit/s. Default value: 5.

Netmode String No public

The network type. Valid values:

  • public: the Internet. This is the default value. After a contiguous Elastic IP address is associated with a cloud resource, the cloud resource can access the Internet by using the Elastic IP address.
  • hybrid: the hybrid cloud. After a contiguous Elastic IP address is associated with a cloud resource, the cloud resource can access the hybrid cloud by using the Elastic IP address.
Note This network type is available only to users who are added to the whitelist. To use this network type, contact your customer manager.
InternetChargeType String No PayByBandwidth

The billing method of the contiguous Elastic IP address. Valid values:

  • PayByBandwidth: This is the default value.
  • PayByTraffic.
Note If the Netmode parameter is set to hybrid, only PayByBandwidth is available for InternetChargeType.
ResourceGroupId String No rg-bp67acfmxazb4ph****

The ID of the resource group.

Response parameters

Parameter Type Example Description
EipSegmentInstanceId String eipsg-2zett8ba055tbsxme****

The ID of the instance with which the contiguous Elastic IP address group is associated.

OrderId Long 20190000

The ID of the order.

RequestId String F7A6301A-64BA-41EC-8284-8F4838C15D1F

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/? Action=AllocateEipSegmentAddress
&EipMask=/32
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

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

JSON format

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

Error codes

HTTP status code Error code Error message Description
403 Forbidden 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.
400 QuotaExceeded.Eip Elastic IP address quota exceeded The error message returned because the number of Elastic IP addresses exceeds the threshold. To obtain more Elastic IP addresses, 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 specified InternetChargeType value 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 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 Elastic IP addresses exceeds the threshold. To obtain more Elastic IP addresses, submit a ticket. We recommend that you use NAT gateways.
400 ReserveIpFail Reserve eip failed. The error message returned because the specified Elastic IP address fails to reserve.
400 InvalidRegion.NotSupport The specified region does not support. The error message returned because the specified region ID does not support this operation.
409 OperationConflict Request was denied due to conflict with a previous request. The error message returned because a request conflict occurs. Try again later or submit a ticket.

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