Skip to Content
Cloud Database(UDB) CreateUDBMySQLInstance

create mysql instance - CreateUDBMySQLInstance

Overview

Create UDB instances (including creating MySQL NVMe, shared, and O2 instances as well as restoring instances from backups)

💡 Create a highly available cross-AZ parameter group: 1. The parameter BackupZone is required, with the value being the ZoneId for high availability disaster recovery. 2. The parameter ParamGroupId: the value is the cross-AZ configuration file, which can be obtained via DescribeUDBParamGroup

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is CreateUDBMySQLInstance.Yes
PublicKeystringThe user’s public key can be obtained from ConsoleYes
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.4, mysql-8.0, mysql-5.5, percona-5.5, mysql-5.6, percona-5.6, mysql-5.7, percona-5.7,Yes
PortintPort number, mysql default 3306Yes
DiskSpaceintDisk Space (GB), temporarily supports 20G - 32TYes
ParamGroupIdintConfiguration parameter group id used by the DB instanceYes
MachineTypestringSpecification type ID. This field is valid only when SpecificationType = 1. Please retrieve the value through the ListUDBMachineType API.Yes
StorageClassstringStorage Type CLOUD_SSD: SSD Cloud Disk, CLOUD_RSSD: RSSD Cloud Disk, CLOUD_SSD_ESSENTIAL: SSD Essential Cloud Disk. This field combined with SpecificationClass has a higher priority than the InstanceType field.Yes
SpecificationClassstringSpecification Type O: NVME, OM: Shared Type, N: General TypeYes
ChargeTypestringYearly, Monthly, Dynamic, Trial, Default: MonthlyNo
QuantityintPurchase duration, default value 1No
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
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
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
TagstringThe name of the business group where the instance is locatedNo
DBSubVersionstringMySQL minor version. Specifying a minor version during instance creation is supported. Please use the DescribeUDBType API to obtain the available versions.No
CaseSensitivityParamintMySQL case sensitivity parameter, 0 for case sensitive, 1 for case insensitive, currently only effective for MySQL 8.0No
AlarmTemplateIdstringID of the alarm templateNo
BackupURLstringInternal network address for downloading backup files from US3No
SemisyncFlagintSemi-synchronous toggle switch: 1 indicates enabling semi-synchronous, 2 indicates disabling semi-synchronous, 0 indicates the default value, which is also enabling semi-synchronous by default.No
Labels.N.KeystringKeys of User Resource LabelNo
Labels.N.ValuestringValues of User Resource LabelNo
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=CreateUDBMySQLInstance &Region=DHSQjnMH &Zone=VPbfMFgr &ProjectId=QqMPIElo &Name=VJRdgjLz &AdminPassword=qpuNzHWu &DBTypeId=mysql-5.7 &Port=1 &DiskSpace=2 &ParamGroupId=1 &SpecificationType=BSzvvsmr &MachineType=vVzRuiXW &StorageClass=iFbCPKNS &SpecificationClass=VyvAhzBv &ChargeType=fBuCAPrS &Quantity=7 &AdminUser=BrxrNMhG &BackupCount=8 &BackupTime=6 &BackupDuration=5 &BackupId=8 &InstanceMode=Normal &BackupZone=rFyctFJb &SubnetId=daZLUdLl &VPCId=hHzobfnk &DisableSemisync=true &Tag=fEWwwrJs &DBSubVersion=8.0.16 &CaseSensitivityParam=6 &AlarmTemplateId=msYGzxTY &BackupURL=jbeGhHuy &SemisyncFlag=3 &Labels.N.Key=ZSDypLJv &Labels.N.Value=VZexUEuN &CouponId=XasoJFsT

Response Example

{ "Action": "CreateUDBMySQLInstanceResponse", "DBId": "JhdlRKKq", "RetCode": 0 }