createCloudPostgresqlInstance

Prev Next

Available in VPC

Create a Cloud DB for PostgreSQL instance.

Request

This section describes the request format. The method and URI are as follows:

Method URI
GET, POST /createCloudPostgresqlInstance

Request headers

For information about the headers common to all Cloud DB for PostgreSQL (VPC) APIs, see Cloud DB for PostgreSQL (VPC) request headers.

Request parameters

The following describes the parameters.

Field Type Required Description
regionCode String Optional Region code
  • Region code of the Cloud DB for PostgreSQL instance to create
  • Check through getRegionList.
  • First Region of the getRegionList query result (default)
vpcNo String Required Number of VPC to create the Cloud DB for PostgreSQL instance in
subnetNo String Required Subnet number of the default network interface to be used in the Cloud DB for PostgreSQL instance
  • Check through getCloudPostgresqlTargetSubnetList.
  • 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.
secondarySubnetNo String Conditional Subnet number of the secondary server
  • Must be entered for multi-zone CloudDB for PostgreSQL.
  • It must be in a different zone from the primary server's subnet, but the public or private status must match.
  • Check through getCloudPostgresqlTargetSubnetList.
cloudPostgresqlImageProductCode String Optional Cloud DB for PostgreSQL image product code
cloudPostgresqlProductCode String Optional Cloud DB for PostgreSQL product code
  • Determine the server specification for the Cloud DB for PostgreSQL instance to create.
  • Check through getCloudPostgresqlProductList.
  • Minimum specification (default)
  • Minimum specification is based on 1. memory and 2. CPU.
dataStorageTypeCode String Optional Data storage type code
  • The data storage type can't be changed after installation.
  • SSD (default) | HDD
isHa Boolean Optional High availability status
  • true (default) | false
    • Selecting true (high availability) creates two servers, including a secondary server, and incurs additional fees.
    • If false, isMultiZone and standbyMasterSubnetNo parameters are not used.
isMultiZone Boolean Conditional Multi-zone status
  • true | false (default)
  • Required if the high availability status (isHa) is true
    • If true, provide the primary and secondary servers in separate zones to provide higher availability.
    • Unavailable in the Neurocloud environment
isStorageEncryption Boolean Optional Data storage encryption application status (to be applied later)
  • true | false (default)
  • When encryption is applied, the DB data is encrypted and saved in the storage.
  • You can't change the storage encryption settings after creating a Cloud DB for PostgreSQL instance.
  • Unavailable in the Neurocloud environment
isBackup Boolean Optional Whether PostgreSQL backup is enabled
  • true (default) | false
  • If the high availability status (isHa) is true, the backup status (isBackup) is fixed to true.
backupFileRetentionPeriod Integer Optional Backup file retention period (days)
  • 1 (default)
  • Backup is performed every day, and the backup file is stored in a separate backup storage.
  • Fees are charged for the space you use.
backupTime String Conditional Set backup time.
  • true (default) | false
  • Required if the backup status (isBackup) is true and automatic backup status (isAutomaticBackup) is false
  • Example: 01:15
backupFileStorageCount Integer Optional Number of backup files to retain
  • 1-30
isBackupFileCompression Boolean Optional Whether to compress backup files
  • true (default) | false
isAutomaticBackup Boolean Optional Whether to set the backup time automatically
  • true (default) | false
  • If set to true, backupTime can't be entered.
cloudPostgresqlServiceName String Required Name of the Cloud DB for PostgreSQL service to create
  • 3 to 30 characters, including English letters, Korean letters, numbers, and special character "-"
cloudPostgresqlServerNamePrefix String Required Prefix for the Cloud DB for PostgreSQL server name to create
  • 3 to 20 characters, including lowercase English letters, numbers, and the special character "-", and must begin with an English letter and end with an English letter or number
  • A 3-digit number is automatically generated after the prefix, with additional random text to prevent hostname duplication.
  • Example: If the prefix is test-123: test-123-001-523a
cloudPostgresqlUserName String Required DB user account ID
  • 4 to 16 characters, including lowercase English letters, numbers, and special character "_", and must begin with an English letter
  • Predefined roles and reserved words can't be used.
