Skip to Content
Cloud Database(UDB) CreateUDBSQLServerInstance

Create an SQL Server database - CreateUDBSQLServerInstance

Overview

Create UDB instances (including creating SQL Server instances and restoring instances from backups)

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is CreateUDBSQLServerInstance.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, sqlserver subdivided by version sqlserver-2017、sqlserver-2019Yes
PortintPort number, sqlserver default 1433Yes
DiskSpaceintDisk Space (GB), temporarily supports 20G - 32TYes
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: NVMEYes
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
MachineTypestringSpecification type ID. This field is valid only when SpecificationType = 1. Please retrieve the value through the ListUDBMachineType API.No
CPUintcpu coresNo
MemoryLimitintmemory limitNo
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
SubnetIdstringSubnet IDNo
VPCIdstringID of VPCNo
TagstringThe name of the business group where the instance is locatedNo
AlarmTemplateIdstringID of the alarm templateNo
BackupURLstringInternal network address for downloading backup files from US3No
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=CreateUDBSQLServerInstance &Region=THJIyXyN &Zone=HpQHnozE &ProjectId=JwqIWIjj &Name=rNOYPBTC &AdminPassword=acSNMykE &DBTypeId=mysql-5.7 &Port=3 &DiskSpace=4 &ParamGroupId=8 &MachineType=gdpKaOtO &StorageClass=Tkhljajo &SpecificationClass=iNOoQCIy &ChargeType=DJqyTZGn &Quantity=1 &AdminUser=iubRWVqD &BackupCount=5 &BackupTime=9 &BackupDuration=2 &BackupId=6 &InstanceMode=Normal &BackupZone=dmAAHDqi &SubnetId=cZaRQtYC &VPCId=bQvoecEs &DisableSemisync=true &Tag=KfBCfAdq &DBSubVersion=8.0.16 &CaseSensitivityParam=6 &AlarmTemplateId=QxdZCPNH &BackupURL=YcGkCMuV &SemisyncFlag=6 &Labels.N.Key=xJDsbtDA &Labels.N.Value=yJvmSRtF &CouponId=HrvDLXeG &CPU=2 &MemoryLimit=4 &CPU=1 &MemoryLimit=6 &CPU=4 &MemoryLimit=2 &CPU=4 &MemoryLimit=4 &CPU=9 &MemoryLimit=6 &CPU=2 &MemoryLimit=3

Response Example

{ "Action": "CreateUDBSQLServerInstanceResponse", "DBId": "RLaoBEzT", "RetCode": 0 }