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 인스턴스가 존재하는 리전 코드 - getRegionList 액션을 통해서 획득 가능 - default: getRegionList 조회 결과의 첫 번째 리전을 선택 | - | 
| vpcNo | String | Y | VPC 번호 - getCloudMysqlTargetVpcList 액션을 통해서 획득 가능 | - | 
| cloudMysqlImageProductCode | String | N | Cloud DB for MySQL 이미지 상품 코드 - getCloudMysqlImageProductList 액션의 productCode로 획득 가능 - 입력하지 않을 경우 default값으로 생성 | - | 
| cloudMysqlProductCode | String | N | Cloud DB for MySQL 상품 코드 - getCloudMysqlProductList 액션의 productCode로 획득 가능 - default: 최소 사양으로 선택, 최소 사양의 기준은 1. 메모리 2. CPU | - | 
| dataStorageTypeCode | String | N | 데이터 스토리지 타입 코드 - 설치 이후에 데이터 스토리지 타입은 변경되지 않음 - options - cloudMysqlImageProductCode의 generationCode가 G2인 경우: SSD | HDD - cloudMysqlImageProductCode의 generationCode가 G3인 경우: CB1 - default - cloudMysqlImageProductCode의 generationCode가 G2인 경우: SSD - cloudMysqlImageProductCode의 generationCode가 G3인 경우: CB1 | - | 
| isHa | Boolean | N | 고가용성 여부 - 고가용성을 선택하면 Standby Master 서버를 포함한 2대의 서버로 생성되며 추가 요금 발생 - 고가용성 여부(isHa)가 false이면 isMultiZone, standbyMasterSubnetNo 파라미터는 사용되지 않음 - default: true | - | 
| isMultiZone | Boolean | N | 멀티존 여부 - 고가용성 여부(isHa)가 true일 경우 멀티존 여부 선택 가능 - 멀티존을 선택하면 Master 서버와 Standby Master 서버를 서로 다른 Zone에 생성하여 더욱 높은 가용성 제공 - 고가용성 여부(isHa)가 true일 경우 반드시 입력 - Neurocloud 환경에서는 이용 불가능 - default: false | - | 
| isStorageEncryption | Boolean | N | 데이터 스토리지 암호화 적용 여부 - 암호화 적용 시 DB 데이터는 암호화되어 스토리지에 저장 Cloud DB for MySQL 인스턴스 생성 이후에는 스토리지 암호화 설정 변경 불가능 - 고가용성 여부(isHa)가 true인 경우에만 암호화 적용 가능 - Neurocloud 환경에서는 이용 불가능 - default: false | - | 
| isBackup | Boolean | N | 백업 여부 - 고가용성 여부(isHa)가 true일 경우 백업 여부(isBackup)는 true로 고정 - default: true | - | 
| backupFileRetentionPeriod | Integer | N | 백업 파일 보관 기간 - 백업은 InnoDB 엔진만 지원하며 그 외 다른 엔진으로 생성된 테이블의 백업은 지원하지 않음 - 백업은 매일 수행되며 백업 파일은 별도의 백업 스토리지에 저장됨, 요금은 사용하는 공간만큼 과금 - default: 1(1일) | - | 
| backupTime | String | N | 백업 시간 - 백업이 수행되는 시간을 설정, 백업 여부(isBackup)가 true이고 자동 백업 여부(isAutomaticBackup)가 false이면 반드시 입력 <예시> - 01:15 | - | 
| isAutomaticBackup | Boolean | N | 백업 시간 자동 여부 - 자동으로 백업 시간을 설정할지에 대한 여부 선택, 자동 백업 여부(isAutomaticBackup)가 true이면 backupTime 입력 불가 - default: true | - | 
| cloudMysqlServiceName | String | Y | Cloud DB for MySQL 서비스 이름 | - 영어, 숫자, 붙임표( - ), 한글만 입력 가능 - min: 3 - max: 30 | 
| cloudMysqlServerNamePrefix | String | Y | Cloud DB for MySQL 서버 이름 접두사 - 호스트명 중복 방지를 위해 임의의 text가 추가로 포함되어 만들어짐 | - 영어 소문자, 숫자, 붙임표( - )로만 구성 - 첫 글자는 영문자, 마지막 글자는 영문자 또는 숫자만 가능 - min: 3 - max: 20 | 
| cloudMysqlUserName | String | Y | MySQL User ID | - 영어, 숫자, 특수문자( \ _ , - )만 허용하며 영어로 시작해야 함 - min: 4 - max: 16 | 
| cloudMysqlUserPassword | String | Y | MySQL User 패스워드 | - 영어, 숫자, 특수문자 3개 항목에 대해 1자 이상 포함되어야 함 - 특정 특수문자( ` & + \ " ' / 공백 )는 사용 불가 - min: 8 - max: 20 | 
| hostIp | String | Y | MySQL User host <예시> - 전체 접속 허용: % - 특정 IP 접속 허용: 1.1.1.1 - IP 대역 접속 허용: 1.1.1.% - CIDR 허용: 1.1.1.0/24 | - | 
| cloudMysqlPort | Integer | N | Cloud DB for MySQL 인스턴스에 접근하기 위한 TCP 포트 번호 - default: 3306 | 3306 or - min: 10000 - max: 20000 | 
| cloudMysqlDatabaseName | String | Y | Cloud DB for MySQL 인스턴스에 기본으로 생성할 DB명 | - 영어, 숫자, 특수문자( \ _ , - )만 허용하며 영어로 시작해야 함 - min: 1 - max: 30 | 
| subnetNo | String | Y | Subnet 번호 - getCloudMysqlTargetSubnetList 액션을 통해서 획득 가능 - Public 도메인은 Public Subnet에 생성된 DB 서버에서만 이용 신청 가능 - Cloud DB for MySQL 인스턴스 생성 이후에 Subnet 이전 불가능 | - | 
| standbyMasterSubnetNo | String | N | Standby Master 서버의 Subnet 번호 - 멀티존 여부(isMultiZone)가 false이면 입력받지 않으며 멀티존 여부(isMultiZone)가 true이면 반드시 입력 - standbyMasterSubnetNo는 Master 서버의 Subnet과 Zone이 달라야 하며 같은 Public이거나 Private이어야만 함 - Neurocloud 환경에서는 이용 불가능 - getCloudMysqlTargetSubnetList 액션을 통해서 획득 가능 | - | 
| isPrivateSubDomain | Boolean | N | Private Sub Domain 사용 여부 - Private Sub Domain 사용 여부(isPrivateSubDomain)가 true일 경우, private sub domain prefix 지정 가능 | - | 
| privateSubDomainPrefix | String | N | Private Sub Domain Prefix - Private Domain에 Sub Domain이 추가됨 - Private Sub Domain 사용 여부(isPrivateSubDomain)가 true면 반드시 입력 | - 영어 소문자, 숫자, 붙임표( - )로만 구성 - 첫 글자는 영문자, 마지막 글자는 영문자 또는 숫자만 가능 - min: 3 - max: 15 | 
| engineVersionCode | String | N | Engine Version - getCloudMysqlImageProductList 액션을 통해서 획득 가능 - 입력하지 않을 경우 현재 제공 중인 최신 버전으로 생성 | - | 
| isDeleteProtection | Boolean | N | 클러스터 반납 보호 여부 - true일 경우 클러스터 반납 불가 - default: false | - | 
| output | String | N | 응답 결과의 포맷 타입 - 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 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 FKR --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": "FKR",
            "zoneCode": "FKR-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": "FKR",
            "zoneCode": "FKR-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>FKR</regionCode>
                    <zoneCode>FKR-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>FKR</regionCode>
                    <zoneCode>FKR-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>