docs
api
Cloud Database(UDB)
CreateUDBInstance

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 NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is CreateUDBInstance.Yes
PublicKeystringThe user's public key can be obtained from Console (opens in a new tab)Yes
SignaturestringUser signature generated based on public key and API command, see Signature AlgorithmYes

Request Parameters

Parameter NameTypeDescription InformationRequired
RegionstringRegion. See List of Regions and Availability ZonesYes
ZonestringAvailability Zone. See Availability Zone ListYes
ProjectIdstringProject ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the GetProjectList interface.No
NamestringInstance name, at least 6 charactersYes
AdminPasswordstringAdministrator PasswordYes
DBTypeIdstringDB 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-2017Yes
PortintPort number, mysql default 3306, mongodb default 27017, postgresql default 5432Yes
DiskSpaceintDisk Space (GB), temporarily supports 20G - 32TYes
ParamGroupIdintConfiguration parameter group id used by the DB instanceYes
MemoryLimitintMemory Limit (MB), currently supports the following levels 2000M/4000M/ 6000M/8000M/12000M/16000M/ 24000M/32000M/48000M/ 64000M/96000M/128000M/192000M/256000M/320000MNo
ChargeTypestringYearly, Monthly, Dynamic, Trial, Default: MonthlyNo
QuantityintPurchase duration, default value 1No
AdminUserstringAdministrator account name, default is rootNo
BackupCountintBackup strategy, number of backups per week, default is 7 timesNo
BackupTimeintBackup strategy, backup start time, calculated in units of hours, default is 1 o'clockNo
BackupDurationintBackup strategy, backup time interval, calculated in hours, default is 24 hours.No
BackupIdintBackup ID, if specified, it means to restore the instance from the backup.No
InstanceTypestringUDB 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
SSDTypestringSSD type, optional values are "SATA" or "NVMe", default is "SATA".No
InstanceModestringUDB instance mode type, optional values are as follows: "Normal": Standard version UDB instance "HA": High availability version UDB instance The default is "Normal".No
CPUintNumber of CPU cores, a required parameter if the DB type is SQL Server.No
BackupZonestringThe availability zone where the cross-availability zone high-availability backup library is located, see Availability Zone ListNo
SubnetIdstringSubnet IDNo
VPCIdstringID of VPCNo
DisableSemisyncbooleanWhether to enable asynchronous high availability, not filled by default, can be set to trueNo
ClusterRolestringWhen 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
TagstringThe name of the business group where the instance is locatedNo
DBSubVersionstringMySQL minor version, supports creating with specified minor versionNo
CaseSensitivityParamintMySQL case sensitivity parameter, 0 for case sensitive, 1 for case insensitive, currently only effective for MySQL 8.0No
SpecificationTypestringThe 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
MachineTypestringSpecification Type ID, valid when SpecificationType is 1No
CouponIdstringID of the voucher usedNo

Response Field

Field NameTypeDescription InformationRequired
RetCodeintReturn status code. If it is 0, it means successful return. If it is not 0, it means failure.Yes
ActionstringOperation command name.Yes
MessagestringReturns an error message, providing detailed description when RetCode is non-zero.No
DBIdstringBD Instance IDNo

Example

Request Example

https://api.surfercloud.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
}
  • Company
  • ContactUs
  • Blog
Copyright © 2024 SurferCloud All Rights Reserved