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 |
subnetNoList.N |
List<String> | Optional | Query the list with the subnet number.subnetNo can be obtained through getSubnetList. |
subnetName |
String | Optional | Query the list with the subnet name. |
subnet |
String | Optional | Query the list with the subnet IP address range.subnet =10.0.0.0/24 |
subnetTypeCode |
String | Optional | Query the list with the subnet type code.
|
usageTypeCode |
String | Optional | Query the list with the subnet purpose type code.
|
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
|
pageSize |
Integer | Conditional | |
subnetStatusCode |
String | Optional | Query the subnet list with the subnet status code.
|
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
|
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>