addRoute
- Print
- PDF
addRoute
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Can be used in a VPC environment.
Overview
Add the routing list set in the routing table.
Request
Request parameter
Parameter Name | Required Status | Type | Restrictions | Description |
---|---|---|---|---|
regionCode | No | String | Region Code You can decide the region of the routing table where a route will be added. The regionCode can be obtained through the getRegionList action. Default: Select the first region of the getRegionList query results. | |
vpcNo | Yes | String | VPC number This determines the VPC of the routing table where a route will be added. vpcNo can be obtained through the getVpcList action. | |
routeTableNo | Yes | String | Routing table number This determines the number of the routing table where a route will be added. The routeTableNo can be obtained through the getRouteTableList action. | |
routeList.N.destinationCidrBlock | Yes | String | Destination IPv4 CIDR block This specifies the destination IP address range of the route to be added. | |
routeList.N.targetTypeCode | Yes | String | Destination type code This determines the destination type of the route to be added. Options : NATGW (NAT Gateway) | VPCPEERING (VPC Peering) | VGW (Virtual Private Gateway) | |
routeList.N.targetNo | Yes | String | Destination identification number This determines the destination identification number that corresponds to the destination type. targetNo can be obtained through a query action corresponding to each destination type. | |
routeList.N.targetName | Yes | String | Destination name Enter the destination name corresponding to the destination type. targetName can be obtained through a query action corresponding to each destination type. | |
responseFormatType | No | String | Format type for the response result Options : xml | json Default : xml |
Response
Response data type
- routeList type
RouteList extends CommonResponse |
---|
private Integer totalRows; |
private List |
Route |
---|
private String routeTableNo; |
private String destinationCidrBlock; |
private String targetName; |
private CommonCode targetType; |
private String targetNo; |
private Boolean isDefault; |
Example
Request example
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-***'"
Response example
The routing list of the corresponding routing table after executing the request
<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>
Was this article helpful?