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] [engineVersionCode] [isDeleteProtection] [output]
パラメータ
パラメータの説明は次の通りです。
パラメータ | タイプ | 必須の有無 | 説明 | 制限事項 |
---|---|---|---|---|
regionCode | String | N | Cloud DB for MySQLインスタンスが存在するリージョンコード
|
- |
vpcNo | String | Y | VPC番号
|
- |
cloudMysqlImageProductCode | String | N | Cloud DB for MySQLイメージ商品コード
|
- |
cloudMysqlProductCode | String | N | Cloud DB for MySQL商品コード
|
- |
dataStorageTypeCode | String | N | データストレージタイプコード
|
- |
isHa | Boolean | N | 高可用性の有無
|
- |
isMultiZone | Boolean | N | マルチゾーンの有無
|
- |
isStorageEncryption | Boolean | N | データストレージ暗号化の適用有無(今後適用)
|
- |
isBackup | Boolean | N | バックアップの有無
|
- |
backupFileRetentionPeriod | Integer | N | バックアップファイルの保管期間
|
- |
backupTime | String | N | バックアップ時間
|
- |
isAutomaticBackup | Boolean | N | バックアップ時間の自動有無
|
- |
cloudMysqlServiceName | String | Y | Cloud DB for MySQLサービス名 | 英数字、ハイフン「-」、ハングルのみ入力可能
|
cloudMysqlServerNamePrefix | String | Y | Cloud DB for MySQLサーバ名の接頭辞
|
英字の小文字、数字、記号のハイフン「-」のみ使用
|
cloudMysqlUserName | String | Y | MySQL User ID | 英数字、記号の「\ _ , -」のみ使用可能で、先頭文字は英字のみ使用
|
cloudMysqlUserPassword | String | Y | MySQL Userパスワード | 英字、数字、記号の3つの項目をそれぞれ1文字以上必ず含めること
|
hostIp | String | Y | MySQL User host
|
- |
cloudMysqlPort | Integer | N | Cloud DB for MySQLインスタンスにアクセスするための TCPポート番号
|
|
cloudMysqlDatabaseName | String | Y | Cloud DB for MySQLインスタンスにデフォルトで作成する DB名 | 英数字、記号の「\ _ , -」のみ使用可能で、先頭文字は英字のみ使用
|
subnetNo | String | Y | Subnet番号
|
- |
standbyMasterSubnetNo | String | N | Standby Masterサーバの Subnet番号
|
- |
isPrivateSubDomain | Boolean | N | Private Sub Domainの使用有無
|
- |
privateSubDomainPrefix | String | N | Private Sub Domain Prefix
|
英字の小文字、数字、記号のハイフン「-」のみ使用
|
engineVersionCode | String | N | Engine Version
|
- |
isDeleteProtection | Boolean | N | クラスタ返却保護するかどうか
|
- |
output | String | N | レスポンス結果の形式タイプ
|
- |
レスポンス
レスポンスデータタイプ
コマンドの呼び出しに対するレスポンスデータタイプは次の通りです。
- 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インスタンスの状態名
|
private CommonCode cloudMysqlInstanceStatus; | Cloud DB for MySQLインスタンスの状態コード
|
private CommonCode cloudMysqlInstanceOperation; | Cloud DB for MySQLインスタンス Operationコード
|
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サーバインスタンスの状態名
|
private CommonCode cloudMysqlServerInstanceStatus; | Cloud DB for MySQLサーバインスタンスの状態コード
|
private CommonCode cloudMysqlServerInstanceOperation; | Cloud DB for MySQLサーバインスタンス Operationコード
|
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 String privateIp; | プライベート IPアドレス |
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>