AllocateEipAddresses
1. API Description
This API is used to apply for one or multiple elastic IPs.
Prerequisites
Query available elastic IPs in zone: call
DescribeEipAvailableResources
to check the stock of the specified zone.Cost estimation: know of the pricing model of elastic IPs. See Elastic IP for details.
Note
If you create a subscription elastic IP, the amount required will be pre-deducted. If the balance is insufficient, the request will fail. If you create a pay-as-you-go elastic IP, please ensure your account balance is sufficient before calling this API.
Vouchers can be used for fee deduction in creation. See Vouchers for more details.
This API is an async API. An ID list is returned after the request is sent. However, it does not mean the creation has been completed. The status of the elastic IP will be or
CREATING
during the creation. You can useDescribeEipAddresses
to query the status of the elastic IP. If the status changes fromCreating
toAvailable
, it means that the elastic IP has been created successfully;CREATE_FAILED
means the elastic IP has been created failed. Any operations on the elastic IPs are not allowed while creating.A maximum of 100 elastic IPs can be created in one request.
2. Input Parameters
The following request parameter list only provides API request parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
zoneId | Yes | String | Zone ID to which the elastic IPs belong. |
eipChargeType | Yes | String | |
eipChargePrepaid | No | Details of the monthly subscription, including the purchase period, auto-renewal. It is required if the | |
amount | No | Integer | Quantity of elastic IPs. Value range: 1-100. Default value: 1. |
resourceGroupId | No | String | Resource group ID If the value is not passed in, the elastic IP will be put into the default resource group. If no authorized default resource group found, the request will fail. |
3. Output Parameters
Parameter Name | Type | Description |
---|---|---|
eipIdSet | Array of String | ID list of elastic IPs.
The returned ID list does not mean the creation has been completed. You can call |
orderNumber | String | Number of order. This parameter returns when |
requestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
4. Code Example
Create a pay-as-you -go elastic IP with the simplest parameters in zone: SEL-A
5. Developer Resources
Zenlayer Cloud API 2.0 integrates SDKs to make it easier for you to call APIs. More programming languages will be supported.
6. Error Codes
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
HTTP Status Code | Error Code | Description |
---|---|---|
404 | INVALID_ZONE_NOT_FOUND | Zone does not exist. |
400 | INVALID_EIP_TYPE_ZONE_NO_SELL | Elastic IPs not available for sale in zone. |
400 | MISSING_PARAMETER | The parameter is empty. |
Last updated