createCloudPostgresqlInstance
    • PDF

    createCloudPostgresqlInstance

    • PDF

    Article summary

    Available in VPC

    Create a Cloud DB for PostgreSQL instance.

    Commands

    The command statement is as follows.

    ncloud vpostgresql createCloudPostgresqlInstance [regionCode] [vpcNo] [subnetNo] [secondarySubnetNo] [cloudPostgresqlImageProductCode] [cloudPostgresqlProductCode] [dataStorageTypeCode] [isHa] [isMultiZone] [isStorageEncryption] [isBackup] [backupFileRetentionPeriod] [backupTime] [isAutomaticBackup] [cloudPostgresqlServiceName] [cloudPostgresqlServerNamePrefix] [cloudPostgresqlUserName] [cloudPostgresqlUserPassword] [clientCidr] [cloudPostgresqlPort] [cloudPostgresqlDatabaseName] [output]
    

    Parameter

    The following describes the parameters.

    ParameterTypeRequiredDescriptionRestrictions
    regionCodeStringNRegion code
    - regionCode can be obtained through the getRegionList action
    - Default: Select the first Region of the getRegionList search result
    -
    vpcNoStringYVPC number
    - vpcNo can be obtained through the getCloudPostgresqlTargetVpcList action
    -
    subnetNoStringYSubnet number
    - subnetNo can be obtained through the getCloudPostgresqlTargetSubnetList action
    - Subscription to public domains can only be done in a DB server created in public subnet
    - Subnet migrations are not available after creating the Cloud DB for PostgreSQL instance
    -
    secondarySubnetNoStringNSubnet number of the secondary server
    - If the multi-zone status (isMultiZone) is false, then no input is taken, and it must be entered if the multi-zone status (isMultiZone) is true
    - It should have a different zone from the primary server's subnet, and their public or private statuses must match
    - secondarySubnetNo can be obtained through the getCloudPostgresqlTargetSubnetList action
    -
    cloudPostgresqlImageProductCodeStringNCloud DB for PostgreSQL image product code
    - cloudPostgresqlImageProductCode can be obtained through productCode of the getCloudPostgresqlImageProductList action
    - It will be created with the default value if no input is entered
    -
    cloudPostgresqlProductCodeStringNCloud DB for PostgreSQL product code
    - Determine the server specifications of the Cloud DB for PostgreSQL instance to create
    - cloudPostgresqlProductCode can be obtained through productCode of the getCloudPostgresqlProductList action
    - Default: The minimum specification is selected, where the minimum specification is based on 1. memory and 2. CPU
    -
    dataStorageTypeCodeStringNData storage type code
    - The data storage type can't be changed after installation
    - Options: SSD | HDD
    - Default: SSD
    -
    isHaBooleanNHigh availability status
    - Selecting high availability creates two servers, including a standby master server, and incurs additional fees
    - If the high availability status (isHa) is false, then the isMultiZone and secondarySubnetNo parameters can't be used
    - Default: true
    -
    isMultiZoneBooleanNMulti-zone status
    - If the high availability status (isHa) is true, then you can select whether to use multi-zone
    - If you select multi-zone, then the primary server and secondary server are created in different zones to provide higher availability
    - This field must be entered if the high availability status (isHa) is true
    - It can't be used in the Neurocloud environment
    - Default: false
    -
    isStorageEncryptionBooleanNData storage encryption application status (to be applied later)
    - Applying the encryption encrypts the DB data and saves it in the storage
    - Storage encryption settings can't be changed after creating a Cloud DB for PostgreSQL instance
    - It can't be used in the Neurocloud environment
    - Default: false
    -
    isBackupBooleanNBackup status
    - If the high availability status (isHa) is true, then the backup status (isBackup) is fixed as true
    - Default: true
    -
    backupFileRetentionPeriodIntegerNBackup file retention period
    - Backups are performed every day, and backup files are saved in a separate backup storage
    - Fees are charged for the space you use
    - Default: 1 (1 day)
    -
    backupTimeStringNBackup time
    - Set the time for when the backup is performed. This field must be entered if the backup status (isBackup) is true and the automatic backup status (isAutomaticBackup) is false
    - 01:15
    -
    backupFileStorageCountIntegerNNumber of backup files to retain
    - Number of backup files to retain can range from 1 to 30
    -
    isBackupFileCompressionBooleanNWhether to compress backup files
    - Default: true
    -
    isAutomaticBackupBooleanNAutomatic backup time status
    - Select whether to have the backup time set automatically. If the automatic backup status (isAutomaticBackup) is true, then backupTime can't be entered
    - Default: true
    -
    cloudPostgresqlServiceNameStringYCloud DB for PostgreSQL service name- Only English letters, numbers, hyphens (-), and Korean letters are allowed
    - Min: 3
    - Max: 30
    cloudPostgresqlServerNamePrefixStringYCloud DB for PostgreSQL server name prefix
    - It is created with additional random text after the passed cloudPostgresqlServerNamePrefix value to prevent host name duplicates
    - The DB server name must only contain lowercase English letters, numbers, and hyphens (-)
    - It must start with an English letter and end with an English letter or a number
    - Min: 3
    - Max: 20
    cloudPostgresqlUserNameStringYAdmin ID
    - Enter the user name to be used for the DB admin
    - Only lowercase English letters, numbers, and underscores (_) are allowed, and it must start with an English letter
    - Min: 4
    - Max: 16
    cloudPostgresqlUserPasswordStringYAdmin password
    - Enter the user's password to be used for the DB admin
    - It must be at least 8 characters in length and have at least one English letter, one special character, and one number
    - \ ` & + \ " ' / and spaces can't be used in passwords
    - It can't contain user ID
    - Min: 8
    - Max: 20
    clientCidrStringYAccess control
    - Enter the CIDR of the client to connect to
    - Allow access to all: 0.0.0.0/0
    - Allow access to specific IPs: 192.168.1.1/32
    - Allow access to an IP range: 192.168.1.0/24
    cloudPostgresqlPortIntegerNCloud DB for PostgreSQL port
    - Enter the TCP port number for PostgreSQL access
    - Default: 5432
    5432
    or
    - Min: 10000
    - Max: 20000
    cloudPostgresqlDatabaseNameStringYDB name of Cloud DB for PostgreSQL
    - Enter the DB name to create by default
    - Only lowercase English letters, numbers, and underscores (_) are allowed, and it must start with an English letter
    - Min: 1
    - Max: 30
    outputStringNFormat type of the response result
    - Options: xml | json
    - Default: json
    -

    Response

    Response data type

    • CloudPostgresqlInstanceList type
    CloudPostgresqlInstanceList extends CommonResponseDescription
    private Integer totalRows;Total number of lists searched
    private List<CloudPostgresqlInstance> cloudPostgresqlInstanceList = new ArrayList<>();Cloud DB for PostgreSQL instance list
    • CloudPostgresqlInstance type
    CloudPostgresqlInstanceDescription
    private String cloudPostgresqlInstanceNo;Cloud DB for PostgreSQL instance number
    private String cloudPostgresqlServiceName;Cloud DB for PostgreSQL service name
    private String cloudPostgresqlInstanceStatusName;Cloud DB for PostgreSQL instance status name
    - creating
    - deleted
    - deleting
    - downgrading
    - pending
    - recovering
    - reinstalling
    - restarting
    - running
    - settingup
    - shuttingdown
    - stopped
    - upgrading
    private CommonCode cloudPostgresqlInstanceStatus;Cloud DB for PostgreSQL instance status code
    - INIT (initiate)
    - CREAT (created)
    - DEL (deleted)
    private CommonCode cloudPostgresqlInstanceOperation;Cloud DB for PostgreSQL instance operation code
    - CREAT (create)
    - DEL (delete)
    - FO (failover)
    - NULL (no operation)
    - SETUP (setup)
    - UPGD (upgrade)
    - DWGD (downgrade)
    - BKP (backup)
    private String cloudPostgresqlImageProductCode;Cloud DB for PostgreSQL image product code
    private String engineVersion;Cloud DB for PostgreSQL engine version
    private String generationCode;Generation code
    private String license;Cloud DB for PostgreSQL license
    private Integer cloudPostgresqlPort;Cloud DB for PostgreSQL port
    private Boolean isHa;High availability status
    private Boolean isMultiZone;Multi-zone status
    private Boolean isBackup;Backup status
    private Integer backupFileRetentionPeriod;Backup file retention period
    private String backupTime;Backup time
    private Date createDate;Issuance date
    private AccessControlGroupNoList accessControlGroupNoList;ACG number list
    private CloudPostgresqlConfigList cloudPostgresqlConfigList;Cloud DB for PostgreSQL config list
    private List<CloudPostgresqlServerInstance> cloudPostgresqlServerInstanceList;Cloud DB for PostgreSQL server instance list
    • AccessControlGroupNoList type
    AccessControlGroupNoListDescription
    private List<String> accessControlGroupNoList = new ArrayList<>();ACG number list
    • CloudPostgresqlConfigList type
    CloudPostgresqlConfigListDescription
    private List<String> cloudPostgresqlConfigList = new ArrayList<>();Cloud DB for PostgreSQL config list
    • CloudPostgresqlServerInstance type
    CloudPostgresqlServerInstanceDescription
    private String cloudPostgresqlServerInstanceNo;Cloud DB for PostgreSQL server instance number
    private String cloudPostgresqlServerName;Cloud DB for PostgreSQL server name
    private CommonCode cloudPostgresqlServerRole;Cloud DB for PostgreSQL server role
    private String cloudPostgresqlServerInstanceStatusName;Cloud DB for PostgreSQL server instance status name
    - creating
    - deleted
    - deleting
    - downgrading
    - pending
    - recovering
    - reinstalling
    - restarting
    - running
    - settingup
    - shuttingdown
    - stopped
    - upgrading
    - downgrading
    private CommonCode cloudPostgresqlServerInstanceStatus;Cloud DB for PostgreSQL server instance status code
    - DEL (deleted)
    - PEND (pending)
    - RUN (running)
    - STOP (stopped)
    - FSTOP (failure stopped)
    private CommonCode cloudPostgresqlServerInstanceOperation;Cloud DB for PostgreSQL server instance operation code
    - NOOP (no operation)
    - CREAT (create)
    - START (start)
    - RSTRT (restart)
    - SETUP (setup)
    - STOP (stop)
    - FO (failover)
    - DEL (delete)
    - UPGD (upgrade)
    - DWGD (downgrade)
    - RISTL (reinstall)
    private String cloudPostgresqlProductCode;Cloud DB for PostgreSQL product code
    private String regionCode;Region code
    private String zoneCode;Zone code
    private String vpcNo;VPC number
    private String subnetNo;Subnet number
    private Boolean isPublicSubnet;Public subnet status
    private String publicDomain;Public domain name
    private String privateDomain;Private domain name
    private String privateIp;Private IP
    private CommonCode dataStorageType;Data storage type
    private Boolean isStorageEncryption;Data storage encryption status
    private Long dataStorageSize;Data storage size
    private Long usedDataStorageSize;Size of data storage in use
    private Integer cpuCount;Number of CPUs
    private Long memorySize;Memory size
    private Date uptime;VM boot completion time
    private Date createDate;Issuance date

    Examples

    It describes call and response examples.

    Call examples

    The following is a call example.

    ncloud vpostgresql createCloudPostgresqlInstance --regionCode KR --vpcNo ****87 --subnetNo ****49 --secondarySubnetNo ****51 --cloudPostgresqlImageProductCode SW.VPGSL.OS.LNX64.CNTOS.0708.PGSQL.133.B050 --cloudPostgresqlProductCode SVR.VPGSL.DBSVR.STAND.C002.M004.NET.SSD.B050.G001 --dataStorageTypeCode SSD --isHa true --isMultiZone true --isStorageEncryption true --isBackup true --backupFileRetentionPeriod 10 --backupTime 02:00 --isAutomaticBackup false --cloudPostgresqlServiceName test-**** --cloudPostgresqlServerNamePrefix test-**** --cloudPostgresqlUserName test**** --cloudPostgresqlUserPassword ******** --clientCidr 0.0.0.0/0 --cloudPostgresqlPort 15432 --cloudPostgresqlDatabaseName test**** --backupFileStorageCount=5 --isBackupFileCompression=true
    

    Response example

    The response example is as follows:

    When the response result format type (output) is JSON

    {
      "createCloudPostgresqlInstanceResponse": {
        "requestId": "9f76fa24-67a4-4cdf-bf70-f62f251d5138",
        "returnCode": 0,
        "returnMessage": "success",
        "totalRows": 1,
        "cloudPostgresqlInstanceList": [
          {
            "cloudPostgresqlInstanceNo": "****925",
            "cloudPostgresqlServiceName": "test-****",
            "cloudPostgresqlInstanceStatusName": "creating",
            "cloudPostgresqlInstanceStatus": {
              "code": "INIT",
              "codeName": "CLOUD DATABASE(VPC) Init State"
            },
            "cloudPostgresqlInstanceOperation": {
              "code": "CREAT",
              "codeName": "CLOUD DATABASE(VPC) Creat OP"
            },
            "cloudPostgresqlImageProductCode": "SW.VPGSL.OS.LNX64.CNTOS.0708.PGSQL.133.B050",
            "engineVersion": "PostgreSQL 13.3",
            "generationCode": "G2",
            "license": "PostgreSQL License",
            "cloudPostgresqlPort": 15432,
            "isHa": true,
            "isMultiZone": true,
            "isBackup": true,
            "backupFileRetentionPeriod": 10,
            "backupTime": "02:00",
            "createDate": "2021-09-16T18:00:00+0900",
            "accessControlGroupNoList": [],
            "cloudPostgresqlConfigList": [
                "sample_config=sample_value"
            ],
            "cloudPostgresqlServerInstanceList": [
              {
                "cloudPostgresqlServerName": "test-****-001-gcb",
                "cloudPostgresqlServerRole": {
                  "code": "M",
                  "codeName": "Primary"
                },
                "cloudPostgresqlServerInstanceStatusName": "creating",
                "cloudPostgresqlServerInstanceStatus": {
                  "code": "PEND",
                  "codeName": "CLOUD DATABASE(VPC) Server Pending State"
                },
                "cloudPostgresqlServerInstanceOperation": {
                  "code": "CREAT",
                  "codeName": "CLOUD DATABASE(VPC) Server Create OP"
                },
                "cloudPostgresqlProductCode": "SVR.VPGSL.DBSVR.STAND.C002.M004.NET.SSD.B050.G001",
                "regionCode": "KR",
                "zoneCode": "KR-1",
                "vpcNo": "****87",
                "subnetNo": "****49",
                "isPublicSubnet": true,
                "privateIp": "***.***.***.***",
                "dataStorageType": {
                  "code": "SSD",
                  "codeName": "SSD"
                },
                "isStorageEncryption": true,
                "dataStorageSize": 10737418240,
                "cpuCount": 2,
                "memorySize": 4294967296,
                "createDate": "2021-09-16T18:00:00+0900"
              },
              {
                "cloudPostgresqlServerName": "test-****-002-gcc",
                "cloudPostgresqlServerRole": {
                  "code": "H",
                  "codeName": "Secondary"
                },
                "cloudPostgresqlServerInstanceStatusName": "creating",
                "cloudPostgresqlServerInstanceStatus": {
                  "code": "PEND",
                  "codeName": "CLOUD DATABASE(VPC) Server Pending State"
                },
                "cloudPostgresqlServerInstanceOperation": {
                  "code": "CREAT",
                  "codeName": "CLOUD DATABASE(VPC) Server Create OP"
                },
                "cloudPostgresqlProductCode": "SVR.VPGSL.DBSVR.STAND.C002.M004.NET.SSD.B050.G001",
                "regionCode": "KR",
                "zoneCode": "KR-2",
                "vpcNo": "****87",
                "subnetNo": "****51",
                "isPublicSubnet": true,
                "privateIp": "***.***.***.***",
                "dataStorageType": {
                  "code": "SSD",
                  "codeName": "SSD"
                },
                "isStorageEncryption": true,
                "dataStorageSize": 10737418240,
                "cpuCount": 2,
                "memorySize": 4294967296,
                "createDate": "2021-09-16T18:00:00+0900"
              }
            ]
          }
        ]
      }
    }
    

    When the response result format type (output) is XML

    <createCloudPostgresqlInstanceResponse>
        <requestId>9f76fa24-67a4-4cdf-bf70-f62f251d5138</requestId>
        <returnCode>0</returnCode>
        <returnMessage>success</returnMessage>
        <totalRows>1</totalRows>
        <cloudPostgresqlInstanceList>
            <cloudPostgresqlInstance>
                <cloudPostgresqlInstanceNo>****925</cloudPostgresqlInstanceNo>
                <cloudPostgresqlServiceName>test-****</cloudPostgresqlServiceName>
                <cloudPostgresqlInstanceStatusName>creating</cloudPostgresqlInstanceStatusName>
                <cloudPostgresqlInstanceStatus>
                    <code>INIT</code>
                    <codeName>CLOUD DATABASE(VPC) Init State</codeName>
                </cloudPostgresqlInstanceStatus>
                <cloudPostgresqlInstanceOperation>
                    <code>CREAT</code>
                    <codeName>CLOUD DATABASE(VPC) Creat OP</codeName>
                </cloudPostgresqlInstanceOperation>
                <cloudPostgresqlImageProductCode>SW.VPGSL.OS.LNX64.CNTOS.0708.PGSQL.133.B050</cloudPostgresqlImageProductCode>
                <engineVersion>PostgreSQL 13.3</engineVersion>
                <generationCode>G2</generationCode>
                <license>PostgreSQL License</license>
                <cloudPostgresqlPort>15432</cloudPostgresqlPort>
                <isHa>true</isHa>
                <isMultiZone>true</isMultiZone>
                <isBackup>true</isBackup>
                <backupFileRetentionPeriod>10</backupFileRetentionPeriod>
                <backupTime>02:00</backupTime>
                <createDate>2021-09-16T18:00:00+0900</createDate>
                <accessControlGroupNoList/>
                <cloudPostgresqlConfigList>
                    <cloudPostgresqlConfig>sample_config=sample_value</cloudPostgresqlConfig>
                </cloudPostgresqlConfigList>
                <cloudPostgresqlServerInstanceList>
                    <cloudPostgresqlServerInstance>
                        <cloudPostgresqlServerName>test-****-001-gcb</cloudPostgresqlServerName>
                        <cloudPostgresqlServerRole>
                            <code>M</code>
                            <codeName>Primary</codeName>
                        </cloudPostgresqlServerRole>
                        <cloudPostgresqlServerInstanceStatusName>creating</cloudPostgresqlServerInstanceStatusName>
                        <cloudPostgresqlServerInstanceStatus>
                            <code>PEND</code>
                            <codeName>CLOUD DATABASE(VPC) Server Pending State</codeName>
                        </cloudPostgresqlServerInstanceStatus>
                        <cloudPostgresqlServerInstanceOperation>
                            <code>CREAT</code>
                            <codeName>CLOUD DATABASE(VPC) Server Create OP</codeName>
                        </cloudPostgresqlServerInstanceOperation>
                        <cloudPostgresqlProductCode>SVR.VPGSL.DBSVR.STAND.C002.M004.NET.SSD.B050.G001</cloudPostgresqlProductCode>
                        <regionCode>KR</regionCode>
                        <zoneCode>KR-1</zoneCode>
                        <vpcNo>****87</vpcNo>
                        <subnetNo>****49</subnetNo>
                        <isPublicSubnet>true</isPublicSubnet>
                        <privateIp>***.***.***.***</privateIp>
                        <dataStorageType>
                            <code>SSD</code>
                            <codeName>SSD</codeName>
                        </dataStorageType>
                        <isStorageEncryption>true</isStorageEncryption>
                        <dataStorageSize>10737418240</dataStorageSize>
                        <cpuCount>2</cpuCount>
                        <memorySize>4294967296</memorySize>
                        <createDate>2021-09-16T18:00:00+0900</createDate>
                    </cloudPostgresqlServerInstance>
                    <cloudPostgresqlServerInstance>
                        <cloudPostgresqlServerName>test-****-002-gcc</cloudPostgresqlServerName>
                        <cloudPostgresqlServerRole>
                            <code>H</code>
                            <codeName>Secondary</codeName>
                        </cloudPostgresqlServerRole>
                        <cloudPostgresqlServerInstanceStatusName>creating</cloudPostgresqlServerInstanceStatusName>
                        <cloudPostgresqlServerInstanceStatus>
                            <code>PEND</code>
                            <codeName>CLOUD DATABASE(VPC) Server Pending State</codeName>
                        </cloudPostgresqlServerInstanceStatus>
                        <cloudPostgresqlServerInstanceOperation>
                            <code>CREAT</code>
                            <codeName>CLOUD DATABASE(VPC) Server Create OP</codeName>
                        </cloudPostgresqlServerInstanceOperation>
                        <cloudPostgresqlProductCode>SVR.VPGSL.DBSVR.STAND.C002.M004.NET.SSD.B050.G001</cloudPostgresqlProductCode>
                        <regionCode>KR</regionCode>
                        <zoneCode>KR-2</zoneCode>
                        <vpcNo>****87</vpcNo>
                        <subnetNo>****51</subnetNo>
                        <isPublicSubnet>true</isPublicSubnet>
                        <privateIp>***.***.***.***</privateIp>
                        <dataStorageType>
                            <code>SSD</code>
                            <codeName>SSD</codeName>
                        </dataStorageType>
                        <isStorageEncryption>true</isStorageEncryption>
                        <dataStorageSize>10737418240</dataStorageSize>
                        <cpuCount>2</cpuCount>
                        <memorySize>4294967296</memorySize>
                        <createDate>2021-09-16T18:00:00+0900</createDate>
                    </cloudPostgresqlServerInstance>
                </cloudPostgresqlServerInstanceList>
            </cloudPostgresqlInstance>
        </cloudPostgresqlInstanceList>
    </createCloudPostgresqlInstanceResponse>
    

    Was this article helpful?

    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.