addRouteTableSubnet

Prev Next

Available in VPC

Add an associated subnet list to a route table.

Syntax

The addRouteTableSubnet syntax is as follows:

./ncloud vpc addRouteTableSubnet \
    --vpcNo <vpc-no> \
    --routeTableNo <route-table-no> \
    --subnetNoList <subnet-no-list> \
    [--regionCode <KR|SGN|JPN>] \
    [--output <json|xml>]

Options

This section describes the options available when running addRouteTableSubnet.

Required options

The following options are required for addRouteTableSubnet.

Options Type Required Description
--vpcNo String Required VPC number
--routeTableNo String Required Route table number
--subnetNoList List Required Subnet number list
  • You can enter multiple items separated by spaces (e.g., --subnetNoList 1234 2345).
  • See getSubnetList.

Common options

For information about the options common to all vpc subcommands, see VPC options.

Examples

If the request to add an associated subnet is successful, the configuration information for each subnet is returned.

Command

The command example is as follows:

./ncloud vpc addRouteTableSubnet \
    --vpcNo 12345678 \
    --routeTableNo 45678901 \
    --subnetNoList 23456789 23456790 \
    --regionCode KR \
    --output json

Output

The output example is as follows:

{
  "addRouteTableSubnetResponse": {
    "totalRows": 2,
    "subnetList": [
      {
        "subnetNo": "23456790",
        "vpcNo": "12345678",
        "zoneCode": "KR-1",
        "subnetName": "test-subnet-02",
        "subnet": "10.0.4.0/24",
        "subnetStatus": {
          "code": "RUN",
          "codeName": "In operation"
        },
        "subnetType": {
          "code": "PUBLIC",
          "codeName": "Public"
        }
      },
      {
        "subnetNo": "23456789",
        "vpcNo": "12345678",
        "zoneCode": "KR-1",
        "subnetName": "test-subnet-01",
        "subnet": "10.0.1.0/24",
        "subnetStatus": {
          "code": "RUN",
          "codeName": "In operation"
        },
        "subnetType": {
          "code": "PUBLIC",
          "codeName": "Public"
        }
      }
    ],
    "requestId": "c9d0e1f2-a3b4-5678-cdef-901234567890",
    "returnCode": "0",
    "returnMessage": "success"
  }
}