Creates or clones an ApsaraDB for MongoDB sharded cluster instance.
- Make sure that you fully understand the billing methods and pricing of ApsaraDB for MongoDB before you call this operation.
- For more information about the instance types of ApsaraDB for MongoDB instances, see Instance types.
- To create standalone and replica set instances, you can call the CreateDBInstance operation.
Debugging
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| RegionId | String | Yes | cn-hangzhou | The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list. |
| Action | String | Yes | CreateShardingDBInstance | The operation that you want to perform. Set the value to CreateShardingDBInstance. |
| 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. Set the value to MongoDB. |
| EngineVersion | String | Yes | 4.4 | The version of the database engine. Valid values:
Note
|
| 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 predicted values 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-bp1n3i15v90el48nx**** | The VPC ID of the instance. |
| VSwitchId | String | Yes | vsw-bp1vj604nj5a9zz74**** | The vSwitch ID of the instance. |
| SrcDBInstanceId | String | No | dds-bp11483712c1**** | The ID of the source database.
Note The ID of the source instance. This parameter is required only when you call this operation to clone an instance. If you specify this parameter, you must also specify the
RestoreTime parameter.
|
| RestoreTime | String | No | 2022-03-08T02:30:25Z | 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.
|
| 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. |
| StorageEngine | String | No | WiredTiger | The storage engine of the instance. Default value: WiredTiger.
Note
|
| 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.
|
| ProtocolType | String | No | mongodb | The access protocol type of the instance. Valid values:
|
| Mongos.N.Class | String | Yes | mdb.shard.2x.xlarge.d | The instance type of the mongos node. For more information, see Instance types.
Note
|
| ReplicaSet.N.Class | String | Yes | dds.shard.standard | The instance type of the shard node. For more information, see Instance types.
Note
|
| ReplicaSet.N.Storage | Integer | Yes | 10 | The storage capacity of the shard node. Unit: GB.
Note
|
| ReplicaSet.N.ReadonlyReplicas | Integer | No | 0 | The number of read-only nodes in shard node N. Valid values: 0 to 5. The value must be an integer. Default value: 0.
Note
N specifies the serial number of the shard node for which you want to set the number of read-only nodes.
ReplicaSet.2.ReadonlyReplicas specifies the number of read-only nodes in the second shard node.
|
| ConfigServer.N.Class | String | Yes | mdb.shard.2x.xlarge.d | The instance type of the Configserver node. Valid value:
|
| ConfigServer.N.Storage | Integer | Yes | 20 | The storage capacity of the Configserver node. Unit: GB.
Note The values that can be specified for this parameter are subject to the instance types. For more information, see
Instance types.
|
| StorageType | String | No | cloud_essd1 | The storage type of the instance. Valid values:
Note
|
Response parameters
| Parameter | Type | Example | Description |
|---|---|---|---|
| RequestId | String | D8F1D721-6439-4257-A89C-F1E8E9C9**** | The ID of the request. |
| DBInstanceId | String | dds-bp114f14849d**** | The ID of the instance |
| OrderId | String | 21010996721**** | The ID of the order. |
Examples
Sample requests
http(s)://mongodb.aliyuncs.com/?RegionId=cn-hangzhou
&Action=CreateShardingDBInstance
&ZoneId=cn-hangzhou-g
&Engine=MongoDB
&EngineVersion=4.4
&DBInstanceDescription=test
&SecurityIPList=192.168.xx.xx,192.168.xx.xx
&AccountPassword=123456Aa
&ChargeType=PrePaid
&Period=1
&NetworkType=VPC
&VpcId=vpc-bp1n3i15v90el48nx****
&VSwitchId=vsw-bp1vj604nj5a9zz74****
&SrcDBInstanceId=dds-bp11483712c1****
&RestoreTime=2022-03-08T02:30:25Z
&ClientToken=ETnLKlblzczshOTUbOCz****
&StorageEngine=WiredTiger
&AutoRenew=true
&ProtocolType=mongodb
&Mongos=[{"Class":"mdb.shard.2x.xlarge.d"}]
&ReplicaSet=[{"Class":"dds.shard.standard","Storage":10,"ReadonlyReplicas":0}]
&ConfigServer=[{"Class":"mdb.shard.2x.xlarge.d","Storage":20}]
&StorageType=cloud_essd1
&<Common request parameters>
Sample success responses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateShardingDBInstanceResponse>
<RequestId>D8F1D721-6439-4257-A89C-F1E8E9C9****</RequestId>
<DBInstanceId>dds-bp114f14849d****</DBInstanceId>
<OrderId>21010996721****</OrderId>
</CreateShardingDBInstanceResponse>
JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "D8F1D721-6439-4257-A89C-F1E8E9C9****",
"DBInstanceId" : "dds-bp114f14849d****",
"OrderId" : "21010996721****"
}
Error codes
For a list of error codes, see Service error codes.