getSubnetList

Prev Next

Available in VPC

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

Request

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

Method URI
GET, POST /getSubnetList

Request headers

For information about the headers common to all VPC APIs, see VPC common headers.

Request query parameters

The following describes the parameters.

Field Type Required Description
regionCode String Optional Region code where you want to query the subnet list
  • First Region of the query result (default)
  • Check through getRegionList.
  • subnetNoList.N List<String> Optional Query the list with the subnet number.
  • subnetNo can be obtained through getSubnetList.
  • Example: subnetNoList.1=1234&subnetNoList.2=2345
  • subnetName String Optional Query the list with the subnet name.
    subnet String Optional Query the list with the subnet IP address range.
  • Example: subnet=10.0.0.0/24
  • subnetTypeCode String Optional Query the list with the subnet type code.
    • PUBLIC | PRIVATE
    usageTypeCode String Optional Query the list with the subnet purpose type code.
    • GEN| LOADB | BM | NATGW
      • GEN: general
      • LOADB: dedicated for load balancer
      • BM: dedicated for bare metal
      • NATGW: dedicated for NAT Gateway
    networkAclNo String Optional Query the subnet list with the network ACL number applied to the subnet.
  • networkAclNo can be obtained through getNetworkAclList.
  • pageNo Integer Optional Page numbers in paged results
    • Page the result values using pageNo and pageSize.
    pageSize Integer Conditional
    subnetStatusCode String Optional Query the subnet list with the subnet status code.
    • INIT | CREATING | RUN | TERMTING
    vpcNo String Optional Query the subnet list with the VPC number.
    zoneCode String Optional Query the subnet list with the zone code.
    responseFormatType String Optional Format of the response result
    • xml (default) | json

    Request example

    The request example is as follows:

    curl --location 'https://ncloud.apigw.ntruss.com/vpc/v2/getSubnetList
    ?regionCode=KR
    &subnetNoList.1=***43
    &subnetName=test-***
    &subnet=***.***.1.0
    &subnetTypeCode=PUBLIC
    &usageTypeCode=GEN
    &networkAclNo=***31
    &subnetStatusCode=RUN
    &vpcNo=***04
    &zoneCode=KR-1' 
    --header 'x-ncp-apigw-timestamp: {Timestamp}' 
    --header 'x-ncp-iam-access-key: {Sub Account Access Key}' 
    --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'
    

    Response

    This section describes the response format.

    Response body

    See SubnetList 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:

    <getSubnetListResponse>
      <requestId>4a7ca579-1b43-439b-97f7-c423a37bc3d9</requestId>
      <returnCode>0</returnCode>
      <returnMessage>success</returnMessage>
      <totalRows>1</totalRows>
      <subnetList>
        <subnet>
          <subnetNo>***43</subnetNo>
          <vpcNo>***04</vpcNo>
          <zoneCode>KR-1</zoneCode>
          <subnetName>test-***</subnetName>
          <subnet>***.***.1.0/24</subnet>
          <subnetStatus>
            <code>RUN</code>
            <codeName>run</codeName>
          </subnetStatus>
          <createDate>2020-05-04T11:49:52+0900</createDate>
          <subnetType>
            <code>PUBLIC</code>
            <codeName>Public</codeName>
          </subnetType>
          <usageType>
            <code>GEN</code>
            <codeName>General</codeName>
          </usageType>
          <networkAclNo>***31</networkAclNo>
        </subnet>
      </subnetList>
    </getSubnetListResponse>