createCloudMysqlInstance
    • PDF

    createCloudMysqlInstance

    • PDF

    Article summary

    Available in VPC

    Creates a Cloud DB for MySQL instance.

    Request

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

    MethodURI
    GET, POST/createCloudMysqlInstance

    Request headers

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

    Request parameter

    The following describes the parameters.

    FieldTypeRequiredDescription
    regionCodeStringOptionalRegion code
    • Region code of the Cloud DB for MySQL instance to create
    • Check through getRegionList
    • First Region of the getRegionList query result (default)
    vpcNoStringRequiredNumber of VPC to create the Cloud DB for MySQL instance in
    cloudMysqlImageProductCodeStringOptionalCloud DB for MySQL image product code
    cloudMysqlProductCodeStringOptionalCloud 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
    dataStorageTypeCodeStringOptionalData storage type code
    • Unable to change data storage type after installation
    • SSD | HDD | CB1
    • Default value changes depending on generationCode of cloudMysqlImageProductCode
      • For G2: SSD
      • For G3: CB1
    isHaBooleanOptionalHigh 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
    isMultiZoneBooleanConditionalMulti-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
    isStorageEncryptionBooleanOptionalData 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
    isBackupBooleanOptionalWhether MySQL backup is enabled
    • true (default) | false
    • If the high availability status (isHa) is true, the backup status (isBackup) is fixed to true
    backupFileRetentionPeriodIntegerOptionalBackup file retention period (days)
    • 1 (default)
    • Only back up 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
    backupTimeStringConditionalSet 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)
    isAutomaticBackupBooleanOptionalWhether to set the backup time automatically
    • true (default) | false
    • If set to true, backupTime can't be entered
    cloudMysqlServiceNameStringRequiredName of the Cloud DB for MySQL service to create
    • 3 to 30 characters, including English letters, Korean letters, numbers, and special character "-"
    cloudMysqlServerNamePrefixStringRequiredPrefix 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
    cloudMysqlUserNameStringRequiredDB 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
    cloudMysqlUserPasswordStringRequiredDB 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
    hostIpStringRequiredIP addresses 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.%
    • When using the GET method, % must be URL-encoded as %25
    cloudMysqlPortIntegerOptionalTCP 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
    cloudMysqlDatabaseNameStringRequiredDB 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
    subnetNoStringRequiredSubnet 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
    standbyMasterSubnetNoStringConditionalSubnet 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
    isPrivateSubDomainBooleanOptionalWhether to use private sub domains
    • true | false
    • If set to true, privateSubDomainPrefix can be specified
    privateSubDomainPrefixStringConditionalEnter 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
    engineVersionCodeStringConditionalDB engine version
    isDeleteProtectionBooleanOptionalCluster termination protection status
    • true | false (default)
      • true: cluster termination unavailable
      • false: cluster termination available
    responseFormatTypeStringOptionalFormat 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>
    

    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.