MENU
      createCloudMysqlInstance

        createCloudMysqlInstance


        記事の要約

        VPC環境で利用できます。

        Cloud DB for MySQLインスタンスを作成します。

        リクエスト

        リクエスト形式を説明します。リクエスト形式は次の通りです。

        メソッドURI
        GET, POST/createCloudMysqlInstance

        リクエストヘッダ

        Cloud DB for MySQL (VPC) APIで共通して使用されるヘッダの詳細は、Cloud DB for MySQL (VPC)のリクエストヘッダをご参照ください。

        リクエストパラメータ

        パラメータの説明は次の通りです。

        フィールドタイプ必須の有無説明
        regionCodeStringOptionalリージョンコード
        • 作成対象の Cloud DB for MySQLインスタンスのリージョンコード
        • getRegionListを通じて確認
        • getRegionList照会結果の最初のリージョン(デフォルト)
        vpcNoStringRequiredCloud DB for MySQLインスタンス作成対象の VPC番号
        cloudMysqlImageProductCodeStringOptionalCloud DB for MySQLイメージ商品コード
        cloudMysqlProductCodeStringOptionalCloud DB for MySQL商品コード
        • 作成対象の Cloud DB for MySQLインスタンスのサーバスペックを決める
        • getCloudMysqlProductListを通じて確認
        • 最小スペック(デフォルト)
        • 最小スペックの基準: 1. メモリ 2. CPUの順で決める
        dataStorageTypeCodeStringOptionalデータストレージタイプコード
        • インストール後、データストレージタイプは変更不可
        • SSD | HDD | CB1
        • cloudMysqlImageProductCodeの generationCodeに応じてデフォルト値が異なる
          • G2の場合: SSD
          • G3の場合: CB1
        isHaBooleanOptional高可用性の有無
        • true(デフォルト) | false
        • true(高可用性を選択)の場合、Standby Masterサーバを含めて2台のサーバが作成され、追加料金が発生
        • falseの場合、isMultiZonestandbyMasterSubnetNoパラメータは使用されない
        isMultiZoneBooleanConditionalMulti Zoneかどうか
        • true | false(デフォルト)
        • 高可用性の有無(isHa)がtrueの場合、必ず入力
        • trueの場合、Masterサーバと Standby Masterサーバを異なるゾーンに作成してより高い可用性を提供
        isStorageEncryptionBooleanOptionalデータストレージ暗号化の適用有無(今後適用)
        • true | false(デフォルト)
        • 高可用性の有無(isHa)がtrueの場合にのみ暗号化を適用可能
        • 暗号化を適用すると、DBデータは暗号化されストレージに保存
        • Cloud DB for MySQLインスタンスの作成後、ストレージ暗号化の設定は変更不可
        isBackupBooleanOptionalMySQLのバックアップ設定の有無
        • true(デフォルト) | false
        • 高可用性の有無(isHa)がtrueの場合、バックアップの有無(isBackup)はtrueに固定される
        backupFileRetentionPeriodIntegerOptionalバックアップファイルの保管期間(日)
        • 1(デフォルト)
        • InnoDBエンジンで作成されたテーブルのみバックアップをサポート
        • バックアップは毎日行われ、バックアップファイルは別途ストレージに保存
        backupTimeStringConditionalバックアップ時点を設定
        • true(デフォルト) | false
        • バックアップの有無(isBackup)がtrue、バックアップ時間自動設定の有無(isAutomaticBackup)がfalseの場合、必ず入力
        • <例>01:15(選択した時間 + 15分の間に Backupが開始)
        isAutomaticBackupBooleanOptionalバックアップ時点を自動設定するかどうか
        • true(デフォルト) | false
        • 設定値がtrueの場合、backupTimeは入力不可
        cloudMysqlServiceNameStringRequired作成する Cloud DB for MySQLサービス名
        • 英数字、ハングル、記号の「-」のみ使用して3~30文字以内で入力
        cloudMysqlServerNamePrefixStringRequired作成する Cloud DB for MySQLサーバ名の接頭辞
        • 英数字、記号の「-」を使用して3~20文字以内で入力、先頭文字は英字に、末尾文字は英字または数字にする
        • 接頭辞の末尾に3桁の数字が自動で付き、ホスト名の重複防止のために任意のテキストが追加され作成される
        • <例> 接頭辞が test-123の場合: test-123-001-4y1v
        cloudMysqlUserNameStringRequiredDB Userアカウント ID
        • 英数字、記号の「-」、「_」を使用して4~16文字以内で入力、先頭文字は英字にする
        • あらかじめ定義した予約語は使用不可
        cloudMysqlUserPasswordStringRequiredDB Userアカウントパスワード
        • 英数字、記号をそれぞれ1文字以上含めて8~20文字以内で入力
        • 記号の「` & + \ " ' /」とスペースは使用不可
        • Password pluginが有効になっている状態では、プラグインで設定したポリシーにも従わなければならない
        hostIpStringRequiredMySQL Serverにアクセスする IPアドレス
        • すべてのアクセスを許可: %
        • 特定の IPアドレスからのアクセスを許可: <例> 1.1.1.1
        • IPアドレス帯域からのアクセスを許可: <例> 1.1.1.%
        • GETメソッド使用時、%は%25に URLエンコードが必要
        cloudMysqlPortIntegerOptionalCloud DB for MySQLインスタンスアクセス用 TCPポート番号
        • 3306(デフォルト)
        • 指定範囲: 10000~20000
        • 一度指定したポート番号は変更不可
        cloudMysqlDatabaseNameStringRequiredCloud DB for MySQLインスタンスにデフォルトで作成する DB名
        • 英数字、記号の「\ _ , -」を使用して1~30文字以内で入力、先頭文字は英字にする
        subnetNoStringRequiredCloud DB for MySQLインスタンスで使用する基本ネットワークインターフェースの Subnet番号
        • getCloudMysqlTargetSubnetListを通じて確認
        • Publicドメインは、Public Subnetに作成された DBサーバでのみ申し込み可能
        • Cloud DB for MySQLインスタンス作成後に Subnetの移転はできない
        standbyMasterSubnetNoStringConditionalStandby Masterサーバの Subnet番号
        • Multi Zoneの Cloud DB for MySQLの場合、必ず入力
        • Masterサーバの Subnetとは Zoneが異なるように、Publicまたは Privateは同じようにする
        • getCloudMysqlTargetSubnetListを通じて確認
        isPrivateSubDomainBooleanOptionalPrivate Subドメインの使用有無
        • true | false
        • 設定値がtrueの場合、privateSubDomainPrefixを指定可能
        privateSubDomainPrefixStringConditionalPrivateドメインに追加する Subドメインを入力
        • 英数字、記号の「-」のみ使用して3~15文字以内で入力、先頭文字は英字、末尾文字は英字または数字のみ使用可能
        • Private Subドメインの使用有無(isPrivateSubDomain)がtrueの場合、必須
        • Slaveや Recoveryの追加時にも同じ Subドメインポリシーが追加される
        engineVersionCodeStringConditionalDBエンジンのバージョン
        isDeleteProtectionBooleanOptionalクラスタ返却保護するかどうか
        • true | false(デフォルト)
          • true: クラスタ返却不可
          • false: クラスタ返却可能
        responseFormatTypeStringOptionalレスポンス結果の形式
        • xml(デフォルト) | json

        リクエスト例

        リクエストのサンプルコードは次の通りです。

        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}'
        Curl

        レスポンス

        レスポンス形式を説明します。

        レスポンスボディ

        レスポンスボディの詳細は、CloudMysqlInstanceListをご参照ください。

        レスポンスステータスコード

        NAVERクラウドプラットフォームで共通して使用されるレスポンスステータスコードの詳細は、Ncloud APIのレスポンスステータスコードをご参照ください。

        レスポンス例

        レスポンスのサンプルコードは次の通りです。

        • 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"
            }
        }
        JSON
        • responseFormatType=xml(デフォルト)の場合
        <?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>
        XML

        この記事は役に立ちましたか?

        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.