Creates or clones an ApsaraDB for MongoDB replica set 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 instances, see Instance types.
To create sharded cluster instances, you can call the CreateShardingDBInstance 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:CreateDBInstance | 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 |
ClientToken | string | No | 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. | ETnLKlblzczshOTUbOCz**** |
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 |
EngineVersion | string | Yes | The version of the database engine. Valid values:
Note
When you call this operation to clone an instance or restore an instance from the recycle bin, set the value of this parameter to the engine version of the source instance.
| 4.4 |
DBInstanceClass | string | Yes | The instance type. You can also call the DescribeAvailableResource operation to query the instance type. | dds.mongo.standard |
DBInstanceStorage | integer | Yes | The storage capacity of the instance. Unit: GB. The values that can be specified for this parameter vary based on the instance types. For more information, see Replica set instance types. | 10 |
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. 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 |
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 |
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.
| PrePaid |
NetworkType | string | No | The network type of the instance. Valid value: VPC: Virtual Private Cloud (VPC) | VPC |
VpcId | string | Yes | The ID of the VPC. | vpc-bp175iuvg8nxqraf2**** |
VSwitchId | string | Yes | The ID of the vSwitch to which the instance is connected. | vsw-bp1gzt31twhlo0sa5**** |
SrcDBInstanceId | string | No | The ID of the source instance. Note
When you call this operation to clone an instance, this parameter is required. The BackupId or RestoreTime parameter is also required. When you call this operation to restore an instance from the recycle bin, this parameter is required. The BackupId or RestoreTime parameter is not required.
| dds-bp1ee12ad351**** |
BackupId | string | No | The ID of the backup set. You can call the DescribeBackups operation to query the backup set ID. Note
When you call this operation to clone an instance based on the backup set, this parameter is required. The SrcDBInstanceId parameter is also required.
| 32994**** |
RestoreTime | string | No | The point in time to which the instance is restored, which must be within seven days. The time is displayed in the yyyy-MM-ddTHH:mm:ssZ format (UTC time). Note
When you call this operation to restore an instance to the specified time, this parameter is required. The SrcDBInstanceId parameter is also required.
| 2022-03-13T12:11:14Z |
BusinessInfo | string | No | The business information. This is an additional parameter. | {“ActivityId":"000000000"} |
AutoRenew | string | No | Specifies whether to enable auto-renewal for the instance. Default value: false. Valid values:
Note
This parameter is valid and optional when the ChargeType parameter is set to PrePaid.
| true |
DatabaseNames | string | No | The name of the database. Note
When you call this operation to clone an instance, you can set this parameter to specify the database to clone. Otherwise, all databases of the instance are cloned.
| mongodbtest |
CouponNo | string | No | Specifies whether to use coupons. Default value: null. Valid values:
| youhuiquan_promotion_option_id_for_blank |
StorageEngine | string | No | The storage engine of the instance. Set the value to WiredTiger. Note
| WiredTiger |
ReplicationFactor | string | No | The number of nodes in the replica set instance. Default value: 3. Valid values:
| 3 |
ReadonlyReplicas | string | No | The number of read-only nodes in the replica set instance. Default value: 0. Valid values: 0 to 5. | 0 |
Engine | string | No | The database engine of the instance. Set the value to MongoDB. | MongoDB |
StorageType | string | No | The storage type of the instance. Valid values:
| cloud_essd1 |
SecondaryZoneId | string | No | The zone where the secondary node resides for multi-zone deployment. Valid values:
Note
| cn-hangzhou-h |
HiddenZoneId | string | No | The zone where the hidden node resides for multi-zone deployment. Valid values:
Note
| cn-hangzhou-i |
Tag | array<object> | No | The custom tags added to the instance. | |
object | No | The custom tags added to the instance. | ||
Key | string | No | The key of the tag. 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 value of the tag. 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 |
GlobalSecurityGroupIds | string | No | The global IP address whitelist template name of the instance. Multiple IP address whitelist template names are separated by commas (,) and each template name must be unique. (The template feature is available only in canary release.) | g-qxieqf40xjst1ngp**** |
Encrypted | boolean | No | Specifies whether to enable disk encryption. | true |
EncryptionKey | string | No | The ID of the custom key. | 2axxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
ProvisionedIops | long | No | The provisioned IOPS. Valid values: 0 to 50000. | 1960 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "D8F1D721-6439-4257-A89C-F1E8E9C9****",
"DBInstanceId": "dds-bp144a7f2db8****",
"OrderId": "21077576248****"
}
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 | MissingParameter | Period is mandatory for this action. | - |
400 | ORDER.ACCOUNT_INFORMATION_INCOMPLETE | Your information is incomplete. Complete your information before ordering. | - |
400 | InvalidClientToken.Malformed | Specified parameter ClientToken is not valid. | - |
400 | InvalidDBInstanceDescription.Malformed | Specified parameter DBInstanceDescription is not valid. | Invalid node name. |
400 | InvalidSecurityIPListLength.Malformed | The quota of security ip exceeds. | - |
400 | InsufficientBalance | Your account does not have enough balance. | The payment failed. Please add another payment method. You can also top up or add funds to your account. |
400 | QuotaExceed.AfterpayInstance | Living afterpay instances quota exceeded. | - |
400 | InvalidCapacity.NotFound | The Capacity provided does not exist in our records. | The specified storage capacity is invalid. Specify a storage capacity within a valid range. Unit: MB. |
400 | ResourceNotAvailable | Resource you requested is not available for finance user. | - |
400 | IdempotentParameterMismatch | Request uses a client token in a previous request but is not identical to that request. | The specified ClientToken parameter is already in use. Specify a client token that has not been used. The ClientToken value is generated by the client and must be unique among different requests. The value can be up to 64 ASCII characters in length and cannot contain non-ASCII characters. |
400 | InvalidSecurityIPList.Malformed | The specified parameter "SecurityIPList" is not valid. | - |
400 | InvalidSecurityIPList.Duplicate | The Security IP address is not in the available range or occupied. | - |
400 | InvalidSecurityIPListLength.Malformed | The quota of security ip exceeds. | - |
400 | InvalidDBInstanceStorage.ValueNotSupported | The specified parameter DBInstanceStorage is not valid. | - |
400 | InvalidAccountPassword.Malformed | Specified parameter AccountPassword is not valid. | - |
400 | TokenServiceError | Duplicate ClientToken request. | - |
400 | Zone.Closed | The specified zone is closed. | - |
400 | PRICE.ORIGIN_PRICE_ERROR | The origin price error. | - |
400 | NO_AVAILABLE_PAYMENT_METHOD | No payment method is specified for your account. We recommend that you add a payment method. | - |
400 | InvalidEcsImage.NotFound | Specified ecs image does not exist. | - |
400 | SaleValidateNoSpecificCodeFailed | Specified Storage or Version or InstanceClass is invalid. | - |
400 | Trade_Not_Support_Async_Pay | Trade not support async pay. | - |
400 | InvalidZoneld | The specified primary zone, secondary zone and hidden zone cannot be the same. | The parameters of the primary zone, secondary zone and hidden zone cannot be the same. |
400 | SameZoneId | The specified primary zone, secondary zone require two different zones. | The specified primary zone, secondary zone require two different zones. |
403 | RealNameAuthenticationError | Your account has not passed the real-name authentication yet. | Real-name verification has not been completed for the Alibaba Cloud account. Complete real-name verification and try again. |
403 | RegionUnauthorized | There is no authority to create instance in the specified region. | - |
403 | OperationDenied | The resource is out of usage. | - |
403 | InvalidEngineVersionInRegion.NotAvailable | The EngineVersion in the Region is not available. | - |
403 | InvalidBackupLogStatus | Current backup log enable status does not support this operation. | - |
403 | IncorrectBackupSetState | Current backup set state does not support operations. | The latest backup set is not ready. Please try again later. |
404 | InvalidBackup.NotFound | The available backup does not exist in recovery time. | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-07-15 | The Error code has changed | View Change Details |
2024-04-18 | The Error code has changed | View Change Details |
2024-03-13 | The Error code has changed | View Change Details |
2024-01-12 | The Error code has changed | View Change Details |
2023-11-03 | 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 |