createCloudMysqlInstance

Prev Next

Available in VPC

Create a Cloud DB for MySQL instance.

Request

This section describes the request format. The method and URI are as follows:

Method URI
GET, POST /createCloudMysqlInstance

Request headers

For information about the headers common to all Cloud DB for MySQL (VPC) APIs, see Cloud DB for MySQL (VPC) request headers.

Request parameters

The following describes the parameters.

Field Type Required Description
regionCode String Optional Region code
  • Region code of the Cloud DB for MySQL instance to create
  • Check through getRegionList.
  • First Region of the getRegionList query result (default)
vpcNo String Required Number of VPC to create the Cloud DB for MySQL instance in
cloudMysqlImageProductCode String Optional Cloud DB for MySQL image product code
cloudMysqlProductCode String Optional Cloud DB for MySQL product code
  • Determine the server specification for the Cloud DB for MySQL instance to create.
  • Check through getCloudMysqlProductList.
  • Minimum specification (default)
  • Minimum specification is based on 1. memory and 2. CPU.
dataStorageTypeCode String Optional Data storage type code
  • Unable to change data storage type after installation
  • SSD | HDD | CB2
  • Default value changes depending on generationCode of cloudMysqlImageProductCode.
    • For G2: SSD
    • For G3: CB2
isHa Boolean Optional High availability status
  • true (default) | false
  • Selecting true (high availability) creates two servers, including a standby master server, and incurs additional fees.
  • If false, isMultiZone and standbyMasterSubnetNo parameters are not used.
isMultiZone Boolean Conditional Multi-zone status
  • true | false (default)
  • Required if the high availability status (isHa) is true
  • If true, provide the master and standby master servers in separate zones to provide higher availability.
isStorageEncryption Boolean Optional Data storage encryption application status (to be applied later)
  • true | false (default)
  • Encryption can be applied only if the high availability status (isHa) is true.
  • When encryption is applied, the DB data is encrypted and saved in the storage.
  • You can't change the storage encryption settings after creating a Cloud DB for MySQL instance.
isBackup Boolean Optional Whether MySQL backup is enabled
  • true (default) | false
  • If the high availability status (isHa) is true, the backup status (isBackup) is fixed to true.
backupFileRetentionPeriod Integer Optional Backup file retention period (days)
  • 1 (default)
  • Only backup for tables created with the InnoDB engine is supported.
  • Backup is performed every day, and the backup file is stored in a separate backup storage.
backupTime String Conditional Set backup time.
  • true (default) | false
  • Required if the backup status (isBackup) is true and automatic backup status (isAutomaticBackup) is false
  • e.g., 01:15 (Backup starts between the selected time + 15 minutes.)
isAutomaticBackup Boolean Optional Whether to set the backup time automatically
  • true (default) | false
  • If set to true, backupTime can't be entered.
cloudMysqlServiceName String Required Name of the Cloud DB for MySQL service to create
  • 3 to 30 characters, including English letters, Korean letters, numbers, and special character "-"
cloudMysqlServerNamePrefix String Required Prefix for the Cloud DB for MySQL server name to create
  • 3 to 20 characters, including English letters, numbers, and the special character "-", and must begin with an English letter and end with an English letter or number.
  • A 3-digit number is automatically generated after the prefix, with additional random text to prevent hostname duplication.
  • e.g., if the prefix is test-123: test-123-001-4y1v
cloudMysqlUserName String Required DB user account ID
  • 4 to 16 characters, including English letters, numbers, and special characters "-" and "_", and must begin with an English letter.
  • Predefined reserved words can't be used.
