# Apply for Elastic IP - AllocateEIP

## Overview

Apply for Elastic IP according to the provided information






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `AllocateEIP`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.scloudsg.com/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Region** | string | Region. |**Yes**|
| **ProjectId** | string | Project ID. If not filled in, the default project will be used. Sub-accounts must fill this in. |No|
| **OperatorName** | string | Elastic IP Line, Enumeration Value: International Line, International; BGP Line: BGP; Premium BGP: BGPPro; Native IP: Native; Premium Native IP: Resident;<br /><br />Regions using BGP Line: Beijing 2, Shanghai Financial Cloud, Shanghai 2, Guangzhou, etc., other regions use International Line. Regions using BGPPro Line: Hong Kong. |**Yes**|
| **Bandwidth** | int | The external bandwidth of the Elastic IP, measured in Mbps. For shared bandwidth mode, a bandwidth of 0M must be specified, while for non-shared bandwidth mode, a non-zero Mbps bandwidth must be specified. The bandwidth range for non-shared bandwidth in various regions is as follows: Traffic billing [1-300], Bandwidth billing [1-10000]. |**Yes**|
| **Tag** | string | Business Group Name, default is "Default"  |No|
| **ChargeType** | string | Payment method, enumeration values are: Year, pay yearly; Month, pay monthly; Dynamic, pay hourly, default is monthly payment. |No|
| **Quantity** | int | Purchase duration, default: 1 |No|
| **PayMode** | string | Billing mode for Elastic IP. Enumerated values: "Traffic", traffic billing; "Bandwidth", bandwidth billing; "ShareBandwidth", shared bandwidth mode. The default is "Bandwidth". "PostAccurateBandwidth": postpaid bandwidth mode. |No|
| **ShareBandwidthId** | string | Bound Shared Bandwidth Id, only effective when PayMode is set to ShareBandwidth |No|
| **Name** | string | The name of the Elastic IP, default is 'EIP'. |No|
| **Count** | int | Purchase EIP quantity, default value is 1 |No|
| **Remark** | string | Remarks for Elastic IP, default is empty |No|
| **CouponId** | string | Voucher ID, not used by default |No|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|
| **EIPSet** | array[[*UnetAllocateEIPSet*](#unetallocateeipset)] | Details of the applied EIP resource, see UnetAllocateEIPSet |No|

#### Data Model


#### UnetAllocateEIPSet

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **EIPId** | string | Applied EIP Resource ID |No|
| **EIPAddr** | array[[*UnetEIPAddrSet*](#uneteipaddrset)] | Applied IPv4 address. |No|

#### UnetEIPAddrSet

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **OperatorName** | string | Operator information such as: International: International, BGP: BGP |No|
| **IP** | string | IP Address |No|

## Example

### Request Example
    
```
https://api.scloudsg.com/?Action=AllocateEIP
&Region=IsYmCUMP
&ProjectId=nfabpHYH
&OperatorName=qqtzkCpB
&Bandwidth=1
&Tag=DqxUJhyX
&ChargeType=OuHdwKaC
&Quantity=8
&PayMode=PudYNDJM
&ShareBandwidthId=bDZpVZgP
&Name=KekWOUrd
&Count=5
&Remark=nuhSHeyw
&UseType=fQQfxVJU
&CouponId=zmtikLqz
&Filter=rmECToOF
&Filter=LvXcUAXM
&Filter=PIbwTDgb
&SpecifyProperties=whXMyPUD
&DisableFollowShareBandwidth=false
&DisableFollowShareBandwidth=false
```

### Response Example
    
```json
{
  "Action": "AllocateEIPResponse",
  "EIPSet": [
    {
      "EIPAddr": [
        {
          "IP": "PnNnmXmG",
          "OperatorName": "nJUeUHCY"
        }
      ],
      "EIPId": "ugxqCAlm"
    }
  ],
  "RetCode": 0
}
```





