createSubnet

Prev Next

VPC環境で利用できます。

概要

Subnetを作成します。

リクエスト

リクエストパラメータ

パラメータ名 要否 タイプ 制約事項 説明
regionCode No String - リージョンコード
Subnetが作成されるリージョン(Region)を決定できる
regionCodeは、getRegionListアクションを通じて取得できる
Default: getRegionList照会結果の最初のリージョンを選択
zoneCode Yes String - ZONEコード
Subnetが作成されるゾーン(zone)を決定
zoneCodeは、getZoneListアクションを通じて取得できる
vpcNo Yes String - VPC番号
Subnetが作成される VPCを決定
vpcNoは、getVpcListアクションを通じて取得できる
subnetName No String Min: 3, Max: 30
英字の小文字、数字、特殊文字の「-」のみ入力でき、先頭文字は英字にすること
末尾文字は英字または数字にすること
- 作成する Subnet名
Default: NAVERクラウドプラットフォームが自動的に付与する
subnet Yes String VPCアドレスの範囲以下
private帯域(10.0.0.0/8,172.16.0.0/12,192.168.0.0/16)内で/16~/28の範囲にすること
Subnet IPアドレスの範囲
networkAclNo Yes String - Network ACL番号
networkAclNoは、getNetworkAclListアクションを通じて取得できる
subnetTypeCode Yes String - Subnetタイプコード
Options: PUBLIC(Internet Gateway専用 Y) | PRIVATE(Internet Gateway専用 N)
usageTypeCode No String - 用途タイプコード
Options: GEN(一般) | LOADB(ロードバランサ専用) | BM(ベアメタル専用) | NATGW(NAT Gateway専用)
responseFormatType No String - レスポンス結果のフォーマットタイプ
Options: xml | json
Default: xml

レスポンス

レスポンスデータのタイプ

  • SubnetListのタイプ
SubnetList extends CommonResponse
private Integer totalRows;
private List subnetList = new ArrayList<>();
Subnet
private String subnetNo;
private String vpcNo;
private String zoneCode;
private String subnetName;
private String subnet;
private CommonCode subnetStatus;
private Date createDate;
private CommonCode subnetType;
private CommonCode usageType;
private String networkAclNo;

リクエスト例

ncloud vpc createSubnet --regionCode KR --zoneCode KR-1 --vpcNo ***04 --subnetName test-*** --subnet ***.***.1.0/24 --networkAclNo ***31 --subnetTypeCode PUBLIC --usageTypeCode GEN

レスポンス例

<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>