Creates or clones an ApsaraDB for MongoDB sharded cluster instance.
Operation description
- 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, see Instance types.
- To create standalone instances and replica set instances, you can call the CreateDBInstance operation.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
dds:CreateShardingDBInstance | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
ZoneId | string | No | The zone ID of the instance. You can call the DescribeRegions operation to query the most recent zone list. | cn-hangzhou-g |
Engine | string | Yes | The database engine of the instance. Set the value to MongoDB. | MongoDB |
EngineVersion | string | Yes | The database engine version of the instance. Valid values:
Note
Enumeration Value:
| 4.4 |
DBInstanceDescription | string | No | The name of the instance. The name of the instance must meet the following requirements:
| test |
SecurityIPList | string | No | The IP addresses in an IP address whitelist of the instance. Multiple IP addresses are separated by commas (,), and each IP address in the IP address whitelist must be unique. The following types of values 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:
| 123456Aa |
ChargeType | string | No | The billing method of the instance. Valid values:
Note
If this parameter is set to PrePaid, you must also configure the Period parameter.
| PrePaid |
Period | integer | No | The subscription period of the instance. Unit: months. Valid values: 1 to 9, 12, 24, 36, and 60. Note
When you set the ChargeType parameter to PrePaid, this parameter is valid and required.
| 1 |
NetworkType | string | No | The network type of the instance. Set the value to VPC. | VPC |
VpcId | string | Yes | The ID of the VPC. | vpc-bp1n3i15v90el48nx**** |
VSwitchId | string | Yes | The vSwitch ID of the instance. | vsw-bp1vj604nj5a9zz74**** |
SrcDBInstanceId | string | No | The source instance ID. Note
This parameter is required only if you call this operation to clone an instance. If you specify this parameter, you must also specify RestoreTime.
| dds-bp11483712c1**** |
RestoreTime | string | No | The point in time to restore the instance, which must be within seven days. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in Coordinated Universal Time (UTC). Note
This parameter is required only if you call this operation to clone an instance. If you specify this parameter, you must also specify SrcDBInstanceId.
| 2022-03-08T02:30:25Z |
ClientToken | string | No | The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. | ETnLKlblzczshOTUbOCz**** |
StorageEngine | string | No | The storage engine of the instance. Set the value to WiredTiger. Note
| WiredTiger |
AutoRenew | string | No | Specifies whether to enable auto-renewal for the instance. Valid values:
Note
This parameter is available and optional if you set the value of ChargeType to PrePaid.
| true |
ProtocolType | string | No | The access protocol type of the instance. Valid values:
| mongodb |
Mongos | array<object> | Yes | The mongos nodes of the instance. | |
object | Yes | The information about the array object. | ||
Class | string | Yes | The instance type of the mongos node. For more information, see Sharded cluster instance types. Note
| mdb.shard.2x.xlarge.d |
ReplicaSet | array<object> | Yes | The information of the shard node. | |
object | Yes | The information about the array object. | ||
Class | string | Yes | The instance type 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, 1, 2, 3, 4, and 5. 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.
| 0 |
ConfigServer | array<object> | Yes | The ConfigServer nodes of the instance. | |
object | Yes | The information about the array object. | ||
Class | string | Yes | The instance type of the ConfigServer node. Valid values:
| mdb.shard.2x.xlarge.d |
Storage | integer | Yes | The storage space of the ConfigServer node. Unit: GB. Note
The values that can be specified for this parameter vary based on the instance types. For more information, see Sharded cluster instance types.
| 20 |
SecondaryZoneId | string | No | The ID of secondary zone 1 for multi-zone deployment. Valid values:
Note
| cn-hangzhou-h |
HiddenZoneId | string | No | The ID of secondary zone 2 for multi-zone deployment. Valid values:
Note
| cn-hangzhou-i |
StorageType | string | No | The storage type of the instance. Valid values:
Note
| cloud_essd1 |
GlobalSecurityGroupIds | string | No | The global IP address whitelist template of the instance. Separate multiple templates with commas (,). The template name must be globally unique. | g-qxieqf40xjst1ngp**** |
Tag | array<object> | No | The custom tags that you want to add to the instance. | |
object | No | The custom tags added to the instance. | ||
Key | string | No | The tag key. Note
N specifies the serial 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 tag value. Note
N specifies the serial 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 | Indicates whether disk encryption is enabled. | true |
EncryptionKey | string | No | The ID of the custom key. | 2axxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
ProvisionedIops | long | No | The provisioned IOPS of the instance: | 1960 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "D8F1D721-6439-4257-A89C-F1E8E9C9****",
"DBInstanceId": "dds-bp114f14849d****",
"OrderId": "21010996721****"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
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. |
400 | InvalidParameters.Format | Specified parameters is not valid. |
403 | InvalidBackupLogStatus | Current backup log enable status does not support this operation. |
500 | VpcServiceError | Invoke vpc service error. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-03-13 | The Error code has changed | View Change Details |
2024-03-13 | The Error code has changed | View Change Details |
2023-08-24 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-08-01 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-06-05 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2022-10-13 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2021-12-27 | The Error code has changed | View Change Details |
2021-12-27 | The Error code has changed. The request parameters of the API has changed | View Change Details |