# Create an SQL Server database - CreateUDBSQLServerInstance

## Overview

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






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `CreateUDBSQLServerInstance`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.sigcalcloud.com/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Region** | string | Region. See [List of Regions and Availability Zones](/docs/api/summary/regionlist) |**Yes**|
| **Zone** | string | Availability Zone. See [Availability Zone List](/docs/api/summary/regionlist) |**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](/docs/api/summary/get_project_list). |No|
| **Name** | string | Instance name, at least 6 characters |**Yes**|
| **AdminPassword** | string | Administrator Password |**Yes**|
| **DBTypeId** | string | DB type, sqlserver subdivided by version sqlserver-2017、sqlserver-2019 |**Yes**|
| **Port** | int | Port number, sqlserver default 1433 |**Yes**|
| **DiskSpace** | int | Disk Space (GB), temporarily supports 20G - 32T |**Yes**|
| **StorageClass** | string | Storage 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**|
| **SpecificationClass** | string | Specification Type O: NVME |**Yes**|
| **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|
| **MachineType** | string | Specification type ID. This field is valid only when SpecificationType = 1. Please retrieve the value through the ListUDBMachineType API. |No|
| **CPU** | int | cpu cores |No|
| **MemoryLimit** | int | memory limit |No|
| **ChargeType** | string | Yearly, Monthly, Dynamic, Trial, Default: Monthly |No|
| **Quantity** | int | Purchase duration, default value 1 |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|
| **SubnetId** | string | Subnet ID |No|
| **VPCId** | string | ID of VPC |No|
| **Tag** | string | The name of the business group where the instance is located |No|
| **AlarmTemplateId** | string | ID of the alarm template |No|
| **BackupURL** | string | Internal network address for downloading backup files from US3 |No|
| **Labels.N.Key** | string | Keys of User Resource Label |No|
| **Labels.N.Value** | string | Values of User Resource Label |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.sigcalcloud.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
    
```json
{
  "Action": "CreateUDBSQLServerInstanceResponse",
  "DBId": "RLaoBEzT",
  "RetCode": 0
}
```





