Creates or clones an ApsaraDB for MongoDB sharded cluster instance.
Operation description
-
Before calling this operation, make sure that you fully understand the billing methods and pricing of ApsaraDB for MongoDB.
-
For more information about the specifications of ApsaraDB for MongoDB instances, see Instance specifications.
-
To create a standalone instance or a replica set instance, call the CreateDBInstance operation.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dds:CreateShardingDBInstance |
create |
*Instance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. You can call the DescribeRegions operation to query the region ID. |
cn-hangzhou |
| ZoneId |
string |
No |
The zone ID. You can call the DescribeRegions operation to query the zone ID. |
cn-hangzhou-g |
| Engine |
string |
Yes |
The database engine. Set the value to MongoDB. Valid values:
|
MongoDB |
| EngineVersion |
string |
Yes |
The database version number. Valid values:
Note
|
4.4 |
| DBInstanceDescription |
string |
No |
The name of the instance. The name must meet the following requirements:
|
test |
| SecurityIPList |
string |
No |
The IP address whitelist of the instance. Separate multiple IP addresses with commas (,). Duplicate IP addresses are not supported. The following formats are supported:
Note
|
192.168.xx.xx,192.168.xx.xx |
| AccountPassword |
string |
No |
The password of the root account. The password must meet the following requirements:
Note
For more information about how to troubleshoot connection failures caused by special characters in database connection string, see What do I do if database connection to an ApsaraDB for MongoDB instance fails because the username or password in database connection string contains special characters?. |
123456Aa |
| ChargeType |
string |
No |
The billing method of the instance. Valid values:
Note
If you set this parameter to PrePaid, you must also specify the Period parameter. Valid values:
|
PrePaid |
| Period |
integer |
No |
The subscription duration of the instance. Unit: months. Valid values: 1 to 9, 12, 24, 36, and 60. Note
This parameter is required and takes effect only when the ChargeType parameter is set to PrePaid. |
1 |
| NetworkType |
string |
No |
The network type of the instance. Valid values:
Valid values:
|
VPC |
| VpcId |
string |
No |
The VPC ID. |
vpc-bp1n3i15v90el48nx**** |
| VSwitchId |
string |
No |
The vSwitch ID. |
vsw-bp1vj604nj5a9zz74**** |
| SrcDBInstanceId |
string |
No |
The source instance ID. Note
This parameter is required only when you call this operation to clone an instance. You must also specify the RestoreTime parameter. |
dds-bp11483712c1**** |
| RestoreTime |
string |
No |
The point in time to which you want to restore the instance. You can specify any point in time within the last 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. You must also specify the SrcDBInstanceId parameter. |
2022-03-08T02:30:25Z |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request and prevent duplicate submissions. You can use the client to generate the token, but you must ensure that the token is unique among different requests. The token can contain a maximum of 64 ASCII characters and cannot contain non-ASCII characters. |
ETnLKlblzczshOTUbOCz**** |
| StorageEngine |
string |
No |
The storage engine of the instance. Set the value to WiredTiger. Note
Valid values:
|
WiredTiger |
| AutoRenew |
string |
No |
Specifies whether to enable auto-renewal for the instance. Valid values:
Note
This parameter is available and optional only when the ChargeType parameter is set to PrePaid. |
true |
| ProtocolType |
string |
No |
The type of the access protocol. Valid values:
Valid values:
|
mongodb |
| Mongos |
array<object> |
Yes |
The information about the mongos nodes. |
|
|
object |
Yes |
The information about the mongos nodes. |
||
| Class |
string |
Yes |
The specifications of the mongos node. For more information, see Sharded cluster instance types. Note
|
mdb.shard.2x.xlarge.d |
| ReplicaSet |
array<object> |
Yes |
The information about the shard nodes. |
|
|
object |
No |
The information about the shard nodes. |
||
| Class |
string |
Yes |
The specifications of the shard node. For more information, see Sharded cluster instance types. Note
|
dds.shard.standard |
| Storage |
integer |
Yes |
The storage capacity of the shard node. Unit: GB. Note
|
10 |
| ReadonlyReplicas |
integer |
No |
The number of read-only nodes in the shard node. Valid values: 0 to 5. Default value: 0. Note
N in the parameter name specifies the sequence number of the shard node. For example, ReplicaSet.2.ReadonlyReplicas specifies the number of read-only nodes in the second shard node. |
0 |
| ConfigServer |
array<object> |
Yes |
The information about the ConfigServer nodes. |
|
|
object |
No |
The information about the ConfigServer nodes. |
||
| Class |
string |
Yes |
The specifications of the ConfigServer node. Valid values:
|
mdb.shard.2x.xlarge.d |
| Storage |
integer |
Yes |
The storage capacity of the ConfigServer node. Unit: GB. Note
The valid values are subject to the instance specifications. For more information, see Sharded cluster instance types. |
20 |
| SecondaryZoneId |
string |
No |
The ID of the resource group. For more information, see View the basic information of a resource group. |
rg-acfmyiu4ekp**** |
| HiddenZoneId |
string |
No |
The secondary zone 1 for multi-zone deployment. Valid values:
Note
|
cn-hangzhou-h |
| StorageType |
string |
No |
The secondary zone 2 for multi-zone deployment. Valid values:
Note
|
cn-hangzhou-i |
| GlobalSecurityGroupIds |
string |
No |
The storage type. Valid values:
Note
|
cloud_essd1 |
| Tag |
array<object> |
No |
The global IP address whitelist templates of the instance. Separate multiple templates with commas (,). Duplicate templates are not supported. |
g-qxieqf40xjst1ngpr3jz |
|
object |
No |
|||
| Key |
string |
No |
The key of the tag. Note
N specifies the sequence number of the tag. For example, Tag.1.Key specifies the key of the first tag, and Tag.2.Key specifies the key of the second tag. |
testdatabase |
| Value |
string |
No |
The value of the tag. Note
N specifies the sequence number of the tag. For example, Tag.1.Value specifies the value of the first tag, and Tag.2.Value specifies the value of the second tag. |
apitest |
| Encrypted |
boolean |
No |
The custom tags. |
true |
| EncryptionKey |
string |
No |
Specifies whether to enable cloud disk encryption. |
true |
| ProvisionedIops |
integer |
No |
The ID of the custom key. |
2axxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| SrcRegion |
string |
No |
The provisioned IOPS. |
1960 |
| BackupId |
string |
No |
The region where the source instance is located. Note
|
cn-beijing |
| RestoreType |
string |
No |
The ID of the cluster backup. Note
|
cb-xxx |
| DestRegion |
string |
No |
The backup restoration type. Valid values:
|
1 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response information. |
||
| RequestId |
string |
The request ID. |
D8F1D721-6439-4257-A89C-F1E8E9C9**** |
| DBInstanceId |
string |
The instance ID. |
dds-bp114f14849d**** |
| OrderId |
string |
The order ID. |
21010996721**** |
Examples
Success response
JSON format
{
"RequestId": "D8F1D721-6439-4257-A89C-F1E8E9C9****",
"DBInstanceId": "dds-bp114f14849d****",
"OrderId": "21010996721****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | SecurityRisk.AuthVerification | we have detected a risk with your default payment method. An email and notification has been sent to you. Please re-submit your order before after verificaiton. | |
| 400 | InvaliadParameter.ShardsCount.LessThanSrc | The specified number of shards is less than that of source instance. | |
| 400 | ORDER.ACCOUNT_INFORMATION_INCOMPLETE | Your information is incomplete. Complete your information before ordering. | |
| 400 | InvalidRegion.Format | Specified Region is not valid. | |
| 400 | Zone.Closed | The specified zone is closed. | |
| 400 | TokenServiceError | The request token is duplicated. | |
| 400 | InvalidParam | Param not valid. | |
| 400 | InvalidEngineVersion.Malformed | Specified engine version is not valid. | The instance version information is empty or invalid. |
| 400 | InvalidParameters.Format | Specified parameters is not valid. | The parameter entered is invalid. |
| 400 | RestoreTypeNotSupported | The specified restoreType is not supported for the instance, check the input parameters 'RestoreType/BackupID/RestoreTime'. | The specified restoreType is not supported for the instance, check the input parameters 'RestoreType/BackupID/RestoreTime'. |
| 500 | VpcServiceError | Invoke vpc service error. | An error occurred when calling the VPC service. |
| 403 | InvalidBackupLogStatus | Current backup log enable status does not support this operation. | |
| 403 | ReduceDiskNotSupport | Reduce disk size is not supported in clone/restore. | Reduce disk size is not supported in clone/restore. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.