Creates or clones an ApsaraDB for MongoDB replica set instance.
Before you call this operation, make sure that you fully understand the billing methods and pricing.
For more information about the instance types of ApsaraDB for MongoDB instances, see Instance types.
To create sharded cluster instances, you can call the CreateShardingDBInstance operation.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateDBInstance | The operation that you want to perform. Set the value to CreateDBInstance. |
RegionId | String | Yes | cn-hangzhou | The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list. |
ClientToken | String | No | ETnLKlblzczshOTUbOCz**** | The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. |
ZoneId | String | No | cn-hangzhou-g | The zone ID of the instance. You can call the DescribeRegions operation to query the most recent zone list. |
Engine | String | Yes | MongoDB | The engine of the instance. The value is set to MongoDB. |
EngineVersion | String | Yes | 4.4 | The engine version of the instance. Valid values:
Note If you call this operation to clone an instance, set the value to the engine of the source instance.
|
DBInstanceClass | String | Yes | dds.mongo.standard | The instance type. You can also call the DescribeAvailableResource operation to view instance types. |
DBInstanceStorage | Integer | Yes | 10 | The storage capacity of the instance. Unit: GB. The values that can be specified for this parameter are subject to the instance types. For more information, see Replica set instance types. |
DBInstanceDescription | String | No | test | The name of the instance. Valid values:
|
SecurityIPList | String | No | 192.168.xx.xx,192.168.xx.xx | The IP addresses in an IP address whitelist. Separate multiple IP addresses with commas (,). Each IP address in the IP address whitelist must be unique. The following types of IP addresses are supported:
|
AccountPassword | String | No | 123456Aa | The password of the root account. The password must meet the following requirements:
|
ChargeType | String | No | PrePaid | The billing method of the instance. Valid values:
Note If you specify this parameter to
PrePaid, you must also specify the
Period parameter.
|
Period | Integer | No | 1 | The subscription period of the instance. Unit: months. Valid values: 1 to 9, 12, 24, 36, and 60.
Note If you set the ChargeType property to PrePaid, you must configure this property.
|
NetworkType | String | No | VPC | The network type of the instance. Valid values: VPC |
VpcId | String | Yes | vpc-bp175iuvg8nxqraf2**** | The VPC ID of the instance. |
VSwitchId | String | Yes | vsw-bp1gzt31twhlo0sa5**** | The vSwitch ID of the instance. |
SrcDBInstanceId | String | No | dds-bp1ee12ad351**** | The ID of the source instance.
Note This parameter can only be specified when this operation is called to clone instances. You must also specify the
BackupId parameter or
RestoreTime parameter.
|
BackupId | String | No | 32994**** | The ID of the backup set. You can call the DescribeBackups operation to query the backup set ID.
Note This parameter is required only when you call this operation to clone an instance. If you specify this parameter, you must also specify the
SrcDBInstanceId parameter.
|
RestoreTime | String | No | 2022-03-13T12:11:14Z | The point in time to clone the instance, which must be within seven days. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.
Note This parameter is required only when you call this operation to clone an instance. If you specify this parameter, you must also specify the
SrcDBInstanceId parameter.
|
BusinessInfo | String | No | {“ActivityId":"000000000"} | The business information. This is an additional parameter. |
AutoRenew | String | No | true | Specifies whether to enable auto-renewal for the instance. Default value: false. Valid values:
Note If you set the
ChargeType parameter to
PrePaid, you must configure this optional parameter.
|
DatabaseNames | String | No | mongodbtest | The name of the database.
Note When you call this operation to clone an instance, you can set the databases that are specified by this parameter for cloning. Otherwise, all databases of the instance are cloned.
|
CouponNo | String | No | youhuiquan_promotion_option_id_for_blank | The coupon code. Default value: |
StorageEngine | String | No | WiredTiger | The storage engine of the instance. Default value: WiredTiger.
Note
|
ReplicationFactor | String | No | 3 | The number of nodes in the replica set instance. Default value: 3. Valid values:
|
ReadonlyReplicas | String | No | 0 | The number of read-only nodes in the replica set instance. Default value: 0. Valid values: 0 to 5. |
StorageType | String | No | cloud_essd | The storage type of the instance. Valid values:
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | D8F1D721-6439-4257-A89C-F1E8E9C9**** | The ID of the request. |
DBInstanceId | String | dds-bp144a7f2db8**** | Instance IDs. |
OrderId | String | 21077576248**** | The ID of the order. |
Examples
Sample requests
http(s)://mongodb.aliyuncs.com/?Action=CreateDBInstance
&RegionId=cn-hangzhou
&ClientToken=ETnLKlblzczshOTUbOCz****
&ZoneId=cn-hangzhou-g
&Engine=MongoDB
&EngineVersion=4.4
&DBInstanceClass=dds.mongo.standard
&DBInstanceStorage=10
&DBInstanceDescription=test
&SecurityIPList=192.168.xx.xx,192.168.xx.xx
&AccountPassword=123456Aa
&ChargeType=PrePaid
&Period=1
&NetworkType=VPC
&VpcId=vpc-bp175iuvg8nxqraf2****
&VSwitchId=vsw-bp1gzt31twhlo0sa5****
&BusinessInfo={“ActivityId":"000000000"}
&AutoRenew=true
&CouponNo=youhuiquan_promotion_option_id_for_blank
&StorageEngine=WiredTiger
&ReplicationFactor=3
&ReadonlyReplicas=0
&StorageType=cloud_essd
&SecondaryZoneId=cn-hangzhou-h
&HiddenZoneId=cn-hangzhou-i
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateDBInstanceResponse>
<RequestId>D8F1D721-6439-4257-A89C-F1E8E9C9****</RequestId>
<DBInstanceId>dds-bp144a7f2db8****</DBInstanceId>
<OrderId>21077576248****</OrderId>
</CreateDBInstanceResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "D8F1D721-6439-4257-A89C-F1E8E9C9****",
"DBInstanceId" : "dds-bp144a7f2db8****",
"OrderId" : "21077576248****"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidDBInstanceDescription.Malformed | Specified parameter DBInstanceDescription is not valid. | The error message returned because the node name is invalid. |
400 | InsufficientBalance | Your account does not have enough balance. | The error message returned because your payment failed. Add another payment method or add funds to your account and then try again. |
400 | InvalidCapacity.NotFound | The Capacity provided does not exist in our records. | The error message returned because the specified storage space of the instance is invalid. Specify a value within the valid value range. Unit: MB. |
400 | IdempotentParameterMismatch | Request uses a client token in a previous request but is not identical to that request. | The error message returned because the specified ClientToken parameter has been used. Specify a value that has not been used. You can use the client to generate the value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. |
403 | RealNameAuthenticationError | Your account has not passed the real-name authentication yet. | The error message returned because you have not completed real-name verification for your Alibaba Cloud account. Complete real-name verification and try again. |
403 | IncorrectBackupSetState | Current backup set state does not support operations. | The error message returned because the latest backup set is not ready. Try again later. |
For a list of error codes, visit the API Error Center.