VPC環境で利用できます。
Cloud DB for MySQLで使用可能な Subnetリストを照会します。
構文
getCloudMysqlTargetSubnetList構文は次の通りです。
./ncloud vmysql getCloudMysqlTargetSubnetList \
--vpcNo <vpc-no> \
--cloudMysqlImageProductCode <image-product-code> \
[--isPublic <true|false>] \
[--regionCode <KR|SGN|JPN>] \
[--output <json|xml>]
オプション
getCloudMysqlTargetSubnetListの実行時に指定できるオプションについて説明します。
必須オプション
getCloudMysqlTargetSubnetListの必須オプションです。
| オプション | タイプ | 必須の有無 | 説明 |
|---|---|---|---|
--vpcNo |
String | Required | VPC番号 |
--cloudMysqlImageProductCode |
String | Required | Cloud DB for MySQLイメージ商品コード |
任意オプション
getCloudMysqlTargetSubnetListの任意オプションです。指定しない場合、オプションにはデフォルト値が適用されます。
| オプション | タイプ | 必須の有無 | 説明 |
|---|---|---|---|
--isPublic |
Boolean | Optional | Public Subnetかどうか
|
共通オプション
vmysqlコマンドで共通して使用するオプションについては、Cloud DB for MySQL (VPC)のオプションを参照してください。
例
Cloud DB for MySQL Subnetリストの照会リクエストが成功すると、各 Subnetの番号と名前、IPアドレス範囲情報が返されます。
コマンド
コマンドの例は次の通りです。
./ncloud vmysql getCloudMysqlTargetSubnetList \
--vpcNo 12345678 \
--cloudMysqlImageProductCode SW.VMYSL.OS.LNX64.ROCKY.0810.MYSQL.B050 \
--isPublic false \
--regionCode KR \
--output json
出力
出力の例は次の通りです。
{
"getCloudMysqlTargetSubnetListResponse": {
"totalRows": 2,
"targetSubnetList": [
{
"subnetNo": "23456789",
"subnetName": "private-subnet",
"vpcNo": "12345678",
"vpcName": "vpc-01",
"zoneCode": "KR-1",
"subnet": "10.0.0.0/24",
"isPublic": false,
"createdDate": "2026-04-28T13:00:34+0900"
},
{
"subnetNo": "23456790",
"subnetName": "standby-subnet",
"vpcNo": "12345678",
"vpcName": "vpc-01",
"zoneCode": "KR-2",
"subnet": "10.0.1.0/24",
"isPublic": false,
"createdDate": "2026-06-04T16:49:30+0900"
}
],
"requestId": "d4e5f6a7-b8c9-0123-defa-456789012345",
"returnCode": "0",
"returnMessage": "success"
}
}