---
title: "getCloudPostgresqlTargetSubnetList"
slug: "cli-vpostgresql-getcloudpostgresqltargetsubnetlist"
tags: ["Cloud DB for PostgreSQL", "VPC"]
updated: 2026-04-23T08:57:12Z
published: 2026-04-23T08:58:59Z
canonical: "cli.ncloud-docs.com/cli-vpostgresql-getcloudpostgresqltargetsubnetlist"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://cli.ncloud-docs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getCloudPostgresqlTargetSubnetList

<p class="platform-info type-vpc">VPC 환경에서 이용 가능합니다.</p>

Cloud DB for PostgreSQL 에서 사용 가능한 Subnet 목록을 조회합니다.

## 명령어<a name="명령어"></a>

명령어 구문은 다음과 같습니다.

```
ncloud vpostgresql getCloudPostgresqlTargetSubnetList [regionCode] [vpcNo] [cloudPostgresqlImageProductCode] [isPublic] [output]
```

### 파라미터<a name="파라미터"></a>

파라미터에 대한 설명은 다음과 같습니다.

| 파라미터                      | 타입    | 필수 여부 | 설명                                                         | 제약 사항 |
| ------------------------------- | ------- | --------- | ------------------------------------------------------------ | --------- |
| regionCode                      | String  | N         | 리전 코드<br>- regionCode는 [getRegionList](/docs/cli-vserver-server-common-getregionlist) 액션을 통해서 획득<br>- default: getRegionList 조회 결과의 첫 번째 리전을 선택 | -         |
| vpcNo                           | String  | Y         | VPC 번호<br>- vpcNo는 [getCloudPostgresqlTargetVpcList](/docs/cli-vpostgresql-getcloudpostgresqltargetvpclist) 액션을 통해서 획득 | -         |
| cloudPostgresqlImageProductCode | String  | Y         | Cloud DB for PostgreSQL 이미지 상품 코드<br>- cloudPostgresqlImageProductCode는 [getCloudPostgresqlImageProductList](/docs/cli-vpostgresql-getcloudpostgresqlimageproductlist) 액션의 productCode로 획득 | -         |
| isPublic                        | Boolean | N         | Public Subnet 조회 여부                                      | -         |
| output                          | String  | N         | 응답 결과의 포맷 타입<br>- options: xml \| json<br>- default: json | - |

## 응답<a name="응답"></a>

### 응답 데이터 타입<a name="응답데이터타입"></a>

- TargetSubnetList 타입

| TargetSubnetList extends CommonResponse                      | 설명                    |
| ------------------------------------------------------------ | ----------------------- |
| private Integer totalRows;                                   | 조회된 목록의 총 개수 |
| private List&lt;TargetSubnet&gt; targetSubnetList = new ArrayList<>(); | Subnet 목록           |

- TargetSubnet 타입

| TargetSubnet               | 설명               |
| -------------------------- | ------------------ |
| private String subnetNo;   | Subnet 번호        |
| private String subnetName; | Subnet 이름        |
| private String vpcNo;      | VPC 번호           |
| private String vpcName;    | VPC 이름           |
| private String zoneCode;   | Zone 코드          |
| private String subnet;     | IP 주소 범위       |
| private Boolean isPublic;  | Public Subnet 여부 |
| private Date createdDate;  | 생성일자           |

## 예시<a name="예시"></a>

호출과 응답 예시를 설명합니다.

### 호출 예시<a name="호출예시"></a>

호출 예시는 다음과 같습니다.

```
ncloud vpostgresql getCloudPostgresqlTargetSubnetList --regionCode KR --vpcNo 25**** --cloudPostgresqlImageProductCode SW.VPGSL.OS.LNX64.CNTOS.0708.PGSQL.133.B050
```

### 응답 예시<a name="응답예시"></a>

응답 예시는 다음과 같습니다.

응답 결과 포맷 타입(output)이 json 일 때
```json
{
  "getCloudPostgresqlTargetSubnetListResponse": {
    "requestId": "415050c7-bda1-43b6-9af1-f5ade127ad82",
    "returnCode": 0,
    "returnMessage": "success",
    "totalRows": 2,
    "targetSubnetList": [
      {
        "subnetNo": "37****",
        "subnetName": "test-****-private-kr1",
        "vpcNo": "25****",
        "vpcName": "test-****",
        "zoneCode": "KR-1",
        "subnet": "192.168.0.0/24",
        "isPublic": false,
        "createdDate": "2022-03-24T18:00:00+0900"
      },
      {
        "subnetNo": "37****",
        "subnetName": "test-****-public-kr1",
        "vpcNo": "25****",
        "vpcName": "test-****",
        "zoneCode": "KR-1",
        "subnet": "192.168.1.0/24",
        "isPublic": true,
        "createdDate": "2022-03-24T18:00:00+0900"
      }
    ]
  }
}
```

응답 결과 포맷 타입(output)이 xml 일 때
```xml
<getCloudPostgresqlTargetSubnetListResponse>
    <requestId>415050c7-bda1-43b6-9af1-f5ade127ad82</requestId>
    <returnCode>0</returnCode>
    <returnMessage>success</returnMessage>
    <totalRows>2</totalRows>
    <targetSubnetList>
        <targetSubnet>
            <subnetNo>37****</subnetNo>
            <subnetName>test-****-private-kr1</subnetName>
            <vpcNo>25****</vpcNo>
            <vpcName>test-****</vpcName>
            <zoneCode>KR-1</zoneCode>
            <subnet>192.168.0.0/24</subnet>
            <isPublic>false</isPublic>
            <createdDate>2022-03-24T18:00:00+0900</createdDate>
        </targetSubnet>
        <targetSubnet>
            <subnetNo>37****</subnetNo>
            <subnetName>test-****-public-kr1</subnetName>
            <vpcNo>25****</vpcNo>
            <vpcName>test-****</vpcName>
            <zoneCode>KR-1</zoneCode>
            <subnet>192.168.1.0/24</subnet>
            <isPublic>true</isPublic>
            <createdDate>2022-03-24T18:00:00+0900</createdDate>
        </targetSubnet>
    </targetSubnetList>
</getCloudPostgresqlTargetSubnetListResponse>
```