cloudPostgresqlUserPassword String Required DB user account password
  • Enter between 8 and 20 characters containing at least one English letter, number, and special character.
  • Special characters ` & + \ " ' / and spaces can't be used.
  • User ID can't be included.
clientCidr String Required Enter the CIDR (access control) of the client to connect to.
  • Example:
    • 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
cloudPostgresqlPort Integer Optional TCP port number to access the Cloud DB for PostgreSQL instance
  • 5432 (default)
  • Specified range: 10000-20000
  • The port number can't be changed after it is specified.
cloudPostgresqlDatabaseName String Required DB name to be created by default in the Cloud DB for PostgreSQL instance
  • 1 to 30 characters, including lowercase English letters, numbers, and special character "_", and must begin with an English letter
engineVersionCode String Optional
responseFormatType String Optional Format of the response result
  • xml (default) | json

Request example

The request example is as follows:

curl --location --request GET 'https://ncloud.apigw.ntruss.com/vpostgresql/v2/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.M008.NET.SSD.B050.G002
&dataStorageTypeCode=SSD
&isHa=true
&isMultiZone=true
&isStorageEncryption=true
&isBackup=true
&backupFileRetentionPeriod=10
&backupFileStorageCount=5
&backupTime=02:00
&isBackupFileCompression=true
&isAutomaticBackup=false
&cloudPostgresqlServiceName=test-****
&cloudPostgresqlServerNamePrefix=test-****
&cloudPostgresqlUserName=test****
&cloudPostgresqlUserPassword=********
&clientCidr=0.0.0.0/0
&cloudPostgresqlPort=15432
&engineVersionCode=13.15
&cloudPostgresqlDatabaseName=test****'
--header 'x-ncp-apigw-timestamp: {Timestamp}' 
--header 'x-ncp-iam-access-key: {Access Key}' 
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'

Response

This section describes the response format.

Response body

See CloudPostgresqlInstanceList for the response body.

Response status codes

For response status codes common to NAVER Cloud Platform, see Ncloud API response status codes.

Response example

The response example is as follows:

  • If responseFormatType=json
{
    "createCloudPostgresqlInstanceResponse": {
        "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",
                "license": "PostgreSQL License",
                "cloudPostgresqlPort": 15432,
                "isHa": true,
                "isMultiZone": true,
                "isBackup": true,
                "backupFileRetentionPeriod": 10,
                "backupTime": "02:00",
                "createDate": "2024-06-03T10:47:11+0900",
                "accessControlGroupNoList": [],
                "cloudPostgresqlConfigList": [
                    "sample_config=sample_value"
                ],
                "cloudPostgresqlServerInstanceList": [
                    {
                        "cloudPostgresqlServerName": "test-****-001-523a",
                        "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.M008.NET.SSD.B050.G002",
                        "regionCode": "KR",
                        "zoneCode": "KR-1",
                        "vpcNo": "****87",
                        "subnetNo": "****49",
                        "isPublicSubnet": true,
                        "dataStorageType": {
                            "code": "SSD",
                            "codeName": "SSD"
                        },
                        "isStorageEncryption": true,
                        "dataStorageSize": 10737418240,
                        "cpuCount": 2,
                        "memorySize": 8589934592,
                        "createDate": "2024-06-03T10:47:11+0900"
                    },
                    {
                        "cloudPostgresqlServerName": "test-****-002-523b",
                        "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.M008.NET.SSD.B050.G002",
                        "regionCode": "KR",
                        "zoneCode": "KR-2",
                        "vpcNo": "****87",
                        "subnetNo": "****51",
                        "isPublicSubnet": true,
                        "dataStorageType": {
                            "code": "SSD",
                            "codeName": "SSD"
                        },
                        "isStorageEncryption": true,
                        "dataStorageSize": 10737418240,
                        "cpuCount": 2,
                        "memorySize": 8589934592,
                        "createDate": "2024-06-03T10:47:11+0900"
                    }
                ]
            }
        ],
        "requestId": "a3ab2112-****-****-****-e8deb543d4c2",
        "returnCode": "0",
        "returnMessage": "success"
    }
}
  • If responseFormatType=xml (default)
<?xml version="1.0" encoding="UTF-8"?>
<createCloudPostgresqlInstanceResponse>
    <requestId>a3ab2112-****-****-****-e8deb543d4c2</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>
            <license>PostgreSQL License</license>
            <cloudPostgresqlPort>15432</cloudPostgresqlPort>
            <isHa>true</isHa>
            <isMultiZone>true</isMultiZone>
            <isBackup>true</isBackup>
            <backupFileRetentionPeriod>10</backupFileRetentionPeriod>
            <backupTime>02:00</backupTime>
            <createDate>2024-06-03T10:47:11+0900</createDate>
            <accessControlGroupNoList/>
            <cloudPostgresqlConfigList>
                <cloudPostgresqlConfig>sample_config=sample_value</cloudPostgresqlConfig>
            </cloudPostgresqlConfigList>
            <cloudPostgresqlServerInstanceList>
                <cloudPostgresqlServerInstance>
                    <cloudPostgresqlServerName>test-****-001-523a</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.M008.NET.SSD.B050.G002</cloudPostgresqlProductCode>
                    <regionCode>KR</regionCode>
                    <zoneCode>KR-1</zoneCode>
                    <vpcNo>****87</vpcNo>
                    <subnetNo>****49</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>2024-06-03T10:47:11+0900</createDate>
                </cloudPostgresqlServerInstance>
                <cloudPostgresqlServerInstance>
                    <cloudPostgresqlServerName>test-****-002-523b</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.M008.NET.SSD.B050.G002</cloudPostgresqlProductCode>
                    <regionCode>KR</regionCode>
                    <zoneCode>KR-2</zoneCode>
                    <vpcNo>****87</vpcNo>
                    <subnetNo>****51</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>2024-06-03T10:47:11+0900</createDate>
                </cloudPostgresqlServerInstance>
            </cloudPostgresqlServerInstanceList>
        </cloudPostgresqlInstance>
    </cloudPostgresqlInstanceList>
</createCloudPostgresqlInstanceResponse>