cloudMysqlUserPassword String Required DB user account password
  • Enter between 8 and 20 characters containing at least one English letter, number, and special character.
  • Special characters ` & + \ " ' / and spaces can't be used.
  • If the password plugin is activated, the policy set by the plugin must also be satisfied.
hostIp String Required IP address to access MySQL Server
  • Allow access to all: %
  • Allow access to specific IPs (e.g., 1.1.1.1)
  • Allow access to an IP range (e.g., 1.1.1.%)
  • Allow CIDR (e.g., 1.1.1.0/24)
  • When using the GET method, % must be URL-encoded as %25.
cloudMysqlPort Integer Optional TCP port number to access the Cloud DB for MySQL instance
  • 3306 (default)
  • Specified range: 10000-20000
  • The port number can't be changed after it is specified.
cloudMysqlDatabaseName String Required DB name to be created by default in the Cloud DB for MySQL instance
  • 1 to 30 characters, including English letters, numbers, and special characters "\ _ , -", and must begin with an English letter.
subnetNo String Required Subnet number of the default network interface to be used in the Cloud DB for MySQL instance
  • Check through getCloudMysqlTargetSubnetList.
  • Subscription to public domains can only be done in a DB server created in public subnet.
  • Subnet migrations are not available after creating the Cloud DB for MySQL instance.
standbyMasterSubnetNo String Conditional Subnet number of the standby master server
  • Must be entered for multi-zone Cloud DB for MySQL.
  • It must be in a different zone from the master server's subnet, but the public or private status must match.
  • Check through getCloudMysqlTargetSubnetList.
isPrivateSubDomain Boolean Optional Whether to use private sub domains
  • true | false
  • If set to true, privateSubDomainPrefix can be specified.
privateSubDomainPrefix String Conditional Enter the sub domain to be added to the private domain.
  • 3 to 15 characters, including letters, numbers, and the special character "-", and must begin with an English letter and end with an English letter or number.
  • Required if the private sub domain usage status (isPrivateSubDomain) is true
  • The same sub domain policy will be added when adding a slave or recovery.
engineVersionCode String Conditional DB engine version
isDeleteProtection Boolean Optional Cluster termination protection status
  • true | false (default)
    • true: cluster termination unavailable
    • false: cluster termination available
responseFormatType String Optional Format of the response result
  • xml (default) | json

Request example

The request example is as follows:

curl --location --request GET 'https://ncloud.apigw.ntruss.com/vmysql/v2/createCloudMysqlInstance
?regionCode=KR
&vpcNo=****83
&cloudMysqlImageProductCode=SW.VDBAS.DBAAS.LNX64.CNTOS.0708.MYSQL.8025.B050
&cloudMysqlProductCode=SVR.VDBAS.STAND.C002.M008.NET.HDD.B050.G002
&dataStorageTypeCode=SSD
&isHa=true
&isMultiZone=true
&isStorageEncryption=true
&isBackup=true
&backupFileRetentionPeriod=10
&backupTime=02:00
&isAutomaticBackup=false
&cloudMysqlServiceName=test-****
&cloudMysqlServerNamePrefix=test-****
&cloudMysqlUserName=test-****
&cloudMysqlUserPassword=********
&hostIp=192.168.0.%
&cloudMysqlPort=13306
&cloudMysqlDatabaseName=test-****
&subnetNo=****91
&standbyMasterSubnetNo=****93'
--header 'x-ncp-apigw-timestamp: {Timestamp}' 
--header 'x-ncp-iam-access-key: {Access Key}' 
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'

Response

This section describes the response format.

Response body

See CloudMysqlInstanceList for the response body.

Response status codes

For response status codes common to NAVER Cloud Platform, see Ncloud API response status codes.

Response example

The response example is as follows:

  • If responseFormatType=json
{
    "createCloudMysqlInstanceResponse": {
        "totalRows": 1,
        "cloudMysqlInstanceList": [
            {
                "cloudMysqlInstanceNo": "****890",
                "cloudMysqlServiceName": "test-****",
                "cloudMysqlInstanceStatusName": "creating",
                "cloudMysqlInstanceStatus": {
                    "code": "INIT",
                    "codeName": "CLOUD DATABASE(VPC) Init State"
                },
                "cloudMysqlInstanceOperation": {
                    "code": "CREAT",
                    "codeName": "CLOUD DATABASE(VPC) Creat OP"
                },
                "cloudMysqlImageProductCode": "SW.VDBAS.DBAAS.LNX64.CNTOS.0708.MYSQL.8025.B050",
                "engineVersion": "MYSQL8.0.25",
                "license": {
                    "code": "GPL",
                    "codeName": "General Public License"
                },
                "cloudMysqlPort": 13306,
                "isHa": true,
                "isMultiZone": true,
                "isBackup": true,
                "backupFileRetentionPeriod": 10,
                "backupTime": "02:00",
                "generationCode": "G2",
                "createDate": "2024-05-23T11:25:09+0900",
                "accessControlGroupNoList": [],
                "cloudMysqlConfigList": [],
                "cloudMysqlServerInstanceList": [
                    {
                        "cloudMysqlServerName": "test-****-001-e04",
                        "cloudMysqlServerRole": {
                            "code": "M",
                            "codeName": "Master"
                        },
                        "cloudMysqlServerInstanceStatusName": "creating",
                        "cloudMysqlServerInstanceStatus": {
                            "code": "PEND",
                            "codeName": "CLOUD DATABASE(VPC) Server Pending State"
                        },
                        "cloudMysqlServerInstanceOperation": {
                            "code": "CREAT",
                            "codeName": "CLOUD DATABASE(VPC) Server Create OP"
                        },
                        "cloudMysqlProductCode": "SVR.VDBAS.STAND.C002.M008.NET.HDD.B050.G002",
                        "regionCode": "KR",
                        "zoneCode": "KR-1",
                        "vpcNo": "****83",
                        "subnetNo": "****91",
                        "isPublicSubnet": true,
                        "dataStorageType": {
                            "code": "SSD",
                            "codeName": "SSD"
                        },
                        "isStorageEncryption": true,
                        "dataStorageSize": 10737418240,
                        "cpuCount": 2,
                        "memorySize": 8589934592,
                        "createDate": "2024-05-23T11:25:09+0900"
                    },
                    {
                        "cloudMysqlServerName": "test-****-002-e05",
                        "cloudMysqlServerRole": {
                            "code": "H",
                            "codeName": "Standby Master"
                        },
                        "cloudMysqlServerInstanceStatusName": "creating",
                        "cloudMysqlServerInstanceStatus": {
                            "code": "PEND",
                            "codeName": "CLOUD DATABASE(VPC) Server Pending State"
                        },
                        "cloudMysqlServerInstanceOperation": {
                            "code": "CREAT",
                            "codeName": "CLOUD DATABASE(VPC) Server Create OP"
                        },
                        "cloudMysqlProductCode": "SVR.VDBAS.STAND.C002.M008.NET.HDD.B050.G002",
                        "regionCode": "KR",
                        "zoneCode": "KR-2",
                        "vpcNo": "****83",
                        "subnetNo": "****93",
                        "isPublicSubnet": true,
                        "dataStorageType": {
                            "code": "SSD",
                            "codeName": "SSD"
                        },
                        "isStorageEncryption": true,
                        "dataStorageSize": 10737418240,
                        "cpuCount": 2,
                        "memorySize": 8589934592,
                        "createDate": "2024-05-23T11:25:09+0900"
                    }
                ]
            }
        ],
        "requestId": "a3d093cf-****-****-****-394da22ea7f8",
        "returnCode": "0",
        "returnMessage": "success"
    }
}
  • If responseFormatType=xml (default)
<?xml version="1.0" encoding="UTF-8"?>
<createCloudMysqlInstanceResponse>
  <requestId>a3d093cf-****-****-****-394da22ea7f8</requestId>
  <returnCode>0</returnCode>
  <returnMessage>success</returnMessage>
  <totalRows>1</totalRows>
  <cloudMysqlInstanceList>
    <cloudMysqlInstance>
      <cloudMysqlInstanceNo>****890</cloudMysqlInstanceNo>
      <cloudMysqlServiceName>test-****</cloudMysqlServiceName>
      <cloudMysqlInstanceStatusName>creating</cloudMysqlInstanceStatusName>
      <cloudMysqlInstanceStatus>
        <code>INIT</code>
        <codeName>CLOUD DATABASE(VPC) Init State</codeName>
      </cloudMysqlInstanceStatus>
      <cloudMysqlInstanceOperation>
        <code>CREAT</code>
        <codeName>CLOUD DATABASE(VPC) Creat OP</codeName>
      </cloudMysqlInstanceOperation>
      <cloudMysqlImageProductCode>SW.VDBAS.DBAAS.LNX64.CNTOS.0708.MYSQL.8025.B050</cloudMysqlImageProductCode>
      <engineVersion>MYSQL8.0.25</engineVersion>
      <license>
        <code>GPL</code>
        <codeName>General Public License</codeName>
      </license>
      <cloudMysqlPort>13306</cloudMysqlPort>
      <isHa>true</isHa>
      <isMultiZone>true</isMultiZone>
      <isBackup>true</isBackup>
      <backupFileRetentionPeriod>10</backupFileRetentionPeriod>
      <backupTime>02:00</backupTime>
      <generationCode>G2</generationCode>
      <createDate>2024-05-23T11:25:09+0900</createDate>
      <accessControlGroupNoList />
      <cloudMysqlConfigList />
      <cloudMysqlServerInstanceList>
        <cloudMysqlServerInstance>
          <cloudMysqlServerName>test-****-001-4y1v</cloudMysqlServerName>
          <cloudMysqlServerRole>
            <code>M</code>
            <codeName>Master</codeName>
          </cloudMysqlServerRole>
          <cloudMysqlServerInstanceStatusName>creating</cloudMysqlServerInstanceStatusName>
          <cloudMysqlServerInstanceStatus>
            <code>PEND</code>
            <codeName>CLOUD DATABASE(VPC) Server Pending State</codeName>
          </cloudMysqlServerInstanceStatus>
          <cloudMysqlServerInstanceOperation>
            <code>CREAT</code>
            <codeName>CLOUD DATABASE(VPC) Server Create OP</codeName>
          </cloudMysqlServerInstanceOperation>
          <cloudMysqlProductCode>SVR.VDBAS.STAND.C002.M008.NET.HDD.B050.G002</cloudMysqlProductCode>
          <regionCode>KR</regionCode>
          <zoneCode>KR-1</zoneCode>
          <vpcNo>****83</vpcNo>
          <subnetNo>****91</subnetNo>
          <isPublicSubnet>true</isPublicSubnet>
          <dataStorageType>
            <code>SSD</code>
            <codeName>SSD</codeName>
          </dataStorageType>
          <isStorageEncryption>true</isStorageEncryption>
          <dataStorageSize>10737418240</dataStorageSize>
          <cpuCount>2</cpuCount>
          <memorySize>8589934592</memorySize>
          <createDate>2024-05-23T11:25:09+0900</createDate>
        </cloudMysqlServerInstance>
        <cloudMysqlServerInstance>
          <cloudMysqlServerName>test-****-002-e05</cloudMysqlServerName>
          <cloudMysqlServerRole>
            <code>H</code>
            <codeName>Standby Master</codeName>
          </cloudMysqlServerRole>
          <cloudMysqlServerInstanceStatusName>creating</cloudMysqlServerInstanceStatusName>
          <cloudMysqlServerInstanceStatus>
            <code>PEND</code>
            <codeName>CLOUD DATABASE(VPC) Server Pending State</codeName>
          </cloudMysqlServerInstanceStatus>
          <cloudMysqlServerInstanceOperation>
            <code>CREAT</code>
            <codeName>CLOUD DATABASE(VPC) Server Create OP</codeName>
          </cloudMysqlServerInstanceOperation>
          <cloudMysqlProductCode>SVR.VDBAS.STAND.C002.M008.NET.HDD.B050.G002</cloudMysqlProductCode>
          <regionCode>KR</regionCode>
          <zoneCode>KR-2</zoneCode>
          <vpcNo>****83</vpcNo>
          <subnetNo>****93</subnetNo>
          <isPublicSubnet>true</isPublicSubnet>
          <dataStorageType>
            <code>SSD</code>
            <codeName>SSD</codeName>
          </dataStorageType>
          <isStorageEncryption>true</isStorageEncryption>
          <dataStorageSize>10737418240</dataStorageSize>
          <cpuCount>2</cpuCount>
          <memorySize>8589934592</memorySize>
          <createDate>2024-05-23T11:25:09+0900</createDate>
        </cloudMysqlServerInstance>
      </cloudMysqlServerInstanceList>
    </cloudMysqlInstance>
  </cloudMysqlInstanceList>
</createCloudMysqlInstanceResponse>