createCloudDBInstance
- Print
- PDF
createCloudDBInstance
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Overview
Creates a Cloud DB instance.
Request
Request header
Header | Description |
---|---|
x-ncp-apigw-timestamp | It is the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC. If the time difference with the API Gateway server is more than 5 minutes, the request is considered invalid. x-ncp-apigw-timestamp:{Timestamp} |
x-ncp-apigw-api-key | API key issued by API Gateway (not used in the API v2)x-ncp-apigw-api-key:{API Gateway API Key} |
x-ncp-iam-access-key | Access Key ID issued from the NAVER CLOUD PLATFORM portal. x-ncp-iam-access-key:{Sub Account Access Key} |
x-ncp-apigw-signature-v2 | Signature encrypted with your Access Key ID and Secret Key. x-ncp-apigw-signature-v2:{API Gateway Signature} |
Content-Type | Set the request body content type to application/json.Content-Type: application/json |
Request body
Field names in the request body are case sensitive.
Field | Required | Type | Limitations | Description |
---|---|---|---|---|
cloudDBImageProductCode | No | String | Cloud DB image product code Get available values by using getCloudDBImageProductList. | |
cloudDBProductCode | No | String | default: Minimum specifications | Cloud DB product spec code Get available values by using getCloudDBProductList. |
dbKindCode | Yes | String | MYSQL | MSSQL | REDIS | DB type code Choose the type of Cloud DB to create. |
collation | No | String | Korean_Wansung_CI_AS | SQL_Latin1_General_CP1_CI_AS | Character set Selection of character collation and comparison method. Can be set when dbKindCode is MSSQL. |
dataStorageTypeCode | No | String | HDD | SSD default: SSD | Data storage type |
isHa | No | boolean | default: true | Indicates whether to enable high availability (HA). Two servers are created when high availability is selected, and automatic failover is supported. |
hostIp | Conditional | String | Host IP Enter the client IP you want to connect. Must be entered when dbKindCode is MYSQL. | |
cloudDBServerName | Conditional | String | MYSQL Min length: 3, Max length: 25 REDIS Min length: 3, Max length: 15 | Cloud DB server name Enter the name of the Cloud DB server. Duplicate use is not allowed, and a 3-digit number is automatically assigned to the server name. Cannot be entered when dbKindCode is MSSQL. |
cloudDBServiceName | Yes | String | MYSQL Min length: 3, Max length: 30 MSSQL, REDIS Min length: 3, Max length: 15 | Cloud DB service name Service name to use in Cloud DB. |
cloudDBBasicName | Conditional | String | Min length: 1, Max length: 30 | Cloud DB basic name Enter the name of the DB to be created by default. Must be entered when dbKindCode is MYSQL. |
cloudDBUserName | Conditional | String | Only English letters, numbers, and '_' characters are allowed. Must start with English. Min length: 4, Max length: 16 | Uses name Must be entered when dbKindCode is MYSQL or MSSQL. |
cloudDBUserPassword | Conditional | String | Min length: 8, Max length: 20 | Password Must be entered when dbKindCode is MYSQL or MSSQL. |
cloudDBPort | No | integer | MYSQL default: 3306, MSSQL default: 1433, REDIS default: 6379 Default value or 10000~20000 | Cloud DB port Enter TCP port number for access. |
cloudDBConfigGroupoNo | No | String | default: 0 (mssql_2016_default) | Config Group number Get available values by using getCloudDBConfigGroupList. Can be set when dbKindCode is MSSQL. |
isBackup | No | bool | default: true | Indicates whether to perform backups. Can be set when dbKindCode is MYSQL or REDIS. Fixed to true when high availability (isHa) is true. |
backupFileRetentionPeriod | No | integer | default: 1 day (1-30) | Backup retention period Specify the backup retention period. |
isAutomaticBackup | No | bool | default: true | Indicates whether to enable automatic backup. Choose whether to enable automatic backup. |
backupTime | Conditional | String | HHMM format. Only 15-minute increments can be entered. | Backup time Enter backup start time. Must be input when isAutomaticBackup is false. |
regionNo | No | String | Region number Get available values by using getRegionList. | |
zoneNo | Yes | String | Zone number Get available values by getZoneList. | |
responseFormatType | No | String | XML | JSON default: XML | Format type of response result |
Response
Field | Type | Description | Note |
---|---|---|---|
returnCode | Integer | Response code | |
returnMessage | String | Response message | |
totalRows | Integer | Number of response result rows | |
cloudDBInstanceList[] | String | Created Cloud DB instance information |
Examples
Request example
curl
-X GET "https://ncloud.apigw.ntruss.com/clouddb/v2/createCloudDBInstance?dbKindCode=MYSQL&dataStorageTypeCode=SSD&isHa=true&hostIp=%25&cloudDBServerName=test&cloudDBServiceName=test&cloudDBUserName=test&cloudDBUserPassword=test123&cloudDBBasicName=test&cloudDBPort=3306&isBackup=true&backupFileRetentionPeriod=1&isAutomaticBackup=true®ionNo=9&zoneNo=90&responseFormatType=json"
-H "accept: application/json"
-H "Content-Type: application/x-www-form-urlencoded"
-H "x-ncp-iam-access-key: Y0Z9EG0lKoeWAQCSHRtM"
-H "x-ncp-apigw-timestamp: 1545634234391"
-H "x-ncp-apigw-signature-v2: B7hM8hQ9DtitHxPFwimCG2Dir7MPLjRRVOkRRaxhYaE="
https://ncloud.apigw.ntruss.com/clouddb/v2/createCloudDBInstance?dbKindCode=MYSQL&dataStorageTypeCode=SSD&isHa=true&hostIp=%25&cloudDBServerName=test&cloudDBServiceName=test&cloudDBUserName=test&cloudDBUserPassword=test123&cloudDBBasicName=test&cloudDBPort=3306&isBackup=true&backupFileRetentionPeriod=1&isAutomaticBackup=true®ionNo=9&zoneNo=90&responseFormatType=json
Request sample
- Create a MySQL server
- Server specifications: Default minimum specifications (2 vCPUs, 4 G mem)
- Data storage: SSD
- HA: true
- DB name: testdb
- User name: testuser
- Web server IP: 1.1.1.1
- Region: KR-1
{
"dbKindCode": "MYSQL",
"dataStorageTypeCode": "SSD",
"isHa": true,
"hostIp": "1.1.1.1",
"cloudDBServerName": "test",
"cloudDBServiceName": "test",
"cloudDBUserName": "testuser",
"cloudDBUserPassword": "test123",
"cloudDBBasicName": "testdb",
"cloudDBPort": 3306,
"isBackup": true,
"backupFileRetentionPeriod": 1,
"isAutomaticBackup": true,
"regionNo": "1",
"zoneNo": "2",
"responseFormatType": "json"
}
Response example
connection: keep-alive
content-type: application/json;charset=UTF-8
date: Mon, 24 Dec 2018 08:59:40 GMT
server: nginx
transfer-encoding: chunked
x-ncp-trace-id: 6acpi6di6apj536ob5cksjcor2
{
"createCloudDBInstanceResponse": {
"returnCode": "0",
"returnMessage": "success",
"totalRows": 1,
"cloudDBInstanceList": [
{
"cloudDBInstanceNo": "881713",
"cloudDBServiceName": "test",
"dbKindCode": "MYSQL",
"engineVersion": "MYSQL5.7.19",
"cpuCount": 2,
"dataStorageType": {
"code": "SSD",
"codeName": "SSD"
},
"licenseCode": "GPL",
"cloudDBPort": 3306,
"isHa": true,
"cloudDBInstanceStatusName": "creating",
"collation": "",
"createDate": "2018-12-24T17:59:00+0900",
"cloudDBImageProductCode": "SPSWMYSQLLINUX01",
"cloudDBProductCode": "SPSVRDBAAS000001",
"isCloudDBConfigNeedReboot": false,
"isCloudDBNeedReboot": false,
"cloudDBConfigList": [],
"cloudDBConfigGroupList": [],
"accessControlGroupList": [],
"cloudDBServerInstanceList": [
{
"cloudDBServerInstanceNo": "",
"cloudDBServerInstanceStatusName": "pending",
"cloudDBServerName": "test-001",
"cloudDBServerRole": {
"code": "M",
"codeName": "Master"
},
"privateDnsName": "",
"publicDnsName": "",
"dataStorageSize": 10737418240,
"usedDataStorageSize": 0,
"createDate": "2018-12-24T17:59:00+0900"
},
{
"cloudDBServerName": "test-002",
"cloudDBServerRole": {
"code": "H",
"codeName": "Hidden Master"
}
}
]
}
]
}
}
Error codes
If a Cloud DB API request is invalid or an error occurs while processing the request, the API returns an HTTP status code representing success or failure with a detailed message in JSON.
There are two types of error codes: “common error code” of the Cloud DB API and “API Gateway error code.”
Error code | Response message | Description |
---|---|---|
200 | Ok | |
500 | Server Error |
Was this article helpful?