createCloudDBInstance
    • PDF

    createCloudDBInstance

    • PDF

    Article summary

    Overview

    Creates a Cloud DB instance.

    Request

    Request header

    HeaderDescription
    x-ncp-apigw-timestampIt 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-keyAPI key issued by API Gateway (not used in the API v2)
    x-ncp-apigw-api-key:{API Gateway API Key}
    x-ncp-iam-access-keyAccess Key ID issued from the NAVER CLOUD PLATFORM portal.
    x-ncp-iam-access-key:{Sub Account Access Key}
    x-ncp-apigw-signature-v2Signature encrypted with your Access Key ID and Secret Key.
    x-ncp-apigw-signature-v2:{API Gateway Signature}
    Content-TypeSet the request body content type to application/json.
    Content-Type: application/json

    Request body

    Field names in the request body are case sensitive.

    FieldRequiredTypeLimitationsDescription
    cloudDBImageProductCodeNoStringCloud DB image product code
    Get available values by using getCloudDBImageProductList.
    cloudDBProductCodeNoStringdefault: Minimum specificationsCloud DB product spec code
    Get available values by using getCloudDBProductList.
    dbKindCodeYesStringMYSQL | MSSQL | REDISDB type code
    Choose the type of Cloud DB to create.
    collationNoStringKorean_Wansung_CI_AS | SQL_Latin1_General_CP1_CI_ASCharacter set
    Selection of character collation and comparison method.
    Can be set when dbKindCode is MSSQL.
    dataStorageTypeCodeNoStringHDD | SSD
    default: SSD
    Data storage type
    isHaNobooleandefault: trueIndicates whether to enable high availability (HA).
    Two servers are created when high availability is selected, and automatic failover is supported.
    hostIpConditionalStringHost IP
    Enter the client IP you want to connect.
    Must be entered when dbKindCode is MYSQL.
    cloudDBServerNameConditionalStringMYSQL 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.
    cloudDBServiceNameYesStringMYSQL 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.
    cloudDBBasicNameConditionalStringMin length: 1, Max length: 30Cloud DB basic name
    Enter the name of the DB to be created by default.
    Must be entered when dbKindCode is MYSQL.
    cloudDBUserNameConditionalStringOnly 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.
    cloudDBUserPasswordConditionalStringMin length: 8, Max length: 20Password
    Must be entered when dbKindCode is MYSQL or MSSQL.
    cloudDBPortNointegerMYSQL default: 3306,
    MSSQL default: 1433,
    REDIS default: 6379
    Default value or 10000~20000
    Cloud DB port
    Enter TCP port number for access.
    cloudDBConfigGroupoNoNoStringdefault: 0 (mssql_2016_default)Config Group number
    Get available values by using getCloudDBConfigGroupList. Can be set when dbKindCode is MSSQL.
    isBackupNobooldefault: trueIndicates whether to perform backups.
    Can be set when dbKindCode is MYSQL or REDIS.
    Fixed to true when high availability (isHa) is true.
    backupFileRetentionPeriodNointegerdefault: 1 day (1-30)Backup retention period
    Specify the backup retention period.
    isAutomaticBackupNobooldefault: trueIndicates whether to enable automatic backup.
    Choose whether to enable automatic backup.
    backupTimeConditionalStringHHMM format. Only 15-minute increments can be entered.Backup time
    Enter backup start time.
    Must be input when isAutomaticBackup is false.
    regionNoNoStringRegion number
    Get available values by using getRegionList.
    zoneNoYesStringZone number
    Get available values by getZoneList.
    responseFormatTypeNoStringXML | JSON
    default: XML
    Format type of response result

    Response

    FieldTypeDescriptionNote
    returnCodeIntegerResponse code
    returnMessageStringResponse message
    totalRowsIntegerNumber of response result rows
    cloudDBInstanceList[]StringCreated 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&regionNo=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&regionNo=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 codeResponse messageDescription
    200Ok
    500Server Error

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.