# Apply for Private Network Virtual IP - AllocateVIP

## Overview

Based on the provided information, apply for an internal network VIP (Virtual IP), which is often used as a floating IP for high-availability applications.






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `AllocateVIP`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.genesissai.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**|
| **Zone** | string | Availability Zone |No|
| **ProjectId** | string | Project ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the [GetProjectList interface](/docs/api/summary/get_project_list). |No|
| **VPCId** | string | Specify the VPC to which the VIP belongs |**Yes**|
| **SubnetId** | string | Subnet ID |**Yes**|
| **Ip** | string | Specify IP |No|
| **Count** | int | Quantity applied, default: 1 |No|
| **Name** | string | VIP name, default: VIP |No|
| **Tag** | string | Business group name, default is Default |No|
| **Remark** | string | Note |No|
| **BusinessId** | string | Business Group |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|
| **VIPSet** | array[[*VIPSet*](#vipset)] | Information related to the VIP resources applied for |No|
| **DataSet** | array[string] | Applied VIP Address |No|

#### Data Model


#### VIPSet

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **VIP** | string | Virtual IP |No|
| **VIPId** | string | Virtual IP ID |No|
| **VPCId** | string | VPC id |No|

## Example

### Request Example
    
```
https://api.genesissai.com/?Action=AllocateVIP
&Region=cn-bj2
&ProjectId=org-XXXX
&Zone=cn-bj2-04
&VPCId=vnet-XXXXXX
&SubnetId=subnet-XXX
&Ip=ccjyLEtQ
```

### Response Example
    
```json
{
  "Action": "AllocateVIPResponse",
  "DataSet": [
    "10.25.XX.111"
  ],
  "RetCode": 0,
  "VIPSet": [
    {
      "VIP": "10.25.XX.111",
      "VIPId": "vip-XXXXXX",
      "VPCId": "uvnet-XXXXX"
    }
  ]
}
```





