createCloudMysqlInstance
    • PDF

    createCloudMysqlInstance

    • PDF

    Article Summary

    VPC環境で利用できます。

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

    コマンド

    コマンド構文は、次の通りです。

    ncloud vmysql createCloudMysqlInstance [regionCode] [vpcNo] [cloudMysqlImageProductCode] [cloudMysqlProductCode] [dataStorageTypeCode] [isHa] [isMultiZone] [isStorageEncryption] [isBackup] [backupFileRetentionPeriod] [backupTime] [isAutomaticBackup] [cloudMysqlServiceName] [cloudMysqlServerNamePrefix] [cloudMysqlUserName] [cloudMysqlUserPassword] [hostIp] [cloudMysqlPort] [cloudMysqlDatabaseName] [subnetNo] [standbyMasterSubnetNo] [isPrivateSubDomain] [privateSubDomainPrefix] [output]
    

    パラメータ

    パラメータについての説明は、次の通りです。

    パラメータタイプ要否説明制約事項
    regionCodeStringNCloud DB for MySQLインスタンスが存在するリージョンコード
    - getRegionListアクションを通じて取得可能
    - default: getRegionList照会結果の最初のリージョンを選択
    -
    vpcNoStringYVPC番号
    - getCloudMysqlTargetVpcListアクションを通じて取得可能
    -
    cloudMysqlImageProductCodeStringNCloud DB for MySQLイメージのサービスコード
    - getCloudMysqlImageProductListアクションの productCodeで取得可能
    - 入力しない場合、default値で作成
    -
    cloudMysqlProductCodeStringNCloud DB for MySQLのサービスコード
    - getCloudMysqlProductListアクションの productCodeで取得可能
    - default: 最小仕様に選択され、最小仕様の基準は 1. メモリ 2. CPU
    -
    dataStorageTypeCodeStringNデータストレージのタイプコード
    - インストール後にデータストレージタイプは変更不可
    - options
     - cloudMysqlImageProductCodeの generationCodeが G2の場合: SSD | HDD
     - cloudMysqlImageProductCodeの generationCodeが G3の場合: CB1
    - default
     - cloudMysqlImageProductCodeの generationCodeが G2の場合: SSD
     - cloudMysqlImageProductCodeの generationCodeが G3の場合: CB1
    -
    isHaBooleanN高可用性の有無
    - 高可用性を選択すると、Standby Masterサーバを含めて2台のサーバが作成され、追加料金が発生
    - 高可用性の有無(isHa)が falseであれば isMultiZone、standbyMasterSubnetNoパラメータは使用不可
    - default: true
    -
    isMultiZoneBooleanNマルチゾーンの有無
    - 高可用性の有無(isHa)が trueの場合、マルチゾーンの有無を選択できる
    - マルチゾーンを選択すると、Masterサーバと Standby Masterサーバを異なる Zoneに作成してより高い可用性を提供
    - 高可用性の有無(isHa)が trueである場合、必ず入力
    - default: false
    -
    isStorageEncryptionBooleanNデータストレージ暗号化の適用有無
    - 暗号化適用時 DBデータは暗号化され、ストレージに保存 Cloud DB for MySQLのインスタンスの作成後はストレージ暗号化設定の変更は不可能
    - 高可用性の有無(isHa)が trueである場合のみ暗号化の適用ができる
    - default: false
    -
    isBackupBooleanNバックアップの有無
    - 高可用性の有無(isHa)が trueである場合、バックアップの有無(isBackup)は trueに固定
    - default: true
    -
    backupFileRetentionPeriodIntegerNバックアップファイルの保存期間
    - バックアップは InnoDBエンジンのみサポートし、それ以外のエンジンで作成されたテーブルのバックアップはサポートしない
    - バックアップは毎日行われ、バックアップファイルは別途のバックアップストレージに保存され、料金は使用する容量分だけ課金
    - default: 1(1日)
    -
    backupTimeStringNバックアップ時間
    - バックアップを行う時間を設定、バックアップの有無(isBackup)が trueで、自動バックアップの有無(isAutomaticBackup)が falseであれば必ず入力
    例)
    - 01:15
    -
    isAutomaticBackupBooleanNバックアップ時間の自動有無
    - 自動的にバックアップ時間を設定するかの有無を選択、自動バックアップの有無(isAutomaticBackup)が trueであれば backupTimeの入力不可
    - default: true
    -
    cloudMysqlServiceNameStringYCloud DB for MySQLのサービス名- 英数字、ハイフン(-)、ハングルのみ入力可能
    - min: 3
    - max: 20
    cloudMysqlServerNamePrefixStringYCloud DB for MySQLのサーバ名接頭辞
    - ホスト名の重複を防ぐため、任意の textが追加で含まれ作成される
    - 英小文字、数字、ハイフン(-)でのみ構成
    - 先頭は英字、末尾は英字または数字のみ可能
    - min: 3
    - max: 30
    cloudMysqlUserNameStringYMySQL User ID- 英数字、記号(\ _ , -)のみ許可し、先頭は英字にすること
    - min: 4
    - max: 16
    cloudMysqlUserPasswordStringYMySQL Userパスワード- 英数字、記号の3つの項目を1文字以上含むこと
    - 特定記号(` & + \ " ' / 空白)は使用不可
    - min: 8
    - max: 20
    hostIpStringYMySQL User host
    例)
    - 全体アクセスを許可: %
    - 特定の IPアドレスアクセスを許可: 1.1.1.1
    - IPアドレス帯域のアクセスを許可: 1.1.1.%
    -
    cloudMysqlPortIntegerNCloud DB for MySQLのインスタンスにアクセスするための TCPポート番号
    - default: 3306
    3306
    or
    - min: 10000
    - max: 20000
    cloudMysqlDatabaseNameStringYCloud DB for MySQLのインスタンスに基本的に作成する DB名- 英数字、記号(\ _ , -)のみ許可し、先頭は英字にすること
    - min: 1
    - max: 30
    subnetNoStringYSubnet番号
    - getCloudMysqlTargetSubnetListアクションを通じて取得可能
    - Publicドメインは、Public Subnetに作成された DBサーバでのみご利用の申し込みができる
    - Cloud DB for MySQLのインスタンス作成後に Subnet移動は不可能
    -
    standbyMasterSubnetNoStringNStandby Masterサーバのサブネット番号
    - マルチゾーンの有無(isMultiZone)が falseであれば入力せず、マルチゾーンの有無(isMultiZone)が trueであれば必ず入力
    - standbyMasterSubnetNoは、Masterサーバの Subnetと Zoneが異なる必要があり、同じ Publicか Privateである必要がある
    - getCloudMysqlTargetSubnetListアクションを通じて取得可能
    -
    isPrivateSubDomainBooleanNPrivate Sub Domainの使用有無
    - Private Sub Domainの使用有無(isPrivateSubDomain)が trueの場合、private sub domain prefixの指定ができる
    -
    privateSubDomainPrefixStringNPrivate Sub Domain Prefix
    - Private Domainに Sub Domainを追加
    - Private Sub Domainの使用有無(isPrivateSubDomain)が trueの場合、必ず入力
    - 英小文字、数字、ハイフン(-)でのみ構成
    - 先頭は英字、末尾は英字または数字のみ可能
    - min: 3
    - max: 15
    engineVersionCodeStringNEngine Version
    - getCloudMysqlImageProductListアクションを通じて取得可能
    - cloudMysqlImageProductCodeの generationCodeが G3の場合に入力
    - 入力しない場合、現在提供中の最新バージョンで作成
    -
    outputStringNレスポンス結果のフォーマットタイプ
    - options: xml | json
    - default: json
    -

    レスポンス

    レスポンスデータのタイプ

    コマンド呼び出しに対するレスポンスデータタイプは、次の通りです。

    • CloudMysqlInstanceListのタイプ
    CloudMysqlInstanceList extends CommonResponse説明
    private Integer totalRows;照会されたリストの総数
    private List<CloudMysqlInstance> cloudMysqlInstanceList = new ArrayList<>();
    • CloudMysqlInstanceタイプ
    CloudMysqlInstance説明
    private String cloudMysqlInstanceNo;Cloud DB for MySQLインスタンス番号
    private String cloudMysqlServiceName;Cloud DB for MySQLのサービス名
    private String cloudMysqlInstanceStatusName;Cloud DB for MySQLインスタンス状態名
    -creating
    -deleted
    -deleting
    -pending
    -recovering
    -reinstalling
    -restarting
    -running
    -settingup
    -shuttingdown
    -stopped
    -upgrading
    -downgrading
    private CommonCode cloudMysqlInstanceStatus;Cloud DB for MySQLインスタンスのステータスコード
    -INIT (init)
    -CREAT (created)
    -DEL (deleted)
    private CommonCode cloudMysqlInstanceOperation;Cloud DB for MySQLインスタンスの Operationコード
    -CREAT (create)
    -DEL (delete)
    -FO (failover)
    -NULL (no)
    -SETUP (setup)
    -UPGD (upgrade)
    -DWGD (downgrade)
    -BKP (backup)
    private String cloudMysqlImageProductCode;Cloud DB for MySQLイメージのサービスコード
    private String engineVersion;Cloud DB for MySQLのエンジンバージョン
    private CommonCode license;Cloud DB for MySQLライセンス
    private Integer cloudMysqlPort;Cloud DB for MySQLポート
    private Boolean isHa;高可用性の有無
    private Boolean isMultiZone;マルチゾーンの有無
    private Boolean isBackup;バックアップの有無
    private Integer backupFileRetentionPeriod;バックアップファイルの保存期間
    private String backupTime;バックアップ時間
    private String generationCode;サーバ世代コード
    private Date createDate;作成日
    private List<String> accessControlGroupNoList;ACG番号リスト
    private List<String> cloudMysqlConfigList;Cloud DB for MySQL Configリスト
    private List<CloudMysqlServerInstance> cloudMysqlServerInstanceList;Cloud DB for MySQLサーバインスタンスリスト
    • CloudMysqlServerInstanceタイプ
    CloudMysqlServerInstance説明
    private String cloudMysqlServerInstanceNo;Cloud DB for MySQLのサーバインスタンス番号
    private String cloudMysqlServerName;Cloud DB for MySQLのサーバ名
    private CommonCode cloudMysqlServerRole;Cloud DB for MySQLのサーバロール
    private String cloudMysqlServerInstanceStatusName;Cloud DB for MySQLサーバインスタンスのステータス名
    -creating
    -deleted
    -deleting
    -downgrading
    -pending
    -recovering
    -reinstalling
    -restarting
    -running
    -settingup
    -shuttingdown
    -stopped
    -upgrading
    -downgrading
    private CommonCode cloudMysqlServerInstanceStatus;Cloud DB for MySQLサーバインスタンスのステータスコード
    -DEL (deleted)
    -PEND (pending)
    -RUN (running)
    -STOP (stopped)
    -FSTOP (failure stopped)
    private CommonCode cloudMysqlServerInstanceOperation;Cloud DB for MySQLサーバインスタンスの Operationコード
    -NOOP (no operation)
    -CREAT (create)
    -START (start)
    -RSTRT (restart)
    -SETUP (setup)
    -STOP (stop)
    -FO (failover)
    -DEL (delete)
    -UPGD (upgrade)
    -DWGD (downgrade)
    -RISTL (서버 reinstall)
    -MIG (migration)
    private String cloudMysqlProductCode;Cloud DB for MySQLのサービスコード
    private String regionCode;リージョンコード
    private String zoneCode;ZONEコード
    private String vpcNo;VPC番号
    private String subnetNo;Subnet番号
    private Boolean isPublicSubnet;Public Subnetの有無
    private String publicDomain;グローバルドメイン名
    private String privateDomain;プライベートドメイン名
    private CommonCode dataStorageType;データストレージタイプ
    private Boolean isStorageEncryption;データストレージの暗号化の有無
    private Long dataStorageSize;データストレージサイズ
    private Long usedDataStorageSize;使用中のデータストレージサイズ
    private Integer cpuCount;virtual CPU数
    private Long memorySize;メモリサイズ
    private Date uptime;VM Booting完了時間
    private Date createDate;作成日

    呼び出しとレスポンス例を説明します。

    呼び出し例

    呼び出し例は、次の通りです。

    ncloud vmysql 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
    

    レスポンス例

    レスポンス例は、次の通りです。

    レスポンス結果フォーマットタイプ(output)が jsonのとき

    {
      "createCloudMysqlInstanceResponse": {
        "requestId": "ae758cc2-006c-4df5-8ad2-aeef4ecfa8bf",
        "returnCode": "0",
        "returnMessage": "success",
        "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": 3306,
            "isHa": true,
            "isMultiZone": true,
            "isBackup": true,
            "backupFileRetentionPeriod": 10,
            "backupTime": "02:00",
            "generationCode": "G2",
            "createDate": "2021-05-27T18:00:00+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": "2021-05-27T18:00:00+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": "2021-05-27T18:00:00+0900"
              }
            ]
          }
        ]
      }
    }
    

    レスポンス結果フォーマットタイプ(output)が xmlの場合

    
    <createCloudMysqlInstanceResponse>
        <requestId>c04bfdd1-e27e-4006-9bc3-bc37840ce1dd</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.5732.B050</cloudMysqlImageProductCode>
                <engineVersion>MYSQL5.7.32</engineVersion>
                <license>
                    <code>GPL</code>
                    <codeName>General Public License</codeName>
                </license>
                <cloudMysqlPort>13306</cloudMysqlPort>
                <isHa>true</isHa>
                <isMultiZone>true</isMultiZone>
                <isBackup>true</isBackup>
                <generationCode>G2</generationCode>
                <createDate>2021-05-27T18:00:00+0900</createDate>
                <accessControlGroupNoList/>
                <cloudMysqlConfigList/>
                <cloudMysqlServerInstanceList>
                    <cloudMysqlServerInstance>
                        <cloudMysqlServerName>test-****-001-e04</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>2021-05-27T18:00:00+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>2021-05-27T18:00:00+0900</createDate>
                    </cloudMysqlServerInstance>
                </cloudMysqlServerInstanceList>
            </cloudMysqlInstance>
        </cloudMysqlInstanceList>
    </createCloudMysqlInstanceResponse>
    

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

    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.