Modify Routing Tables

Last updated: 2020-06-04 17:16:25


    This is a legacy API which has been hidden and will no longer be updated. We recommend using the new VPC API 3.0 which is standardized and faster.

    1. API Description

    This API (ModifyRouteTableAttribute) is used to modify the attributes of routing table.
    Domain for API

    After the modification, the original content of routing table will be totally replaced with the newly submitted content. If you need to add new routing policies, the new routing policies should be submitted together with the original content of routing table.

    2. Input Parameters

    The following request parameter list only provides API request parameters. Common request parameters need to be added when the API is called. For more information, refer to Common Request Parameters. The Action field for this API is ModifyRouteTableAttribute.

    Parameter Name Required Type Description
    vpcId Yes String ID of VPC to which the subnet belongs. It can be vpcId or unVpcId. unVpcId is recommended. For example, vpc-rqndayhs. It can be queried through API DescribeVpcEx.
    routeTableId Yes String The routing table ID assigned by the system, which can be routeTableId or unRouteTableId. unRouteTableId is recommended. For example: rtb-rqndayhs. It can be queried through API DescribeRouteTable.
    routeTableName No String Routing table name; up to 60 characters.
    routeSet.n No array (Optional) Content of routing table.
    routeSet.n.destinationCidrBlock Yes String Destination IP address range. It should not be within the VPC IP address range. For example:
    routeSet.n.nextType Yes String Type of next hop. Supported types: 0: public network gateway; 1: VPN gateway; 3: Direct Connect gateway; 4: peering connection; 7: sslvpn gateway; 8: NAT gateway; 9: general cvm
    routeSet.n.nextHub Yes String Next hop address. You just need to specify gateway IDs (new ID is recommended) of different next hop types and the system will automatically match to the next hop address.
    routeSet.n.description No String Route description, which should be limited to 60 characters.

    3. Output Parameters

    Parameter Name Type Description
    code Int Error code, 0: Succeeded, other values: Failed.
    message String Error message.

    4. Error Codes

    The following error code list only provides the business logic error codes for this API. For additional common error codes, refer to VPC Error Codes.

    Error Code Description
    InvalidVpc.NotFound VPC not exist. Please check the information you entered. You can query VPC through API DescribeVpcEx.
    InvalidRouteTableId.NotFound Routing table ID not exist. Please check the information you entered. It can be queried through API DescribeRouteTable.
    InvalidRouteTableName Invalid routing table name. It should be within 60 characters.
    RouteLimitExceeded Reached the upper limit of routing table policies. Please contact customer service for more resources. For more information, refer to VPC Usage Restrictions.
    RouteAlreadyExists The destination IP address range already exists in the routing table policy.
    InvalidRouteNextType Invalid next hop type. For supported types, refer to the descriptions of input parameters.
    InvalidRouteNextHub.NotFound The next hop address does not exist. Please check the information you entered.
    InvalidRoute.NextHubLimitExceeded The maximum number of paths in public network gateway ECMP is 8.

    5. Example


      &<Common request parameters>


        "code": 0,
        "message": ""

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback