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 | Yes | 
| Signature | string | User signature generated based on public key and API command, see Signature Algorithm | 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 route, enumeration value: International line, International; BGP line: Bgp; Premium BGP: BGPPro. Regions using BGP line: Beijing 2, Shanghai Financial Cloud, Shanghai 2, Guangzhou, etc., other regions all use international lines. 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] | 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] | 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.ucloud-global.com/?Action=AllocateEIP
&Bandwidth=2
&Tag=test
&PayMode=Bandwidth
&OperatorName=Bgp
&ChargeType=Month
&Region=cn-bj2
&UseType=GbJSTTUJ
&Count=7Response Example
{
  "Action": "AllocateEIPResponse",
  "EIPSet": [
    {
      "EIPAddr": [
        {
          "IP": "123.55.55.55",
          "OperatorName": "BGP"
        }
      ],
      "EIPId": "eip-nthrdr"
    }
  ],
  "RetCode": "0"
}