Domain name for API request: mongodb.intl.tencentcloudapi.com.
This API is used to create a yearly/monthly subscription TencentDB for MongoDB instance. The DescribeSpecInfo API can be called to query and obtain the supported sales specifications.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: CreateDBInstance. |
| Version | Yes | String | Common Params. The value used for this API: 2019-07-25. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| NodeNum | Yes | Integer |
|
| Memory | Yes | Integer | Instance memory size. Unit: GB. Call the DescribeSpecInfo API to obtain specific saleable memory specifications. |
| Volume | Yes | Integer | Instance disk size. Unit: GB. Call the DescribeSpecInfo API to obtain the maximum and minimum disk sizes corresponding to each CPU specification. |
| MongoVersion | Yes | String | Refers to version information. For supported versions, use the interface DescribeSpecInfo to query.
|
| GoodsNum | Yes | Integer | Number of instances. The minimum value is 1, and the maximum value is 30. |
| Zone | Yes | String | AZ information. The input format must be ap-guangzhou-2.
|
| Period | Yes | Integer | Specifies the purchase duration during instance purchase. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, and 36. Unit: months. |
| MachineCode | Yes | String | Recommended product specification types:
Product allowlist specification types:
Note: Allowlist specification types are under allowlist control. If needed, submit a ticket to apply. |
| ClusterType | Yes | String | Instance architecture type.
|
| ReplicateSetNum | Yes | Integer |
|
| ProjectId | No | Integer | Project ID.
|
| VpcId | No | String | VPC ID.
|
| SubnetId | No | String | Subnet ID of the VPC.
|
| Password | No | String | Instance password. The requirements are as follows:
|
| Tags.N | No | Array of TagInfo | Instance tag information. |
| AutoRenewFlag | No | Integer | Auto-renewal flag.
|
| AutoVoucher | No | Integer | Indicates whether to automatically select voucher.
|
| Clone | No | Integer | Instance type.
|
| Father | No | String | Parent instance ID.
|
| SecurityGroup.N | No | Array of String | Security group ID. Log in to the security group console to obtain the ID of the security group within the same region as the database instance. |
| RestoreTime | No | String | Rollback time of the cloned instance. It is required when the Clone value is 5 or 6. - This parameter is required for cloned instances. Format: 2021-08-13 16:30:00. - Rollback time range: Only data within the last 7 days can be rolled back. |
| InstanceName | No | String | Instance name. Only Chinese, English, digits, underscores (_), and hyphens (-) are supported, with a maximum length of 128 characters. When purchasing database instances in batches, you can efficiently set instance names by using custom pattern strings and automatically ascending numeric suffixes.
|
| AvailabilityZoneList.N | No | Array of String | For cloud database instances in multi-AZ deployment, specify the availability zone list.
|
| MongosCpu | No | Integer | Number of Mongos node CPU cores. Valid values: 1, 2, 4, 8, and 16. This parameter is required during sharded cluster instance purchase. |
| MongosMemory | No | Integer | Mongos node memory size.
|
| MongosNodeNum | No | Integer | Number of Mongos nodes. This parameter is required during sharded cluster instance purchase.
|
| ReadonlyNodeNum | No | Integer | Number of read-only nodes. Value ranges from 0 to 5. |
| ReadonlyNodeAvailabilityZoneList.N | No | Array of String | Array of AZs of read-only nodes. This parameter is required for instances in multi-AZ deployment mode when ReadonlyNodeNum is not set to 0. |
| HiddenZone | No | String | Availability zone of the Hidden node. To deploy instances across availability zones, you must configure this parameter. |
| ParamTemplateId | No | String | Parameter template ID.
|
| CpuCore | No | Integer | Instance CPU core size. Unit: C. Call the DescribeSpecInfo API to obtain specific saleable CPU specifications. |
| Parameter Name | Type | Description |
|---|---|---|
| DealId | String | Order ID |
| InstanceIds | Array of String | List of instance created IDs |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
This example applies only to version 4.0. For other versions, see the version description for the input parameters.
POST / HTTP/1.1
Host: mongodb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateDBInstance
<Common request parameters>
{
"VpcId": "vpc-0akbol5v",
"GoodsNum": 1,
"Zone": "ap-guangzhou-2",
"ProjectId": 0,
"MachineCode": "HIO10G",
"Period": 1,
"ClusterType": "REPLSET",
"Volume": 250,
"MongoVersion": "MONGO_40_WT",
"NodeNum": 3,
"ReplicateSetNum": 1,
"Memory": 4,
"SubnetId": "subnet-fyrtjbqw",
"Password": "pwd123456"
}
{
"Response": {
"RequestId": "d88095e5-50e8-4245-a0cf-993a536f9b20",
"DealId": "7142863",
"InstanceIds": [
"cmgo-po5f899l"
]
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| InvalidParameter | Parameter error |
| InvalidParameter.PermissionDenied | The current sub-account has no permission to perform this operation. |
| InvalidParameterValue.InvalidTradeOperation | Billing error. Corresponding purchase/renewal/configuration change operations are not allowed for the current instance. |
| InvalidParameterValue.MachineTypeError | Incorrect model. |
| InvalidParameterValue.MongoVersionError | The instance version is incorrect. |
| InvalidParameterValue.NotFoundInstance | The instance was not found. |
| InvalidParameterValue.PasswordRuleFailed | The password is non-compliant. |
| InvalidParameterValue.ProjectNotFound | The project does not exist. |
| InvalidParameterValue.RegionError | Invalid region |
| InvalidParameterValue.ReplicaSetNumError | Incorrect number of replica sets (shards). |
| InvalidParameterValue.SecondaryNumError | Incorrect number of secondary nodes. |
| InvalidParameterValue.SpecNotOnSale | Incorrect purchasable specification. |
| InvalidParameterValue.TagNotFound | The specified tag was not found. |
| InvalidParameterValue.VpcIdOrSubnetIdNotFound | The VPC (subnet) was not found. |
| InvalidParameterValue.ZoneClosed | Instances are not purchasable in this AZ. |
| InvalidParameterValue.ZoneError | Invalid availability zone |
| UnsupportedOperation.VersionNotSupport | The current version does not support the operation. |
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback