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>