Create Database - CreateUDBInstance
Overview
Creating UDB instance (including creating mysql master node, mongodb primary/configsvr node and restoring instance from backup)
đź’ˇ Creating High Availability Across Availability Zones Notes:
1. Parameter BackupZone is required: The value is the ZoneId for disaster recovery of high availability.
2. Parameter ParamGroupId: The value is the configuration file across availability zones, which can be obtained through DescribeUDBParamGroup.
Definition
Public Parameters
Parameter Name | Type | Description Information | Required |
---|---|---|---|
Action | string | Corresponding API command name, the current API is CreateUDBInstance . | Yes |
PublicKey | string | The user’s public key can be obtained from Console | Yes |
Signature | string | User signature generated based on public key and API command, see Signature Algorithm | Yes |
Request Parameters
Parameter Name | Type | Description Information | Required |
---|---|---|---|
Region | string | Region. See List of Regions and Availability Zones | Yes |
Zone | string | Availability Zone. See Availability Zone List | Yes |
ProjectId | string | Project ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the GetProjectList interface. | No |
Name | string | Instance name, at least 6 characters | Yes |
AdminPassword | string | Administrator Password | Yes |
DBTypeId | string | DB type, mysql/mongodb/postgesql/sqlserver subdivided by version mysql-8.0, mysql-5.5, percona-5.5, mysql-5.6, percona-5.6, mysql-5.7, percona-5.7, mariadb-10.0, postgresql-9.6, postgresql-10.4, postgresql-12.8, postgresql-13.4, mongodb-2.6, mongodb-3.0, mongodb-3.6, mongodb-4.0, sqlserver-2017 | Yes |
Port | int | Port number, mysql default 3306, mongodb default 27017, postgresql default 5432 | Yes |
DiskSpace | int | Disk Space (GB), temporarily supports 20G - 32T | Yes |
ParamGroupId | int | Configuration parameter group id used by the DB instance | Yes |
MemoryLimit | int | Memory Limit (MB), currently supports the following levels 2000M/4000M/ 6000M/8000M/12000M/16000M/ 24000M/32000M/48000M/ 64000M/96000M/128000M/192000M/256000M/320000M | No |
ChargeType | string | Yearly, Monthly, Dynamic, Trial, Default: Monthly | No |
Quantity | int | Purchase duration, default value 1 | No |
AdminUser | string | Administrator account name, default is root | No |
BackupCount | int | Backup strategy, number of backups per week, default is 7 times | No |
BackupTime | int | Backup strategy, backup start time, calculated in units of hours, default is 1 o’clock | No |
BackupDuration | int | Backup strategy, backup time interval, calculated in hours, default is 24 hours. | No |
BackupId | int | Backup ID, if specified, it means to restore the instance from the backup. | No |
InstanceType | string | UDB Database Models: “SATA_SSD”: “SSD Model” , “PCIE_SSD”: “High-Performance SSD Model” , “Normal_Volume”: “Standard Large Capacity Model”, “SATA_SSD_Volume”: “Large Capacity SSD Model” , “PCIE_SSD_Volume”: “High-Performance Large Capacity SSD Model”, “NVMe_SSD”: “Fast Model” """. | No |
SSDType | string | SSD type, optional values are “SATA” or “NVMe”, default is “SATA”. | No |
InstanceMode | string | UDB instance mode type, optional values are as follows: “Normal”: Standard version UDB instance “HA”: High availability version UDB instance The default is “Normal”. | No |
CPU | int | Number of CPU cores, a required parameter if the DB type is SQL Server. | No |
BackupZone | string | The availability zone where the cross-availability zone high-availability backup library is located, see Availability Zone List | No |
SubnetId | string | Subnet ID | No |
VPCId | string | ID of VPC | No |
DisableSemisync | boolean | Whether to enable asynchronous high availability, not filled by default, can be set to true | No |
ClusterRole | string | When the DB type (DBTypeId) is mongodb, you need to specify the role of mongo. The optional values are configsrv (configuration node) and shardsrv (data node). | No |
Tag | string | The name of the business group where the instance is located | No |
DBSubVersion | string | MySQL minor version, supports creating with specified minor version | No |
CaseSensitivityParam | int | MySQL case sensitivity parameter, 0 for case sensitive, 1 for case insensitive, currently only effective for MySQL 8.0 | No |
SpecificationType | string | The type of instance computing specification, 0 or no transmission means purchasing by memory method, 1 means purchasing by optional memory-cpu ratio method, need to fill in MachineType. | No |
MachineType | string | Specification Type ID, valid when SpecificationType is 1 | No |
CouponId | string | ID of the voucher used | No |
Response Field
Field Name | Type | Description Information | Required |
---|---|---|---|
RetCode | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. | Yes |
Action | string | Operation command name. | Yes |
Message | string | Returns an error message, providing detailed description when RetCode is non-zero. | No |
DBId | string | BD Instance ID | No |
Example
Request Example
https://api.dezai.com/?Action=CreateUDBInstance
&Region=cn-bj2
&Zone=cn-bj2-04
&DBTypeId=mysql-5.6
&ChargeType=Month
&Name=my_test_udb
&AdminUser=root
&AdminPassword=mysql_12
&Port=3306
&ParamGroupId=10
&MemoryLimit=1500
&DiskSpace=200
&InstanceMode=HA
&ClusterRole=IcPiHioG
&HAArch=haproxy
&Tag=awpGFPaP
&EnableIpV6=true
&BackupUrl=ArIyIIyj
&DBSubVersion=8.0.16
&CaseSensitivityParam=5
&SpecificationType=IWYpQrmi
&MachineType=ZINkjHvV
Response Example
{
"Action": "CreateUDBInstanceResponse",
"DBId": "udbha-xxxxxx",
"RetCode": 0
}