getSubnetList

Prev Next

Available in VPC

Get the list of subnets based on the conditions the user specifies.

Syntax

The getSubnetList syntax is as follows:

./ncloud vpc getSubnetList \
    [--vpcNo <vpc-no>] \
    [--zoneCode <zone-code>] \
    [--subnetNoList <subnet-no-list>] \
    [--subnetName <subnet-name>] \
    [--subnet <subnet-ip-range>] \
    [--subnetTypeCode <PUBLIC|PRIVATE>] \
    [--usageTypeCode <GEN|LOADB|BM|NATGW>] \
    [--networkAclNo <network-acl-no>] \
    [--subnetStatusCode <INIT|CREATING|RUN|TERMTING>] \
    [--pageNo <page-no>] \
    [--pageSize <page-size>] \
    [--regionCode <KR|SGN|JPN>] \
    [--output <json|xml>]

Options

This section describes the options available when running getSubnetList.

Required options

The following options are required for getSubnetList.

Options Type Required Description
--pageSize Integer Conditional Page size to display when paginating
  • Required if pageNo is entered.
  • Uses pageNo and pageSize to paginate the results.

Optional options

These are the optional options for getSubnetList. Options that are not specified will use their default values.

Options Type Required Description
--vpcNo String Optional VPC number
--zoneCode String Optional Zone code
--subnetNoList List Optional Subnet number list
  • You can enter multiple items separated by spaces (e.g., --subnetNoList 1234 2345).
--subnetName String Optional Subnet name
--subnet String Optional IP address range
--subnetTypeCode String Optional Subnet type code
  • PUBLIC | PRIVATE
--usageTypeCode String Optional Subnet usage type code
  • GEN | LOADB | BM | NATGW
    • GEN: General
    • LOADB: Load balancer only
    • BM: Bare metal only
    • NATGW: NAT Gateway only
--networkAclNo String Optional Network ACL number
--subnetStatusCode String Optional Subnet status code
  • INIT | CREATING | RUN | TERMTING
--pageNo Integer Optional Page numbers in paged results
  • Page the result values using pageNo and pageSize.

Common options

For information about the options common to all vpc subcommands, see VPC options.

Examples

If the request to retrieve the subnet list is successful, the configuration information for each subnet is returned.

Command

The command example is as follows:

./ncloud vpc getSubnetList \
    --vpcNo 12345678 \
    --zoneCode KR-1 \
    --subnetNoList 23456789 23456790 \
    --subnetName test-subnet-01 \
    --subnet 10.0.1.0/24 \
    --subnetTypeCode PUBLIC \
    --usageTypeCode GEN \
    --networkAclNo 34567890 \
    --subnetStatusCode RUN \
    --pageNo 0 \
    --pageSize 10 \
    --regionCode KR \
    --output json

Output

The output example is as follows:

{
  "getSubnetListResponse": {
    "totalRows": 1,
    "subnetList": [
      {
        "subnetNo": "23456789",
        "vpcNo": "12345678",
        "zoneCode": "KR-1",
        "subnetName": "test-subnet-01",
        "subnet": "10.0.1.0/24",
        "subnetStatus": {
          "code": "RUN",
          "codeName": "In operation"
        },
        "createDate": "2026-07-07T14:12:27+0900",
        "subnetType": {
          "code": "PUBLIC",
          "codeName": "Public"
        },
        "usageType": {
          "code": "GEN",
          "codeName": "General"
        },
        "networkAclNo": "34567890"
      }
    ],
    "requestId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
    "returnCode": "0",
    "returnMessage": "success"
  }
}