# Create Replica Set - CreateUMongoDBReplSet

## Overview

Create a Mongodb replica set cluster






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `CreateUMongoDBReplSet`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.surfercloud.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. See [List of Regions and Availability Zones](/docs/api/summary/regionlist) |**Yes**|
| **Zone** | string | Availability Zone. See [Availability Zone List](/docs/api/summary/regionlist) |**Yes**|
| **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|
| **Name** | string | Replica set instance name, at least 6 characters |**Yes**|
| **DBVersion** | string | Version of Mongodb's replica set, such as MongoDB 3.6, MongoDB 4.2 |**Yes**|
| **AdminPassword** | string | Administrator Password |**Yes**|
| **DiskSpace** | int | Disk space (GB): Values ​​range from 20 to 32000, and only multiples of 10 are supported. |**Yes**|
| **MachineTypeId** | string | Machine configuration, such as o.mongo2m.medium |**Yes**|
| **NodeCount** | int | Replica set node count: Only odd numbers of nodes (3, 5, or 7) are supported. |**Yes**|
| **ListenPort** | int | Mongo service port |No|
| **SubnetId** | string | Subnet ID |No|
| **VPCId** | string | ID of VPC |No|
| **Tag** | string | The name of the business group where the instance is located |No|
| **ChargeType** | string | Payment methods: Yearly, Monthly, Dynamic, Trial, Default: Monthly |No|
| **Quantity** | int | Purchase duration, default value 1 |No|
| **CrossZones.N** | string | Cross Zone List |No|
| **Labels.N.Key** | string | Keys of User Resource Label |No|
| **Labels.N.Value** | string | Values of User Resource Label |No|
| **SecGroupId.N.Id** | string | Security Group ID. Up to 5 security groups can be bound at the same time. |No|
| **SecGroupId.N.Priority** | int | Security Group Priority. Value range [1, 5] |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|




## Example

### Request Example
    
```
https://api.surfercloud.com/?Action=CreateUMongoDBReplSet
&Region=cn-zj
&Zone=cn-zj-01
&ProjectId=dHsclqIa
&Name=FtgAKIEl
&DBVersion=wqUloOJO
&AdminPassword=wpDUSWbu
&DiskSpace=uDHddgoU
&MachineTypeId=HDnfeFgp
&NodeCount=8
&SubnetId=QmISYYRw
&VPCId=SvxLSwuj
&Tag=wDGWVOqD
&ChargeType=Year
&Quantity=6
&ListenPort=3
&EnableIPv6=false
&CrossZones=RmwqFfiy
&Labels.N.Key=gpVqLtGp
&Labels.N.Value=yyBLOUkZ
&SecGroupId.N.Id=gpVasnJN
&SecGroupId.N.Priority=6
```

### Response Example
    
```json
{
  "Action": "CreateUMongoDBReplSetResponse",
  "RetCode": 0
}
```





