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>