# Create DB Replica Set - CreateMongoDBReplicaSet

## Overview

One-click Create DB Replica Set,This API applies to Bare Metal MongoDB. This architecture will be deprecated soon. If you want to use QuickJet MongoDB, please refer to QuickJet MongoDB API Documentation






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `CreateMongoDBReplicaSet`.                      | **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. 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 | PrimaryDB instance name, at least 6 characters |**Yes**|
| **AdminPassword** | string | Administrator Password |**Yes**|
| **DBTypeId** | string | String form of DB type id corresponding to mongodb-3.4, mongodb-3.6, mongodb-4.0 |**Yes**|
| **DiskSpace** | int | Disk Space (GB), temporarily supports 20G - 3000G |**Yes**|
| **ParamGroupId** | int | Configuration parameter group id used by the DB instance |**Yes**|
| **MemoryLimit** | int | Memory Limit (MB), currently supports the following levels 2000M/4000M/ 6000M/8000M/12000M/16000M/ 24000M/32000M/48000M/ 64000M/96000M |**Yes**|
| **Port** | int | Port Number |**Yes**|
| **ChargeType** | string | Yearly, Monthly, Dynamic, Trial, Default: Monthly |No|
| **Quantity** | int | Purchase duration (N months), default value is 1 month. If it is 0, it means purchase until the end of the month. |No|
| **AdminUser** | string | Administrator account name, default is root |No|
| **BackupCount** | int | Backup strategy, number of backups per week, default is 7 times |No|
| **BackupTime** | int | Backup strategy, backup start time, calculated in units of hours, default is 1 o'clock |No|
| **BackupDuration** | int | Backup strategy, backup time interval, calculated in hours, default is 24 hours. |No|
| **CPU** | int | CPU Cores |No|
| **SubnetId** | string | Subnet ID |No|
| **VPCId** | string | ID of VPC |No|
| **ClusterId** | string | ID of the affiliated shard cluster |No|
| **CouponId.N** | string | CouponId.0 represents the first coupon id, for multiple coupon ids input, the following are CouponId.1, CouponId.2 and so on. |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|
| **DBIds** | array[string] | Return the Id of all replica set members |No|




## Example

### Request Example
    
```
https://api.scloudsg.com/?Action=CreateMongoDBReplicaSet
&Region=cosmAFbt
&Zone=xBxVTiMQ
&ProjectId=jrKVXipN
&Name=ydhfcdle
&AdminPassword=IMYNtZID
&DBTypeId=csTyuCveUvRbSNuMEQjiZkVcZdbiJnzuoxyZEfCPaUaMqJkcULmxcWTuGzYIaJdNtyPyfTifdEQIWGFGALkrDbHvVVAiRmdqHvtMBSsnnFRRLSOnMoAKdzSaBPxbEKrwVPZHMtivhOKqIPdMYnnbZklWtPCuHzGdwkfoPQFNAgEzLdxQieISIPOlTBdJYUfLGvCjtzICKdUaSlstsdQMvHluipqJscHJfpzqQBLYJSclSxXLtpxoiDYEjZdGmjeBsVpxcNIKIsRAHLLVLAtzGdsKbmyZphqiTHhjAHvtcmtccHYmqdeYMNLRMingKSPGgEFpqVmkvOrwAngbxiOwCDkgOVstLPwptFuYUfSzopDWOhupQAWKZDVEsADvdcBQTUXzrclMdoQhFusTDPWxmyGfWuwfzlNDgMhGaNWZkNKJQFRiDQgueKwnOvlzKfRuXGserAzG
&DiskSpace=8
&ParamGroupId=8
&MemoryLimit=2
&Quantity=7
&Port=7
&ChargeType=HDrrxEEl
&AdminUser=EbSfMBeG
&BackupCount=3
&BackupTime=2
&BackupDuration=7
&UseSSD=true
&SSDType=TnKaeTIe
&CPU=8
&InstanceType=JSduiQwk
&SubnetId=tjsNjPHZ
&VPCId=mCBucsAy
&ClusterId=LvRXciyw
&CouponId.n=uBpRaUqU
```

### Response Example
    
```json
{
  "Action": "CreateMongoDBReplicaSetResponse",
  "DBIds": [
    "DUZMytjm"
  ],
  "RetCode": 0
}
```





