createCloudPostgresqlReadReplicaInstance
    • PDF

    createCloudPostgresqlReadReplicaInstance

    • PDF

    記事の要約

    VPC環境で利用できます。

    Cloud DB for PostgreSQLインスタンスに Read Replicaサーバインスタンスを追加します。

    コマンド

    コマンド構文は次の通りです。

    ncloud vpostgresql createCloudPostgresqlReadReplicaInstance [regionCode] [cloudPostgresqlInstanceNo] [subnetNo] [output]
    

    パラメータ

    パラメータの説明は次の通りです。

    パラメータタイプ必須の有無説明制限事項
    regionCodeStringNリージョンコード
    - regionCodeはgetRegionListアクションを通じて取得
    - デフォルト: getRegionList照会結果の最初のリージョンを選択
    -
    cloudPostgresqlInstanceNoStringYCloud DB for PostgreSQLインスタンス番号
    - cloudPostgresqlInstanceNoは、getCloudPostgresqlInstanceListアクションを通じて取得
    -
    subnetNoStringNSubnet番号
    - subnetNoはgetCloudPostgresqlTargetSubnetListアクションを通じて取得
    - Cloud DB for PostgreSQLインスタンスの isMultiZoneが falseの場合、subnetNoは入力せず、既存の subnetNoに作成
    - Cloud DB for PostgreSQLインスタンスの isMultiZoneが trueの場合、必ず入力
    - Cloud DB for PostgreSQL Read Replicaインスタンス作成後に Subnetは移転不可
    -
    outputStringNレスポンス結果の形式タイプ
    - オプション: xml | json
    - デフォルト: json
    -

    レスポンス

    レスポンスデータタイプ

    • CloudPostgresqlInstanceListタイプ
    CloudPostgresqlInstanceList extends CommonResponse説明
    private Integer totalRows;照会されたリストの総数
    private List<CloudPostgresqlInstance> cloudPostgresqlInstanceList = new ArrayList<>();Cloud DB for PostgreSQLインスタンスリスト
    • CloudPostgresqlInstanceタイプ
    CloudPostgresqlInstance説明
    private String cloudPostgresqlInstanceNo;Cloud DB for PostgreSQLインスタンス番号
    private String cloudPostgresqlServiceName;Cloud DB for PostgreSQLサービス名
    private String cloudPostgresqlInstanceStatusName;Cloud DB for PostgreSQLインスタンスの状態名
    - creating
    - deleted
    - deleting
    - downgrading
    - pending
    - recovering
    - reinstalling
    - restarting
    - running
    - settingup
    - shuttingdown
    - stopped
    - upgrading
    private CommonCode cloudPostgresqlInstanceStatus;Cloud DB for PostgreSQLインスタンスの状態コード
    - INIT (initiate)
    - CREAT (created)
    - DEL (deleted)
    private CommonCode cloudPostgresqlInstanceOperation;Cloud DB for PostgreSQLインスタンスの Operationコード
    - CREAT (create)
    - DEL (delete)
    - FO (failover)
    - NULL (no operation)
    - SETUP (setup)
    - UPGD (upgrade)
    - DWGD (downgrade)
    - BKP (backup)
    private String cloudPostgresqlImageProductCode;Cloud DB for PostgreSQLイメージ商品コード
    private String engineVersion;Cloud DB for PostgreSQLエンジンバージョン
    private String generationCode;世代コード
    private String license;Cloud DB for PostgreSQLライセンス
    private Integer cloudPostgresqlPort;Cloud DB for PostgreSQLポート
    private Boolean isHa;高可用性の有無
    private Boolean isMultiZone;マルチゾーンの有無
    private Boolean isBackup;バックアップの有無
    private Integer backupFileRetentionPeriod;バックアップファイルの保管期間
    private String backupTime;バックアップ時間
    private Date createDate;作成日
    private AccessControlGroupNoList accessControlGroupNoList;ACG番号リスト
    private CloudPostgresqlConfigList cloudPostgresqlConfigList;Cloud DB for PostgreSQL Configリスト
    private List<CloudPostgresqlServerInstance> cloudPostgresqlServerInstanceList;Cloud DB for PostgreSQLサーバインスタンスリスト
    • AccessControlGroupNoListタイプ
    AccessControlGroupNoList説明
    private List<String> accessControlGroupNoList = new ArrayList<>();ACG番号リスト
    • CloudPostgresqlConfigListタイプ
    CloudPostgresqlConfigList説明
    private List<String> cloudPostgresqlConfigList = new ArrayList<>();Cloud DB for PostgreSQL Configリスト
    • CloudPostgresqlServerInstanceタイプ
    CloudPostgresqlServerInstance説明
    private String cloudPostgresqlServerInstanceNo;Cloud DB for PostgreSQLサーバインスタンス番号
    private String cloudPostgresqlServerName;Cloud DB for PostgreSQLサーバ名
    private CommonCode cloudPostgresqlServerRole;Cloud DB for PostgreSQLサーバのロール
    private String cloudPostgresqlServerInstanceStatusName;Cloud DB for PostgreSQLサーバインスタンスの状態名
    - creating
    - deleted
    - deleting
    - downgrading
    - pending
    - recovering
    - reinstalling
    - restarting
    - running
    - settingup
    - shuttingdown
    - stopped
    - upgrading
    - downgrading
    private CommonCode cloudPostgresqlServerInstanceStatus;Cloud DB for PostgreSQLサーバインスタンスの状態コード
    - DEL (deleted)
    - PEND (pending)
    - RUN (running)
    - STOP (stopped)
    - FSTOP (failure stopped)
    private CommonCode cloudPostgresqlServerInstanceOperation;Cloud DB for PostgreSQLサーバインスタンスの Operationコード
    - 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商品コード
    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;CPU数
    private Long memorySize;メモリ容量
    private Date uptime;VMの起動完了時間
    private Date createDate;作成日

    呼び出しとレスポンスの例を説明します。

    呼び出し例

    呼び出しのサンプルコードは次の通りです。

    ncloud vpostgresql createCloudPostgresqlReadReplicaInstance --regionCode KR --cloudPostgresqlInstanceNo ****925 --subnetNo ****51
    

    レスポンス例

    レスポンスのサンプルコードは次の通りです。

    レスポンス結果のフォーマットタイプ(output)が jsonの場合

    {
      "createCloudPostgresqlReadReplicaInstanceResponse": {
        "requestId": "543f6b42-dac9-49fb-bfd9-ebff72b35be1",
        "returnCode": 0,
        "returnMessage": "success",
        "totalRows": 1,
        "cloudPostgresqlInstanceList": [
          {
            "cloudPostgresqlInstanceNo": "****925",
            "cloudPostgresqlServiceName": "test-****",
            "cloudPostgresqlInstanceStatusName": "running",
            "cloudPostgresqlInstanceStatus": {
              "code": "CREAT",
              "codeName": "CLOUD DATABASE(VPC) Created State"
            },
            "cloudPostgresqlInstanceOperation": {
              "code": "NULL",
              "codeName": "CLOUD DATABASE(VPC) Null 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-08-30T18:00:00+0900",
            "accessControlGroupNoList": [
              "****48"
            ],
            "cloudPostgresqlConfigList": [
                "sample_config=sample_value"
            ],
            "cloudPostgresqlServerInstanceList": [
              {
                "cloudPostgresqlServerInstanceNo": "****926",
                "cloudPostgresqlServerName": "test-****-001-gcb",
                "cloudPostgresqlServerRole": {
                  "code": "M",
                  "codeName": "Primary"
                },
                "cloudPostgresqlServerInstanceStatusName": "running",
                "cloudPostgresqlServerInstanceStatus": {
                  "code": "RUN",
                  "codeName": "CLOUD DATABASE(VPC) Server Running State"
                },
                "cloudPostgresqlServerInstanceOperation": {
                  "code": "NOOP",
                  "codeName": "CLOUD DATABASE(VPC) Server Null OP"
                },
                "cloudPostgresqlProductCode": "SVR.VPGSL.DBSVR.STAND.C002.M004.NET.SSD.B050.G001",
                "regionCode": "KR",
                "zoneCode": "KR-1",
                "vpcNo": "****87",
                "subnetNo": "****49",
                "isPublicSubnet": true,
                "privateDomain": "pg-****.vpc-cdb-kr.ntruss.com",
                "privateIp": "***.***.***.***",
                "dataStorageType": {
                  "code": "SSD",
                  "codeName": "SSD"
                },
                "isStorageEncryption": true,
                "dataStorageSize": 10737418240,
                "usedDataStorageSize": 4365656064,
                "cpuCount": 2,
                "memorySize": 4294967296,
                "uptime": "2021-08-30T18:10:00+0900",
                "createDate": "2021-08-30T18:00:00+0900"
              },
              {
                "cloudPostgresqlServerInstanceNo": "****932",
                "cloudPostgresqlServerName": "test-****-002-gcc",
                "cloudPostgresqlServerRole": {
                  "code": "H",
                  "codeName": "Secondary"
                },
                "cloudPostgresqlServerInstanceStatusName": "running",
                "cloudPostgresqlServerInstanceStatus": {
                  "code": "RUN",
                  "codeName": "CLOUD DATABASE(VPC) Server Running State"
                },
                "cloudPostgresqlServerInstanceOperation": {
                  "code": "NOOP",
                  "codeName": "CLOUD DATABASE(VPC) Server Null OP"
                },
                "cloudPostgresqlProductCode": "SVR.VPGSL.DBSVR.STAND.C002.M004.NET.SSD.B050.G001",
                "regionCode": "KR",
                "zoneCode": "KR-2",
                "vpcNo": "****87",
                "subnetNo": "****51",
                "isPublicSubnet": true,
                "privateDomain": "pg-****.vpc-cdb-kr.ntruss.com",
                "privateIp": "***.***.***.***",
                "dataStorageType": {
                  "code": "SSD",
                  "codeName": "SSD"
                },
                "isStorageEncryption": true,
                "dataStorageSize": 10737418240,
                "usedDataStorageSize": 3291680768,
                "cpuCount": 2,
                "memorySize": 4294967296,
                "uptime": "2021-08-30T18:10:00+0900",
                "createDate": "2021-08-30T18:00:00+0900"
              },
              {
                "cloudPostgresqlServerName": "test-****-003-gcd",
                "cloudPostgresqlServerRole": {
                  "code": "S",
                  "codeName": "Read Replica"
                },
                "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-08-30T18:30:00+0900"
              }
            ]
          }
        ]
      }
    }
    

    レスポンス結果のフォーマットタイプ(output)が xmlの場合

    <createCloudPostgresqlReadReplicaInstanceResponse>
        <requestId>543f6b42-dac9-49fb-bfd9-ebff72b35be1</requestId>
        <returnCode>0</returnCode>
        <returnMessage>success</returnMessage>
        <totalRows>1</totalRows>
        <cloudPostgresqlInstanceList>
            <cloudPostgresqlInstance>
                <cloudPostgresqlInstanceNo>****925</cloudPostgresqlInstanceNo>
                <cloudPostgresqlServiceName>test-****</cloudPostgresqlServiceName>
                <cloudPostgresqlInstanceStatusName>running</cloudPostgresqlInstanceStatusName>
                <cloudPostgresqlInstanceStatus>
                    <code>CREAT</code>
                    <codeName>CLOUD DATABASE(VPC) Created State</codeName>
                </cloudPostgresqlInstanceStatus>
                <cloudPostgresqlInstanceOperation>
                    <code>NULL</code>
                    <codeName>CLOUD DATABASE(VPC) Null 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-08-30T18:00:00+0900</createDate>
                <accessControlGroupNoList>
                    <accessControlGroupNo>****48</accessControlGroupNo>
                </accessControlGroupNoList>
                <cloudPostgresqlConfigList>
                    <cloudPostgresqlConfig>sample_config=sample_value</cloudPostgresqlConfig>
                </cloudPostgresqlConfigList>
                <cloudPostgresqlServerInstanceList>
                    <cloudPostgresqlServerInstance>
                        <cloudPostgresqlServerInstanceNo>****926</cloudPostgresqlServerInstanceNo>
                        <cloudPostgresqlServerName>test-****-001-gcb</cloudPostgresqlServerName>
                        <cloudPostgresqlServerRole>
                            <code>M</code>
                            <codeName>Primary</codeName>
                        </cloudPostgresqlServerRole>
                        <cloudPostgresqlServerInstanceStatusName>running</cloudPostgresqlServerInstanceStatusName>
                        <cloudPostgresqlServerInstanceStatus>
                            <code>RUN</code>
                            <codeName>CLOUD DATABASE(VPC) Server Running State</codeName>
                        </cloudPostgresqlServerInstanceStatus>
                        <cloudPostgresqlServerInstanceOperation>
                            <code>NOOP</code>
                            <codeName>CLOUD DATABASE(VPC) Server Null 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>
                        <privateDomain>pg-****.vpc-cdb-kr.ntruss.com</privateDomain>
                        <privateIp>***.***.***.***</privateIp>
                        <dataStorageType>
                            <code>SSD</code>
                            <codeName>SSD</codeName>
                        </dataStorageType>
                        <isStorageEncryption>true</isStorageEncryption>
                        <dataStorageSize>10737418240</dataStorageSize>
                        <usedDataStorageSize>4365656064</usedDataStorageSize>
                        <cpuCount>2</cpuCount>
                        <memorySize>4294967296</memorySize>
                        <uptime>2021-08-30T18:10:00+0900</uptime>
                        <createDate>2021-08-30T18:00:00+0900</createDate>
                    </cloudPostgresqlServerInstance>
                    <cloudPostgresqlServerInstance>
                        <cloudPostgresqlServerInstanceNo>****932</cloudPostgresqlServerInstanceNo>
                        <cloudPostgresqlServerName>test-****-002-gcc</cloudPostgresqlServerName>
                        <cloudPostgresqlServerRole>
                            <code>H</code>
                            <codeName>Secondary</codeName>
                        </cloudPostgresqlServerRole>
                        <cloudPostgresqlServerInstanceStatusName>running</cloudPostgresqlServerInstanceStatusName>
                        <cloudPostgresqlServerInstanceStatus>
                            <code>RUN</code>
                            <codeName>CLOUD DATABASE(VPC) Server Running State</codeName>
                        </cloudPostgresqlServerInstanceStatus>
                        <cloudPostgresqlServerInstanceOperation>
                            <code>NOOP</code>
                            <codeName>CLOUD DATABASE(VPC) Server Null 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>
                        <privateDomain>pg-****.vpc-cdb-kr.ntruss.com</privateDomain>
                        <privateIp>***.***.***.***</privateIp>
                        <dataStorageType>
                            <code>SSD</code>
                            <codeName>SSD</codeName>
                        </dataStorageType>
                        <isStorageEncryption>true</isStorageEncryption>
                        <dataStorageSize>10737418240</dataStorageSize>
                        <usedDataStorageSize>3291680768</usedDataStorageSize>
                        <cpuCount>2</cpuCount>
                        <memorySize>4294967296</memorySize>
                        <uptime>2021-08-30T18:10:00+0900</uptime>
                        <createDate>2021-08-30T18:00:00+0900</createDate>
                    </cloudPostgresqlServerInstance>
                    <cloudPostgresqlServerInstance>
                        <cloudPostgresqlServerName>test-****-003-gcd</cloudPostgresqlServerName>
                        <cloudPostgresqlServerRole>
                            <code>S</code>
                            <codeName>Read Replica</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-08-30T18:30:00+0900</createDate>
                    </cloudPostgresqlServerInstance>
                </cloudPostgresqlServerInstanceList>
            </cloudPostgresqlInstance>
        </cloudPostgresqlInstanceList>
    </createCloudPostgresqlReadReplicaInstanceResponse>
    

    この記事は役に立ちましたか?

    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.