createSubnet

Prev Next

Available in VPC

Create a subnet according to the user-defined conditions.

Request

The following describes the request format for the endpoint. The request format is as follows:

Method URI
GET | POST /vpc/v2/createSubnet
Note

This guide is based on the GET method. POST method call tests can be performed through Swagger in the API Gateway service of the NAVER Cloud Platform console.

Request headers

For headers common to all VPC APIs, see VPC common headers.

Request query parameters

You can use the following query parameters with your request:

Field Type Required Description
regionCode String Optional Region code where the subnet will be created
zoneCode String Required Zone code where the subnet will be created
vpcNo String Required Unique identification number of the VPC that will contain the subnet
subnetName String Optional Name of the subnet to create
  • Automatically granted by NAVER Cloud Platform (default)
  • 3 to 30 characters, including English letters, numbers, and the special character "-", and must begin with an English letter and end with an English letter or number
subnet String Required Subnet's IP address range
  • /16 - /28
  • Use a private range (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16)
networkAclNo String Required Number of network ACL to be applied to the subnet
subnetTypeCode String Required Subnet's type code
  • PUBLIC | PRIVATE
    • PUBLIC: allow Internet gateway
    • PRIVATE: disallow Internet gateway
usageTypeCode String Optional Subnet's purpose type code
  • GEN | LOADB | BM | NATGW
    • GEN: general
    • LOAB: load balancer only
    • BM: bare metal only
    • NATGW: NAT Gateway
responseFormatType String Optional Response result format
  • xml (default) | json

Request example

The following is a sample request.

curl --location 'https://ncloud.apigw.ntruss.com/vpc/v2/createSubnet
?regionCode=KR
&zoneCode=KR-1
&vpcNo=***04
&subnetName=test-***
&subnet=***.***.1.0/24
&networkAclNo=***31
&subnetTypeCode=PUBLIC
&usageTypeCode=GEN' \
--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

The following describes the response format.

Response body

See SubnetList for the response body.

Response status codes

For information about the HTTP status codes common to all VPC APIs, see VPC response status codes.

Response example

The following is a sample response.

<createSubnetResponse>
  <requestId>0f539b1b-10ef-43fa-a2c4-3670e601251b</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>CREATING</code>
        <codeName>creating</codeName>
      </subnetStatus>
      <createDate>2020-07-31T14:32:28+0900</createDate>
      <subnetType>
        <code>PUBLIC</code>
        <codeName>Public</codeName>
      </subnetType>
      <usageType>
        <code>GEN</code>
        <codeName>General</codeName>
      </usageType>
      <networkAclNo>***31</networkAclNo>
    </subnet>
  </subnetList>
</createSubnetResponse>