Documentation Index

Fetch the complete documentation index at: https://cli.ncloud-docs.com/llms.txt

Use this file to discover all available pages before exploring further.

addRoute

Prev Next

VPC環境で利用できます。

概要

ルートテーブルにルートリストを追加します。

リクエスト

リクエストパラメータ

パラメータ名 必須の有無 タイプ 制約事項 説明
regionCode No String リージョンコード
ルートが追加されるルートテーブルのリージョン(Region)を決定できます。
regionCodeはgetRegionListアクションを通じて取得できます。
Default:getRegionList照会結果の最初のリージョンを選択
vpcNo Yes String VPC番号
ルートが追加されるルートテーブルのVPCを決定します。
vpcNoはgetVpcListアクションを通じて取得できます。
routeTableNo Yes String ルートテーブル番号
ルートが追加されるルートテーブル番号を決定します。
routeTableNoはgetRouteTableListアクションを通じて取得できます。
routeList.N.destinationCidrBlock Yes String 目的地のIPv4 CIDRブロック
追加するルートの目的地のIPアドレス範囲を指定します。
routeList.N.targetTypeCode Yes String 目的地タイプコード
追加するルートの目的地タイプを決定します。
Options : NATGW (NAT Gateway) | VPCPEERING (VPC Peering) | VGW (Virtual Private Gateway)
routeList.N.targetNo Yes String 目的地識別番号
目的地タイプに該当する目的地識別番号を決定します。
targetNoは各目的地タイプに該当する照会アクションを通じて取得できます。
routeList.N.targetName Yes String 目的地名
目的地タイプに該当する目的地名を入力します。
targetNameは各目的地タイプに該当する照会アクションを通じて取得できます。
responseFormatType No String レスポンス結果のフォーマットタイプ
Options : xml | json
Default : xml

レスポンス

レスポンスデータタイプ

  • routeListタイプ
RouteList extends CommonResponse
private Integer totalRows;
private List routeList = new ArrayList<>();
Route
private String routeTableNo;
private String destinationCidrBlock;
private String targetName;
private CommonCode targetType;
private String targetNo;
private Boolean isDefault;

リクエスト例

ncloud vpc addRoute --regionCode KR --vpcNo ***04 --routeTableNo ***38 --routeList "destinationCidrBlock='***.***.200.0/24', targetTypeCode='NATGW', targetNo='***9734', targetName='test-***'" "destinationCidrBlock='***.***.201.0/24', targetTypeCode='VGW', targetNo='***9735', targetName='test-***'"

レスポンス例

リクエストの実行後、当該ルートテーブルのルートリスト

<addRouteResponse>
  <requestId>2b97f2f0-39fc-40f0-9a8d-3eb6d40506e3</requestId>
  <returnCode>0</returnCode>
  <returnMessage>success</returnMessage>
  <totalRows>3</totalRows>
  <routeList>
    <route>
      <destinationCidrBlock>***.***.200.0/24</destinationCidrBlock>
      <targetName>test-***</targetName>
      <routeTableNo>***38</routeTableNo>
      <targetType>
        <code>NATGW</code>
        <codeName>NAT Gateway</codeName>
      </targetType>
      <targetNo>***9734</targetNo>
      <isDefault>false</isDefault>
    </route>
    <route>
      <destinationCidrBlock>***.***.0.0/16</destinationCidrBlock>
      <targetName>LOCAL</targetName>
      <routeTableNo>***38</routeTableNo>
      <targetType>
        <code>LOCAL</code>
        <codeName>Local</codeName>
      </targetType>
      <targetNo></targetNo>
      <isDefault>true</isDefault>
    </route>
    <route>
      <destinationCidrBlock>***.***.0.0/0</destinationCidrBlock>
      <targetName>INTERNET GATEWAY</targetName>
      <routeTableNo>***38</routeTableNo>
      <targetType>
        <code>IGW</code>
        <codeName>Internet Gateway</codeName>
      </targetType>
      <targetNo></targetNo>
      <isDefault>true</isDefault>
    </route>
  </routeList>
</addRouteResponse>